[Mimedefang] Detecting content-type of message in filter_end
Aleksandar Milivojevic
amilivojevic at pbl.ca
Wed Oct 27 10:31:27 EDT 2004
Aleksandar Milivojevic wrote:
> 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");
> }
[snip]
I've found workaround that can be used after SpamAssassin check
(spam_assassin_check()) is done:
$sa_status = spam_assassin_status();
$ct = $sa_status->get("content-type");
$dn = $sa_status->get("disposition-notification-to");
... and so on ...
will fetch correct header info (for all headers).
Using SpamAssassin just to fetch header values would be an overkill, but
if SpamAssassin is used anyhow, above will work.
Hopefully, the bug in MIMEDefang will be completely resolved soon, so
that $entity can be used for this...
--
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