LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 02-15-2012, 09:17 AM   #1
austin001
LQ Newbie
 
Registered: Feb 2012
Posts: 8

Rep: Reputation: Disabled
Block outgoing mail for specific users


Good morning! I would like to make it so certain users can only send mail internally. I'm using postfix, spamassassin and amavis with procmail. I can't figure out how to simply filter outgoing mail with procmail. My intention was to use procmail to filter outgoing and write two rules for each of these users. The first rule would allow them to send to the local domain. The second would block anything else they send. Like this...

:0:
* ^From.user@ourdomain.org
* ^To:.*ourdomain.org
${DEFAULT}


:0
*^From:.user@ourdomain.org
/dev/null

Can anyone help? This is a fix in lieu of building a separate secure email server with SSL, TLS and all that for secure communications only. I thought, theoretically, these rules should work as they are processed in order. If a mail matching the first rule goes through procmail stops processing, but postfix is obviously not using procmail for outbound. What's sad is I had this working at one point and now I don't know what I changed to break it.
 
Old 02-15-2012, 02:46 PM   #2
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
good morning, austin001, and welcome to lq.

regarding your question, you can't filter outgoing mail with procmail, since procmail is called at the time of delivery. you need to filter the mail at the time of submission. this may be sufficient for your needs.
 
Old 02-27-2012, 03:51 PM   #3
austin001
LQ Newbie
 
Registered: Feb 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
Spectactular! Works Beautifully! I read at least 50 other posts before posting this question. Everyone else leaves out the local_domains part, which is the key.
 
  


Reply


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
How to block all outgoing port 25 except internal mail server. sattech2000 *BSD 9 04-25-2011 09:23 AM
how to do outgoing mail only to a specific domain orko Linux - Server 1 07-17-2010 01:49 PM
How to block users from sending e-mail to specific domain satish_k Linux - Newbie 1 03-12-2008 10:53 PM
Send outgoing mail to a specific IP address and port starkhorn Linux - Software 1 01-31-2008 05:20 PM
Iptables/Guarddog - how to block specific outgoing packets craftybytes Linux - Security 7 05-19-2006 12:26 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration