Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a postfix mail server correctly configured (I hope) and running on openSUSE 11.3. I can send email to local users from any location, but this also means that I (or anyone else) can send remote emails to the root account. How do I reject remote emails to the root account, while allowing regular users to receive email?

share|improve this question
    
This is interesting because some systems that detect open relays think that allowing mail to root is equivalent to allowing relaying. This may be because Postfix used to combine the concepts of relay and recipient restrictions: postfix.org/SMTPD_ACCESS_README.html –  sventech Sep 12 '13 at 19:51
add comment

2 Answers

up vote 2 down vote accepted

The correct way to reject certain addresses is to put this directive in the main.cf file:

smtpd_recipient_restrictions = 
    check_recipient_access hash:/etc/postfix/recipient_access
    ...

Then on the /etc/postfix/recipient_access file:

root@domain REJECT

followed by the usual:

/etc/postfix/recipient_access
share|improve this answer
    
This is interesting because some systems that detect open relays think that allowing mail to root is equivalent to allowing relaying. This may be because Postfix used to combine the concepts of relay and recipient restrictions: –  sventech Sep 12 '13 at 19:51
add comment

I think if you edit /etc/postfix/sender_access and add:

root@$mydomain REJECT

I'm not entirely sure though.

EDIT: Try using /etc/postfix/header_checks with the "To" header.

share|improve this answer
    
That seems to be useful for rejecting sender addresses and not destination addresses. –  devius Feb 5 '11 at 23:09
1  
There is a recipient_access file that can be used though. –  devius Feb 5 '11 at 23:29
    
Ahhhh, ok. Thanks! –  atx Feb 5 '11 at 23:37
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.