Hi everyone,in trying to tinker a little with my postfix, I stumbled on an issue regarding filtering with header_checks.
I am trying to filter a few emails according to their From: header (and not their envelope-from). So, basically, what I did was to add a header_checks in my main.cf, like this :
/^From:(.*)<someone@domain\.com>/ FILTER prog:dummy like it is told in http://www.postfix.org/FILTER_README.html And in master.cf : prog unix - n n - 10 pipeflags=Rq user=filter argv=/etc/postfix/filtre_spam -f ${sender} -- ${recipient}
My prog is quite like the shell script given in example. However, I soon realized that it was no good, for an infinite loop was being created when prog was sending the email back with sendmail.
Which is why I read the second part of the doc, about advanced content filtering. I created a new service in master.cf, just like the doc, to reinject the mail back to postfix in a way that would stop the header_checks :
localhost:10026 inet n - n - 10 smtpd -o content_filter=-o receive_override_options=no_unknown_recipient_checks,no_header_body_checks,no_milters
-o smtpd_helo_restrictions= -o smtpd_client_restrictions= -o smtpd_sender_restrictions= -o smtpd_relay_restrictions= -o smtpd_recipient_restrictions=permit_mynetworks,reject -o mynetworks=127.0.0.0/8 -o smtpd_authorized_xforward_hosts=127.0.0.0/8Now what I don't understand, is how to call my prog in header_checks, and have it reinject the mail through localhost:100026 ? The example given in http://www.postfix.org/FILTER_README.html filters everything, and it is noted in the end of the page that it can be used with header_checks, but I don't understand how.
I've tried putting : /^From:(.*)<someone@domain\.com>/ FILTER prog:localhost:10026 in header_checks, but to no avail. Could you please enlighten me as to how to proceed ? -- Mickaël DEQUIDT IFREMER - Service IMN/IDM/RIC Centre Ifremer Bretagne - ZI de la pointe du diable CS 10070 - 29280 Plouzané Tel : +33 (0)2 98 22 46 04 - Fax : +33 (0)2 98 22 46 47
smime.p7s
Description: Signature cryptographique S/MIME