Question : Filtering a domain to send mail to an accout

I have a smarthost running postfix who gets all mail from my internal servers (almost 60) and rely them to internet. I have several different domains and a lot of users too.

The problem:
Sometimes I got complaints from yahoo for example, that some account let say user1@oneofmydomain in sending spam to [email protected].

My question:
How can I deny access for user1@oneofmydomain  OR  *@oneofmydomain  to send mail to [email protected]

Answer : Filtering a domain to send mail to an accout

This is a tricky one and it will require the use of restriction classes.
It is easy to block mail from user1@oneofmydomain or mail to [email protected], but if you want to block mail to [email protected] only when it is from user1@oneofmydomain then the restriction classes can help you.

This is because you can only lookup one thing at a time in an access list.

Existing restriction classes are for example permit, reject or dunno.
You can make a new one such as mycheck

in sender restrictions these would be valid

user1@oneofmydomain      permit #permit any mail from user1@oneofmydomain
user1@oneofmydomain      reject  #reject any mail from user1@oneofmydomain
user1@oneofmydomain      mycheck #check another access list for any mail from user1@oneofmydomain

In /etc/postfix/mycheck_recipient_access

[email protected]      reject


For more information see
http://www.postfix.org/RESTRICTION_CLASS_README.html


1:
2:
smtpd_restriction_classes = mycheck
mycheck = check_recipient_access hash:/etc/postfix/mycheck_recipient_access
Random Solutions  
 
programming4us programming4us