[Mimedefang] Detecting content-type of message in filter_end

Aleksandar Milivojevic amilivojevic at pbl.ca
Mon Oct 25 15:41:58 EDT 2004


I wanted to extend my mimedefang-filter to block disposition 
notifications (return receipts).

In short, what I attempted to do in filter_end was the following:

if (lc($entity->head->get("content-type")) =~
     m+multipart/report.*disposition-notification+) {
         md_graphdefang_log('disposition-notification');
         return action_bounce("Disposition notifications not allowed");
}

But, for some reason it hasn't worked.  To find out what's going on, 
I've added call to md_syslog:

    md_syslog("notice",
              "Content type is "
              . lc($entity->head->get("content-type")));

What I get logged in the syslog is:

Oct 25 14:13:49 somehost mimedefang.pl[14322]: Content type is 
multipart/mixed;     boundary="------------mdn020605010008050205010504"

None of the parts of the test message were of the type 
"multipart/mixed".  Test message was actual return receipt generated by 
Mozilla Thunderbird.

It containted these top-level headers:

MIME-Version: 1.0
Content-Type: multipart/report; report-type=disposition-notification;
         boundary="------------mdn020605010008050205010504"

As you can see, boundary is the same as logged by md_syslog, however 
content-type itself was wrongly reported.

There's nothing in mimedefang-filter that would change top-level 
content-type of the message, and when I examine the message after it was 
delivered to my mailbox, it contains correct headers.

Is this known issue with MIMEDefang?  Documentation says that $entity 
argument of filter_end will contain original message (unless modified by 
previous filter* funcitions).

MIMEDefang version 2.44, MIME-tools version 5.411a-RP-Patched-02.

-- 
Aleksandar Milivojevic <amilivojevic at pbl.ca>    Pollard Banknote Limited
Systems Administrator                           1499 Buffalo Place
Tel: (204) 474-2323 ext 276                     Winnipeg, MB  R3T 1L7



More information about the MIMEDefang mailing list