LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Rejecting non local mail for specific e-mail address (http://www.linuxquestions.org/questions/linux-server-73/rejecting-non-local-mail-for-specific-e-mail-address-494828/)

vrsic 10-23-2006 07:26 AM

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

WindowBreaker 10-23-2006 11:26 PM

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

vrsic 10-24-2006 12:43 AM

Thank you very much! This is the best answer I've got in a very long time.
Thanks again!

Darko

WindowBreaker 10-24-2006 02:11 AM

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?

vrsic 10-24-2006 02:46 AM

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!!!


All times are GMT -5. The time now is 12:58 AM.