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 user list and domain list. All users in user_list should only be able to send mail to domains listed in allow_urls.

user_list

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

allow_urls

domain1.ru limited_class
domain2.ru limited_class

I have these lists defined in my main.cf, 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

2 Answers 2

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

user_list

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

allow_urls

domain1.ru OK
domain2.ru OK

main.cf

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

 
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.