On 10/1/20 3:23 PM, Mohsen Masoudfar wrote:
Hi Mark, Thanks again for the helpful hint. It seems that I still miss something. I am running Mailman3.1.1. I ran the following on my test server. I am trying, for test purpose only, to filter PDF attachments.
First I just used the pass_type, assuming once this is set, everything else is filtered.
That's how it should work.
# mailman withlist testlist3@x.com
m.pass_types = ['multipart', 'message/rfc822', 'text', 'application/pgp-signature'] commit() print(list(m.pass_types)) ['multipart', 'message/rfc822', 'text', 'application/pgp-signature']
This let PDF be send by Mailman3. Well, I need to add filter_types too, so I did this:
It shouldn't unless athe Content-Type: of the PDF part was text/* or application/pgp-signature
m.filter_types = ['application/pdf'] commit() print(list(m.filter_types)) ['application/pdf']
This should allow ONLY the PDF and nothing else, not even the text/* message body parts.
Mailman3 still distributes PDF files as attachment. What am I doing wrong?
This is the final settings:
print(list(m.pass_types)) ['multipart', 'message/rfc822', 'text', 'application/pgp-signature'] print(list(m.filter_types)) ['application/pdf']
This is wrong. set
m.filter_types =[]
Look at the raw message you receive from the list. What is the VConten-Type of the PDF part?
Actually, what's m.filter_content? I suspect it's False which means don't do any content filtering.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan