Re: [Mimedefang] Detecting content-type of message in filter_end

2004-10-27 Thread Aleksandar Milivojevic
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 [EMAIL PROTECTED]Pollard Banknote Limited
Systems Administrator   1499 Buffalo Place
Tel: (204) 474-2323 ext 276 Winnipeg, MB  R3T 1L7
___
Visit http://www.mimedefang.org and http://www.canit.ca
MIMEDefang mailing list
[EMAIL PROTECTED]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang


Re: [Mimedefang] Detecting content-type of message in filter_end

2004-10-26 Thread Aleksandar Milivojevic
David F. Skoll wrote:
There's a bug in MIMEDefang; the rebuilt entry that gets passed to filter_end
is always of type multipart/mixed, multipart/alternative or multipart/digest.
The next release will fix this.
BTW, while we are at it.  Is there a reason why $entity is not passed as 
an argument to filter_begin?  It could be usefull if it was possible to 
do some checks on the message before it is modified by MIMEDefang.  It 
would be more efficient if I don't need to wait until filter_end to do 
some simple checks.

--
Aleksandar Milivojevic [EMAIL PROTECTED]Pollard Banknote Limited
Systems Administrator   1499 Buffalo Place
Tel: (204) 474-2323 ext 276 Winnipeg, MB  R3T 1L7
___
Visit http://www.mimedefang.org and http://www.canit.ca
MIMEDefang mailing list
[EMAIL PROTECTED]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang


Re: [Mimedefang] Detecting content-type of message in filter_end

2004-10-26 Thread David F. Skoll
On Tue, 26 Oct 2004, Aleksandar Milivojevic wrote:

 BTW, while we are at it.  Is there a reason why $entity is not passed as
 an argument to filter_begin?  It could be usefull if it was possible to
 do some checks on the message before it is modified by MIMEDefang.  It
 would be more efficient if I don't need to wait until filter_end to do
 some simple checks.

It's for historical reasons; changing it now would break a lot of filters.
It's probably not more efficient anyway, because MIMEDefang always
loops through filter_begin / filter - filter - ... - filter / filter_end
anyway.  You can do a test in filter_begin and use the results of that
test to bail out of filter processing if you really need the speedup.

Regards,

David.
___
Visit http://www.mimedefang.org and http://www.canit.ca
MIMEDefang mailing list
[EMAIL PROTECTED]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang


Re: [Mimedefang] Detecting content-type of message in filter_end

2004-10-26 Thread Aleksandar Milivojevic
David F. Skoll wrote:
There's a bug in MIMEDefang; the rebuilt entry that gets passed to filter_end
is always of type multipart/mixed, multipart/alternative or multipart/digest.
The next release will fix this.
I see there's MIMEDefang 2.45 on the web site (I was still using 2.44). 
 I guess the release that fixes this bug will be 2.46?

--
Aleksandar Milivojevic [EMAIL PROTECTED]Pollard Banknote Limited
Systems Administrator   1499 Buffalo Place
Tel: (204) 474-2323 ext 276 Winnipeg, MB  R3T 1L7
___
Visit http://www.mimedefang.org and http://www.canit.ca
MIMEDefang mailing list
[EMAIL PROTECTED]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang


Re: [Mimedefang] Detecting content-type of message in filter_end

2004-10-26 Thread David F. Skoll
On Tue, 26 Oct 2004, Aleksandar Milivojevic wrote:

   I guess the release that fixes this bug will be 2.46?

Yup.  It will be out very soon.

Regards,

David.
___
Visit http://www.mimedefang.org and http://www.canit.ca
MIMEDefang mailing list
[EMAIL PROTECTED]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang


[Mimedefang] Detecting content-type of message in filter_end

2004-10-25 Thread Aleksandar Milivojevic
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 [EMAIL PROTECTED]Pollard Banknote Limited
Systems Administrator   1499 Buffalo Place
Tel: (204) 474-2323 ext 276 Winnipeg, MB  R3T 1L7
___
Visit http://www.mimedefang.org and http://www.canit.ca
MIMEDefang mailing list
[EMAIL PROTECTED]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang


Re: [Mimedefang] Detecting content-type of message in filter_end

2004-10-25 Thread David F. Skoll
On Mon, 25 Oct 2004, Aleksandar Milivojevic wrote:

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

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

There's a bug in MIMEDefang; the rebuilt entry that gets passed to filter_end
is always of type multipart/mixed, multipart/alternative or multipart/digest.
The next release will fix this.

Regards,

David.
___
Visit http://www.mimedefang.org and http://www.canit.ca
MIMEDefang mailing list
[EMAIL PROTECTED]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang