I am looking to understand if I misinterpreted the documentation or if this is
an issue with postfix.
main.cf
smtpd_reject_unlisted_recipient = no
smtpd_data_restrictions = reject_unlisted_recipient
My intention is to prevent postfix from rejecting invalid recipients at the
RCPT command and only reject them at the DATA command. (Because I want a milter
to run before mail is rejected for unknown recipients.) The reason I set
smtpd_reject_unlisted_recipient=no is because when set to yes it will reject at
the RCPT command before milters run. I then assumed
smtpd_data_restrictions=reject_unlisted_recipient would reject invalid
recipients at the DATA stage.
I created an alias (virtual_alias_maps) that points to a non-existent user
(virtual_mailbox_maps) on the same valid domain (virtual_mailbox_domains). Just to
be clear, a valid user would be [email protected], the alias created was
[email protected] -> [email protected]. There is no valid user [email protected]
in virtual_mailbox_maps.
Postfix accepted delivery of the email sent to [email protected] and handed it
off the LMTP for [email protected]. LMTP rejected delivery to the non-existent
address causing postfix to then send out a backscatter bounce message exposing
the alias target [email protected] to the original sender.
I assumed smtpd_data_restrictions=reject_unlisted_recipient would have caught
this and rejected the mail before sending it to LMTP. Was it supposed to? Or
does reject_unlisted_recipient get disabled completely when
smtpd_reject_unlisted_recipient=no? Is it possible to have the behavior I am
expecting?