[Exim] availability of 'routed' address in local_scan

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Ollie Cook
Date:  
À: exim-users
Sujet: [Exim] availability of 'routed' address in local_scan
Hi,

Our inbound MX hosts very often route incoming messages to different local (in
the old Exim 3 'director' sense) addresses during the delivery process
(aliases, virtual accounts, catch-all addresses for hosted domains etc.), based
on live MySQL database lookups.

 e.g.
           anything@??? -> username@???
           sales@???              -> catchall@???


We are looking to implement a content-scanning mechanism with preferences
(antivirus, antispam, etc.) enabled on a per-Maildir basis using local_scan.

However, given that most envelope addresses (which are what is available to
local_scan) are often not the 'final destination' addresses, our homegrown
local_scan function will have to emulate Exim's routing process to come up with
the final addresses whose preferences it should look up. [Or rather, it can
only do content scanning of the message if routing yields up one final address,
but that is another matter which we are dealing with seperately.]

Not only would it be wasteful to make the same database queries again, it seems
to me that Exim has already performed routing through verification of the RCPT
TO addresses during the SMTP conversation. Is it perhaps possible, therefore,
to make the results of the routing process available somehow to the local_scan
function?

Perhaps the presentation could be each item in the recipients_list array
containing a pointer to another array of post-routing recipient_item
structures?

 e.g.
           recipients_list[i].postrouting[j].address


Thinking of alternative solutions to the same problem, is there some way of
expanding "some@???" into what it would be routed to? A single call to
expand_string() could then serve the same function for us.

There are probably other ways I haven't thought of, as well, which I'd be glad
to hear if they occur to people.

Cheers,

Ollie

--
Oliver Cook    Systems Administrator, Claranet UK
ollie@???                  020 7903 3065