LinuxQuestions.org
Review your favorite Linux distribution.
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 05-04-2010, 02:00 AM   #1
snorket27
LQ Newbie
 
Registered: May 2010
Posts: 12

Rep: Reputation: 0
Sendmail access.db question


Hello. I've got a request from one of my company's subsidiaries to block all incoming and outgoing mail for a group of users. I've read up some guides on access.db and I know how to do that, but now they want to allow these users to receive emails from a few select domains, and block the rest.

To summarize:

1) Block all incoming and outgoing email to users in team A, except mail from gooddomain.com.
2) All other users can receive and send mail from/to any domain.

How do I do that?
 
Old 05-04-2010, 07:15 AM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,907

Rep: Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326
Hi and welcome to LQ

For the incoming you'll need procmail, that comes with most distros. Create or edit /etc/procmailrc (if teamA has a homedir it's better to use ~/.procmailrc) and use the following:
Code:
:0
* ! ^From:.*gooddomain.com
To: teamA@mydomain.com
/dev/null
If you use ~/.procmailrc the line "To: ..." is not needed

For the outgoing, edit /etc/mail/access and use
Code:
From:teamA@mydaomain.com REJECT
The run
Code:
makemap hash /etc/mail/access < /etc/mail/access
Regards

Last edited by bathory; 05-04-2010 at 09:19 AM.
 
1 members found this post helpful.
Old 05-05-2010, 03:15 AM   #3
snorket27
LQ Newbie
 
Registered: May 2010
Posts: 12

Original Poster
Rep: Reputation: 0
Thanks bathory. I'll give it a try.
 
  


Reply

Tags
access, sendmail


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
Sendmail config questions + Sendmail not reflecting changes to access db wbuik Linux - Networking 2 03-26-2009 05:02 AM
Sendmail access/configuration question NWBM Linux - Newbie 2 09-20-2008 07:24 AM
About sendmail access.db shipon_97 Linux - Networking 1 08-30-2006 12:31 AM
Sendmail /etc/mail/access issue (access.db) CactusS4 Linux - General 0 05-22-2004 07:59 PM
sendmail access db question jayjoboo Linux - Networking 0 05-23-2002 09:44 AM


All times are GMT -5. The time now is 08:37 AM.

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