A little help on SAEximRunCond & rcpt domain based lookups

Sander Smeenk <[email protected]>
Newsgroups gmane.mail.exim.spamassassin
Message-ID <[email protected]>
Hey all,

I got this configuration for exim4 from a friend, and it works really
really nice. The basic idea is that you have a file called 'policy' that
specifies, for each domain you host, what checks to perform, and what
ACL (rcpt_acl) to use. 

The ACL in its turn looks up wether options like 'verifysender' or
'verifyhelo' are turned on, and wether it has to 'dnsbl=reject' or
'dnsbl=warn', etc, etc.

Works real nifty I can tell you :)

I thought I could add that same behaviour to exim-sa's SAEximRunCond,
since that RunCond undergoes exim4 string-expansion. So there shouldn't
be any problems looking up if 'spamassassin' is set to 'yes' in the
policy file for the recipient domain.

There is only one big problem. I can't seem to figure out, during the
phase where SAEximRunCond gets expanded, what the recipient address
(envelope!) for the mail is. I really need the address the mail will be
delivered to, not the $h_To value, since one can forge that.

$domain is empty, there's no $h_Envelope-to, and $recipients is empty too.  

I thought about adding a header somewhere earlier, something like
'X-Received-For-Domain: nnn.tld', and have it removed later, but it
seems I can only add headers *after* the message passed through exim-sa.

Anyone on this list having ideas about what I can do next to figure out
the recipient address in an SAEximRunCond like this:

| ${if
|     and {
|         {def:sender_host_address}
|         {!eq
|             {$sender_host_address}
|             {127.0.0.1}
|         }
|         {!eq
|             {$h_X-SA-Do-Not-Run:}
|             {Yes}
|         }
|         {eq
|             {${extract{spamassassin}{${lookup{#RCPTDOMAINNEEDEDHERE#}lsearch{/etc/exim4/policy}}}{$value}{no}}}
|             {yes}
|         }
|     }
|     {1}{0}
| }

Any help is greatly appreciated!

Thanks,
Sander.
-- 
| Remember: If you shake it more than twice, you're playing with it!
| 1024D/08CEC94D - 34B3 3314 B146 E13C 70C8  9BDB D463 7E41 08CE C94D
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.