[Exim] local_scan() is run before Envelope-To is set?

Top Page
Delete this message
Reply to this message
Author: Brian Kendig
Date:  
To: exim-users
Subject: [Exim] local_scan() is run before Envelope-To is set?
My problem in short: Exim sets an 'Envelope-To' header which says
exactly what address a given email was sent to, but apparently this
header gets set *after* local_scan() runs, so I can't have any tests
which check the original destination address. Is there any way to be
able to read the original destination address sooner?

The long of it: I'm using SA-Exim to hook SpamAssassin in to Exim, by
replacing Exim's local_scan.c with a new one which calls SpamAssassin.
I have a bunch of email addresses I never use any more, and I want
SpamAssassin to notice when mail comes in for those addresses, so it
can immediately handle them as spam. Normally this would be easy
enough; SpamAssassin can read the 'Envelope-To' header which Exim sets.
But my tests on this header are failing -- I think the header isn't
set when I'm checking for it; I'm guessing it gets set somewhere later
before the mail is delivered?

I can check the 'To' header, but that's not always going to be valid,
like if 'To' shows a mailing list address, or even nothing at all.


  ____    |\/|                 Brian Kendig   Set your priorities right.
  \  /\   / ..__.    brian at enchanter net   No one ever said on his
   \/  \__\   _/   http://www.enchanter.net/  death bed, "Gee, if I'd
    \__   __  \_      Be insatiably curious.  only spent more time at
       \____\___\           Ask "why" a lot.  the office."