On 7/28/2010 8:53 AM, Lunar_Lamp wrote:
My aim is to restrict a web application from sending to any domains
other than those specifically allowed. Obviously, by default postfix
is allowing me to send to all domains. However, I have not been able
to restrict - all domains are still sent to.
All emails are sent from the same email address (excerpt from maillogs
- apologies to those who dislike obfuscated domains):
logs:
#### snip ####
Jul 28 09:13:04 rt1 postfix/pickup[3465]: 57BF616180B2: uid=48
from=<apache>
Jul 28 09:13:04 rt1 postfix/cleanup[3545]: 57BF616180B2:
message-id=<rt-3.8.7-14324-1280308384-91.4989-1...@mydomain.com>
Jul 28 09:13:04 rt1 postfix/qmgr[12167]: 57BF616180B2:
from=<apa...@hostname.subdomain.mydomain.com>, size=1181, nrcpt=1
(queue active)
#### snip ####
I added the following lines to my main.cf to achieve my aims:
#### snip ####
smtpd_recipient_restrictions = check_sender_access
hash:/etc/postfix/restricted_senders
smtpd_restriction_classes = allowed_only
allowed_only = check_recipient_access
hash:/etc/postfix/allowed_domains, reject
#### snip ####
Your webapp is submitting mail via the sendmail(1) command
smtpd restrictions apply to mail arriving via smtpd only.
To get the result you want, you must change your webapp to either: 1)
restrict the emails; 2) submit via smtp