Re: DSpam Content Filter via Header_Checks

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 ...


Go Back   Usenet Forums > Mail Servers and Related > mailing.postfix.users

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-05-2005
Magnus Bäck
 
Posts: n/a
Default Re: DSpam Content Filter via Header_Checks

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
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 03:44 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0