LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


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

Rep: Reputation: 47
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.
 
Old 06-26-2006, 10:45 PM   #2
Berhanie
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:

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.

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


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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

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