Exim4 and host lists.

Andreas Barth wonders how exim4 handles host lists in conditions. He doesn't appear to be using very clear terminology, though. There are two types of conditionals in exim4.conf: conditional string expansion on the one hand (search for "Expansion conditions" in the exim4 info file), and condition parameters on ACLs or routers on the other. The conditional string expansion is what happens when you do ${if <operator>{}{}}. String expansion does indeed not let you match against host lists in any interesting way.

However, that does not mean you cannot use a host list to conditionally specify some condition, if you want that; it only means you're trying it the wrong way. Andreas appears to be wanting to vary the maximum size a mail may be depending on the host that sends it; to do that, he would need to make sure his ACL that is specified as acl_smtp_data would contain something akin to this:

  deny hosts = !+hostlist
       condition = ${if >{$message_size}{2M}{true}{false}}
       message = "mail too large, please trim your message"

and then set message_size_limit in the general options section to the limit the hosts that are in +hostlist should get. Or so.

Note, I didn't test the above, but it should work, unless I got the true and the false wrong again — wouldn't be the first time. What it does is that it will check the size of the message; and if the mail is too large, and the host is not in the host list, it will simply reject it.