Re: [Exim] Conditions in ACL's

Góra strony
Delete this message
Reply to this message
Autor: Kirill Miazine
Data:  
Dla: Christian Hertel
CC: exim-users
Temat: Re: [Exim] Conditions in ACL's
Christian Hertel wrote:
> --
> Hi Folkz!


Greetingz!

> I've got a little problem with my ACL conditions. I want to achieve that
> mails which were not spooled in from localhost and for whose sender
> address domain no MX record can be resolved should not be accepted.
>
> So first, I built this condition to deny mails from anywhere other than
> localhost, but it does not work:
>
> deny condition = ${if !eq {$sender_host_address}{} {yes}{no} }


The below will deny when the message is submitted by SMTP and when the
SMTP client is not 127.0.0.0/8:

    deny !hosts = : 127.0.0.0/8


Note that hosts starts with a colon - this is needed to match empty host
(when the message is submitted locally, host is empty).

>
> The exim documentation says that if mails were spooled in from
> localhost, the variable $sender_host_address is an empty string.


Wrong! The Exim documentation says following:

    $sender_host_address: When a message is received from a remote host,
    this variable contains that host's IP address. For locally submitted
    messages, it is empty.


> Then what is wrong with the condition above? Why does it not match?


Because localhost (i.e. 127.0.0.1 etc) is a remote host if the message is
received using SMTP over TCP/IP.

For checking whether the sender address is routable, you can use "verify =
sender". Are you sure you do not want to accept messages from sender who
do not have an MX record for their mail domain set up, but only A record?