[exim] Re: Rejecting connections that have only IP as sender…

Top Page
Delete this message
Reply to this message
Author: Cyborg
Date:  
To: exim-users
Subject: [exim] Re: Rejecting connections that have only IP as sender_helo
Am 28.05.23 um 04:04 schrieb AC via Exim-users:
> I was searching through the lists and reading the documentation but
> I'm coming up short on blocking IP only senders.
>
> I've seen ACLs checking sender_helo_name using isip{} but that doesn't
> seem to do anything for the case of a literal IP:
>
> H=([185.17.76.25])
>
> What's the proper way to check for the above condition and reject it?
>

Simple:

drop    message         = invalid NON-FQDN HELO ($sender_helo_name),
please talk to your mailserveradmin about this
           condition  = ${if
match{$sender_helo_name}{\N^\[[0-9]+.*\N}{0}{1}}     <- unchecked regex,
may need adjustment
           condition  = ${if match{$sender_helo_name}{\N(\.|:)\N}{0}{1}}
           ... add more rules to your needs...

you should add a rule, which skips, if the sender host is it's own
localhost via smtp.

Looks like this in the logs:

2023-05-28 09:36:46 H=(localhost) [117.7.227.162] rejected MAIL
<hqih8fu3v6mc@???>: invalid NON-FQDN HELO (localhost),
please talk to your mailserveradmin about this


best regards,
Marius

--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-users.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-users-unsubscribe@???
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/