[Exim] $domain in acl_smtp_data [Exim 4.04]

Góra strony
Delete this message
Reply to this message
Autor: Simon Williams
Data:  
Dla: exim-users
Temat: [Exim] $domain in acl_smtp_data [Exim 4.04]
Hi,

I've been trying to put an ACL together to block HTML mail to certain
domains, except if the user is in a whitelist. While creating this,
I found the $domain variable isn't accessible in this particular type
of ACL (which spec.txt seems to confirm).

A work-around I found was to add this to the acl_smtp_rcpt:

  warn    message       = X-Domain: $domain
          domains       = *


...and then add this in the acl_smtp_data:

  deny condition = ${if and {\
                     {eq {$h_content-type:} {text/html}} \
                     {eq {$h_x-domain:} {no-dns-yet.org.uk}} \
                     {!eq {$sender_address} {blah@???}} \
                   } {yes}{no}}
       message   = HTML mail not accepted
  accept


Does anyone know any way, other than the $domain variable, to
reference the domain the mail is being sent to in this ACL?

Also, does anyone know a way to use lookup (or similar) to accept the
mail if the $sender_address is in a whitelist or to find out which
domains shouldn't accept HTML mail?

I've tried these so far for the whitelist:

  accept condition = ${if {${lookup{$sender_address}lsearch\
                       {/usr/exim/test/conf/whitelist}{$value}}} \
                       {yes}{no}}
  accept condition = ${if ${lookup{$sender_address}lsearch\
                       {/usr/exim/test/conf/whitelist}} {yes}{no}}
  endpass


There's probably something in spec.txt I've overlooked and hasn't
been uncovered by extensive Googling.

If anyone has any ideas for this, I could then find a way of applying
them to the domain lookup myself.


Thanks in advance for any hints,

--
   Simon <simon@???> **** PGP: 099977D0
"We demand rigidly defined areas of doubt and uncertainty."
                  - Douglas Adams