On 9 Apr 2020, at 0:43, Bill Cole wrote:

On 8 Apr 2020, at 19:01, @lbutlr wrote:

Given an email address of [email protected] how can I reject all emails to that address that do not come from amazon.com?

I think I did something like this once but if I did, I didn’t keep notes. :/

Since the decision can be made based on envelope parameters, you should be able to do this with a restriction class. Example:

/etc/postfix/main.cf:

   smtpd_restriction_classes = spooftargets
smtpd_recipient_restrictions = [...] check_recipient_access pcre:/etc/postfix/recipient_checks.pcre [...] spooftargets = check_sender_access pcre:/etc/postfix/spooftarget-senders

/etc/postfix/recipient_checks.pcre:

    /^[email protected]$/      spooftargets

/etc/postfix/spooftarget-senders:

/bounce@/ 554 5.7.1 This address does not accept mail from bounce-processors


As a result, I reject all mail with a sender that matches 'bounce@' aimed at '[email protected]' which is an address that has been exposed for 25 years in Usenet but never used for any sort of subscription or transaction. One could just as easily make '[email protected]' a member of a restriction class and only accept mail for it if the client name and sender name match legitimate Amazon patterns.

I should also note, in case it is not obvious: this does not scale well.


--
Bill Cole
[email protected] or [email protected]
(AKA @grumpybozo and many *@billmail.scconsult.com addresses)
Not For Hire (currently)

Reply via email to