[Mimedefang] Content-Transfer-Encoding header

dm at davidmeissner.com dm at davidmeissner.com
Tue May 25 20:54:23 EDT 2004


I have noticed that some spam seems to come from mailers that have trouble 
generating correct Content-Transfer-Encoding headers. There seems to be a flood 
taking place right now from a mailer that uses "Content-Transfer-Encoding: plain" for 
the header. In the past I have seen things like "quoted-pintable" and "8Bits".

To catch the easy ones, I am testing the following function for my filter:

sub filter_bad_encoding ($) {
    my($entity) = @_;
    my($bad_enc);
    $bad_enc = '(plain|quoted-pintable)';
    $enc = $entity->head->mime_encoding;
    
    if ($enc =~ /$bad_enc/i) {
        return 1;
    }
    return 0;
}

A few lines in the filter() function call this, and bounce messages that return the error. 

I could add some of the additional malformed headers that I come across to the list 
of bad types, but I have a question for the list: since there is a fairly small number of 
valid encoding types, would it make sense to test for only the valid ones and bounce 
all other messages?

I realize that there are many malformed clients out there, so the drawback might be 
that too many valid messages would get bounced. I'm just wondering how much of a 
problem that might be.

-David Meissner





More information about the MIMEDefang mailing list