Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 06-26-2006, 07:42 PM   #1
Senior Member
Registered: Aug 2003
Location: Portland, Oregon
Distribution: Gentoo
Posts: 1,372

Rep: Reputation: 47
postfix: Prevent internel network traffic from using filter

I have these lines in my on postfix:

filter    unix  -       n       n       -       10      pipe
  flags=Rq user=filter argv=/usr/local/sbin/ ${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:
Jun 26 17:34:08 gma-web postfix/smtp[14753]: 67AA838E: to=<>,[], delay=1, status=bounced (host[] 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.
Old 06-26-2006, 10:45 PM   #2
Senior Member
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
You can probably use a variation of this:

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

| If you want to filter inbound SMTP mail only, then:
| /etc/postfix/
| 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.

Last edited by Berhanie; 06-27-2006 at 06:18 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
can't filter traffic of vmware guest os xadian Linux - Networking 2 08-18-2005 04:50 PM
prevent flooding from internel network masand Linux - Security 0 04-28-2005 09:31 PM
postfix id_viorel Linux - Newbie 2 07-20-2004 08:22 AM
How to filter traffic using port+process in IPTables muath Linux - Security 10 03-01-2004 11:20 AM
Prevent mailbombing in Postfix Nicke Linux - Software 6 09-18-2003 04:20 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:25 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration