[Mimedefang] Q about Rejecting based on charset

Matthew.van.Eerde at hbinc.com Matthew.van.Eerde at hbinc.com
Fri Jun 24 14:13:03 EDT 2005


Dirk the Daring wrote:
>    I found some sample filter code on a website, and I'm trying to adapt 
> it to what I want to do, which is reject E-Mail using these character
> sets. I'd appreciate a sanity-check of both the code and the idea.
> 
>    This is what I'm adding to "sub filter":
> 
>    $head = $entity->head;
>    $charset = $head->mime_attr("content-type.charset");
>    if (defined($charset)) {
>      $charset =~ tr/A-Z/a-z/;
>      if ($charset eq "ks_c_5601-1987" or
>          $charset eq "euc-kr" or
>          $charset eq "iso-2022-kr" or
>          $charset eq "big5" or
>          $charset eq "windows-1251" or
>          $charset eq "windows-1255" or
>          $charset eq "gb2312" or
>          $charset eq "gb2312_charset") {
>          syslog('alert',"MIMEDefang rejected an E-Mail using charset
>          $charset"); return ('REJECT', "CONTENT VIOLATION: Mail using
>      character set $charset not accepted here"); else {
>          return action_accept();
>      }
>    }

Implementation: looks sane
Idea: looks insane

I think you're over-reacting.  This is verging on an RFC violation:
http://www.faqs.org/rfcs/rfc2821.html

"SMTP systems are expected to make every reasonable effort to accept mail directed to Postmaster from any other system on the Internet.
In extreme cases --such as to contain a denial of service attack or other breach of security-- an SMTP server may block mail directed to Postmaster.  However, such arrangements SHOULD be narrowly tailored so as to avoid blocking messages which are not part of such attacks."

-- 
Matthew.van.Eerde (at) hbinc.com                 805.964.4554 x902
Hispanic Business Inc./HireDiversity.com         Software Engineer
perl -e"map{y/a-z/l-za-k/;print}shift" "Jjhi pcdiwtg Ptga wprztg,"




More information about the MIMEDefang mailing list