On 09/04/2020 00:29, @lbutlr wrote:
> On 08 Apr 2020, at 17:16, Allen Coates <znab...@cidercounty.org.uk> wrote:
>> On 09/04/2020 00:01, @lbutlr wrote:
>>> Given an email address of user+ama...@example.com 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. :/
>>>
>>>
>>
>> Funny you should mention that - within the last half-hour I have come up with
>> (for header checks file):-
>>
>> if /^From:.*amazon\.co\.uk/
>> !/\<.*\@.*amazon\.co\.uk\>/ WARN Fake Amazon address
>> endif
>>
>> Completely untested - it would be interesting to know if I am getting my
>> regexp
>> syntax right. :-)
>>
>> Not quite what you wanted - but hope it helps.
>
> Useful, but not helpful in this case because there is no way to have postfix
> check two headers
>
> (If TO contains “amazon” and FROM_ does not contain “amazon”) isn’t something
> postfix can do, but perhaps there is a milter out there that can.
>
> I can do it in Sieve, but I would prefer to reject them before they get
> delivered.
>
>
Thinking on a tangent - I have a method of protecting my mailing-list
identities; I accept the list-server(s) by host identity and then reject the
destination address(es) :-
check_client_access cidr:/etc/postfix/listserver_access.cidr,
check_recipient_access hash:/etc/postfix/recipient_access
Allen C