Le 12/11/2010 12:40, Mingliang Zu a écrit :
Hi,
I'm using postfix 2.3. My intention is to reject "MAIL FROM" command
(give a 501 syntax error) if the sender doesn't contains '@'. I have
worked on it for two days but without any luck.
The following lines are added to main.cf <http://main.cf>. I was
expecting "strict_rfc821_envelope" to do the trick, but unfortunately,
it doesn't.
smtpd_sender_restrictions =
permit_mynetworks,
reject_non_fqdn_sender,
reject_unknown_sender_domain,
permit
strict_rfc821_envelopes = yes
append_dot_mydomain = no
append_at_myorigin = no
don't do that. leave append_at_myorigin to its default value (yes). not
all mail comes in via smtp...
simply use:
smtpd_recipient_restrictions =
reject_non_fqdn_sender
reject_non_fqdn_recipient
permit_mynetworks
reject_unauth_destination
...
See my test with these configurations:
[r...@rhel5 postfix]# telnet localhost smtp
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 formail.localdomain ESMTP Postfix
HELO LOCALHOST
250 formail.localdomain
MAIL FROM:<ABC>
250 2.1.0 Ok <=========== Still Ok
next time, go until RCPT TO. the default for postfix is to reject after
RCPT TO, not before.
What other configurations can I add to make it not Ok?
Thanks in advance,
Mingliang