Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a user list and domain list. All users in user_list should only be able to send mail to domains listed in allow_urls.


/^user1@*/   OK
/^user2@*/   OK
/^user3@*/   OK
/.*@*/ REJECT 5.4.3. Sorry..

allow_urls limited_class limited_class

I have these lists defined in my, but it doesn't appear to be working. Any user can send to any domain.

smtpd_restriction_classes = limited_class
limited_class = check_sender_access regexp:/etc/postfix/border/user_list, reject
smtpd_sender_restrictions =  check_recipient_access hash:/etc/postfix/border/allow_urls

What am I doing wrong?

share|improve this question

You did nothing wrong. The restrictions you configured is for incoming mail, where incoming means sent from "outside".

When you now say "every user can send..." then this is true. You can't restrict the destination address when sending to the outside world.

If this doesn't answer your question, then please rework on your question to express what you really mean. Or better: What do you want to achieve? You only say that it doesn't work without specifying what.

share|improve this answer

Right solution below


/^user1@*/   limited_class
/^user2@*/   limited_class
/^user3@*/   limited_class
/.*@*/ REJECT 5.4.3. Sorry..

allow_urls OK OK

smtpd_restriction_classes = limited_class
limited_class =  check_recipient_access hash:/etc/postfix/border/allow_urls reject
smtpd_sender_restrictions = check_sender_access regexp:/etc/postfix/border/user_list 
share|improve this answer

Your Answer


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.