[Mimedefang] Plug-in to transcode messages

Jim McCullars jim at info.uah.edu
Wed Mar 7 14:00:17 EST 2007



On Tue, 6 Mar 2007, Philip Prindeville wrote:

> I'm tired of seeing messages written in completely
> superfluous (in that they don't provide any functionality
> not already present in the "open standards" that exist)
> encodings.
>
> Like "gb2312" and "big5" and "windows-1252", etc.

   On a mail machine that I alone receive email on, I reject those.  On
our campus email relay, I flag them so that a user can reject them if they
wish.  In sub filter(), I have this:

#
#  Look for foreign character sets and create a header that a user can filter
#  against.  13-JUN-2006 JHMc
#
    $head = $entity->head;
    my $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 "koi8-r" or
        $charset eq "gb2312" or
        $charset eq "windows-1251" or
        $charset eq "big5") {
          action_add_header('X-UAH-Foreign-Charset',"$charset")
      }
    }


If you don't want to deal with them at all, action_add_header could just
as easily be a return of action_bounce.  I don't know about converting
them to a "readable" character set.

   HTH...

Jim McCullars
University of Alabama in Huntsville




More information about the MIMEDefang mailing list