LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 10-23-2006, 08:26 AM   #1
vrsic
LQ Newbie
 
Registered: Oct 2003
Posts: 9

Rep: Reputation: 0
Rejecting non local mail for specific e-mail address


Hello!

I have a server with Debian Sarge, Postfix, Amavis, Spamassasin ... I would like to restrict one specific local e-mail address to receive emails which are not local or from our home domain. This e-mail address is actually an alias for large group of people (local e-mail accounts). I want only local users or users from our domain to be able to send email to group using this alias.

Thank you for ideas!


DarkO
 
Old 10-24-2006, 12:26 AM   #2
WindowBreaker
Member
 
Registered: Oct 2005
Distribution: Slackware
Posts: 228

Rep: Reputation: 31
The parameter you need to change is "smtpd_recipient_restrictions".
By default, it's set to
Quote:
smtpd_recipient_restrictions = permit_mynetworks, reject_unauth_destination
You will want to change it to
Quote:
smtpd_recipient_restrictions = permit_mynetworks, check_recipient_access hash:/etc/postfix/recipient_access, reject_unauth_destination
The easiest way to set this parameter is to run the following, as root, from a command prompt (the alternative is to set it manually in main.cf).
Code:
postconf -e "smtpd_recipient_restrictions = permit_mynetworks, check_recipient_access hash:/etc/postfix/recipient_access, reject_unauth_destination"
Once that's done, you should create the file /etc/postfix/recipient_access, and it should contain the following:
Quote:
internaluser@whatever.com REJECT
Then, you need to run:
Code:
postmap /etc/postfix/recipient_access
Then reload postfix with
Code:
postfix reload
and you're all set.

Cheers
 
Old 10-24-2006, 01:43 AM   #3
vrsic
LQ Newbie
 
Registered: Oct 2003
Posts: 9

Original Poster
Rep: Reputation: 0
Thank you very much! This is the best answer I've got in a very long time.
Thanks again!

Darko

Last edited by vrsic; 10-24-2006 at 02:01 AM.
 
Old 10-24-2006, 03:11 AM   #4
WindowBreaker
Member
 
Registered: Oct 2005
Distribution: Slackware
Posts: 228

Rep: Reputation: 31
Quote:
Originally Posted by vrsic
Thank you very much! This is the best answer I've got in a very long time.
Thanks again!

Darko
Did it work the way you wanted?
 
Old 10-24-2006, 03:46 AM   #5
vrsic
LQ Newbie
 
Registered: Oct 2003
Posts: 9

Original Poster
Rep: Reputation: 0
It works exactly as I wanted. It allows our local and VPN users to send mail to this address and rejects mails from other IPs!

Thank you again!!!
 
  


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
Customizing DNS Cache so that it resolves mail.localdomain.com to local ip address gugabaga Linux - Networking 2 02-22-2006 05:40 AM
routing mail out on a specific IP address LordFarquad Linux - Networking 0 09-01-2004 08:20 PM
Sendmail is rejecting some mail member57 Linux - Networking 2 04-20-2004 12:18 PM
How to allow mail relay of specific IP address Stev Linux - Networking 2 02-13-2004 07:40 AM
Redirecting non-user mail to a local address? Trent Hatred Red Hat 2 11-19-2003 11:59 AM


All times are GMT -5. The time now is 11:48 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration