[Mimedefang] Help with Unicode Subject (again please)

Mark admin at asarian-host.net
Thu Oct 23 15:53:50 EDT 2003


----- Original Message ----- 
From: "Stefan Schoeman" <stefan at internext.co.za>
To: <mimedefang at lists.roaringpenguin.com>
Sent: Thursday, October 23, 2003 9:21 PM
Subject: [Mimedefang] Help with Unicode Subject (again please)


> every now and again I get a message with a subject as follows:
>
> Subject:=?ISO-8859-1?B? ...  ==?=

It is MIME. It decodes to: "Subject:Re:Get Sildenafil Citrate  Online Cheap!
Internet Special!". In my own Milter (oy), I use something like this:

---------------------------
use MIME::Base64;
use MIME::QuotedPrint;

eval { $header =~ s/\=\?ISO.+\?B\?(.+)\?\=/decode_base64 ($1)/emgi; };
eval { $header =~ s/\=\?ISO.+\?Q\?(.+)\?\=/decode_qp ($1)/emgi; };
---------------------------

Perl is so powerful. :) But I always put an eval {} around, just in case the
decoding is having a bad trip (or a spammer set it up to crash).

- Mark



More information about the MIMEDefang mailing list