LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   postfix: Prevent internel network traffic from using filter (https://www.linuxquestions.org/questions/linux-networking-3/postfix-prevent-internel-network-traffic-from-using-filter-458590/)

exodist 06-26-2006 07:42 PM

postfix: Prevent internel network traffic from using filter
 
I have these lines in my master.cf on postfix:

Code:

filter    unix  -      n      n      -      10      pipe
  flags=Rq user=filter argv=/usr/local/sbin/newfilter.pl ${sender} ${recipient}
smtp      inet  n      -      n      -      -      smtpd
        -o content_filter=filter:dummy

What this does is pass all the mail comming into the system througha custom filter I made.

This works great, no spam because of our filter. Problem is outgoing mail is also going through the filter. This is a problem because on some of our outgoign mail we get this error:
snippet from log:
Code:

Jun 26 17:34:08 gma-web postfix/smtp[14753]: 67AA838E: to=<luke@gabbartandwoods.com>, relay=mail-fwd.sbc-webhosting.com[161.58.18.5], delay=1, status=bounced (host mail-fwd.sbc-webhosting.com[161.58.18.5] said: 554 Validating Sender (in reply to RCPT TO command))
only a couple servers do this, but they always do it.

I disabled the filter and it no longer happened, however without the filter our incomming mail is also unfiltered.

So, how can I make the filter only work on mail not sent by one of the valid local e-mail addresses? FYI the people using this server connect using ms outlook over smtp and pop3, so outgoing mail is also sent using smtp from other systems.

Berhanie 06-26-2006 10:45 PM

You can probably use a variation of this:

Quote:

A tip from Wietse Venema (2002-12-12):

| If you want to filter inbound SMTP mail only, then:
|
| /etc/postfix/main.cf:
| smtpd_recipient_restrictions =
| check_recipient_access hash:/etc/postfix/recipient_access
| ...the usual stuff here...
| reject_unauth_destination
|
| /etc/postfix/recipient_access:
| my.domain FILTER foo:bar
|
| That filters all the mail that has at least one recipient in your
| domain, and does not filter mail with external recipients only.
The above quote is from this page of the amavis documentation.


All times are GMT -5. The time now is 04:26 PM.