This is a discussion on Re: DSpam Content Filter via Header_Checks within the mailing.postfix.users forums, part of the Mail Servers and Related category; On Thursday, May 05, 2005 at 11:12 CEST, Jens Mittag <jens.mittag@prime23.de> wrote: > I ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
On Thursday, May 05, 2005 at 11:12 CEST,
Jens Mittag <jens.mittag@prime23.de> wrote: > I have a problem with header_checks and applying FILTER rules, > depending on the header of the e-mail. > At the moment, I am using content_filter on the smtp transport as > specified in master.cf: >=20 > ## master.cf: > smtp inet n - - - - smtpd -o content_filter=3Ddspam: > dspam unix - n n - 10 pipe > flags=3DRu user=3Dvmail argv=3D/usr/local/bin/dspam --deliver=3Dinnoc= ent=20 > --user ${recipient} -i -f $sender -- $recipient >=20 > DSpam checks the mail and sends it back to postfix via sendmail. That > works fine, but has the disadvantage, that every outgoing mail is > checked too. I would like to have only incoming mail for my local > domains get checked. http://www.postfix.org/FILTER_README.html#remote_only > I thought, let's decide that in the header_checks... to prevent "too > many hops", I first check if the mails was already scanned by DSpam > (X-DSPAM-Result Header) and if not, check if the mail is for my local > domains and whether or not, send it through DSpam. >=20 > ## main.cf > header_checks =3D pcre:/etc/postfix/header_checks >=20 > ## /etc/postfix/header_checks (version 1) > if !/^X-DSPAM-Result/ > /for <.*@(domain1.tld|domain2.tld|domain3.tld)>/ FILTER dspam: > endif That's not how header_checks works. One line is inspected at a time. The above means "if this line does not match /^X-DSPAM-Result/ and THE SAME LINE matches /for <.*@(domain1.tld|domain2.tld|domain3.tld)>/ then apply the FILTER action". There is no need to use something that complex. Example: smtpd_client_restrictions =3D check_client_access cidr:/path/to/file /path/to/file: # Your local subnet(s) 1.2.3.0/24 OK # A catch-all for the rest 0.0.0.0/0 FILTER dspam: [...] --=20 Magnus B=E4ck magnus@dsek.lth.se |
![]() |
| Thread Tools | |
| Display Modes | |
|
|