On Tue, 4 Oct 2011, Frank Leonhardt wrote:

On 04/10/2011 14:41, John Hardin wrote:
      On Tue, 4 Oct 2011, Frank Leonhardt wrote:

            So, doing this using the actual rule and an actual header it *does* 
work. It's only
            when its run through the milter that it fails to match.


      Are you attempting to match the Received: header added by your MTA?

      Your MTA may not have added the Received: header for the local hop at 
that point in the process
      (pre-delivery). You might want to ask on the support list for your MTA 
whether the local-hop
      Received: header is added for milters, and if it is, whether it looks 
different than the header
      actually added for final delivery.


Thanks John. I'm pretty sure that's exactly what's happening, but I'm at a dead 
end. I believe sendmail does
add a Received header for the milter for the local hop (indeed, SA is finding 
stuff in the first line of it)
but, assuming SA is unwrapping the header properly, it's clearly not the same 
as the one it finally ends up
with.

There's a pretty good reason for wanting to examine the local header: to 
determine the authenticated user.
I'd have thought someone else would have come up against this problem with 
Spamassassin, which why I'm asking
here. The sendmail documentation is pretty non-specific about what kind of 
header it fakes up; it just says
it fakes one.

If all else fails, I'll figure out how to write a milter and see for myself.

If using sendmail+milter, the milter gets a copy of the raw input message, before sendmail adds any local headers.

So if you want to see the local 'Received' header, the milter -must- explicitly synthesize it. There have been several instances of milters not doing that correctly/completely (EG leaving off things such as authentication bits). In particular if you add custom headers to your sendmail config, you must customize your milter to match. This probably means getting the source code for the milter and doing it yourself.



--
Dave Funk                                  University of Iowa
<dbfunk (at) engineering.uiowa.edu>        College of Engineering
319/335-5751   FAX: 319/384-0549           1256 Seamans Center
Sys_admin/Postmaster/cell_admin            Iowa City, IA 52242-1527
#include <std_disclaimer.h>
Better is not better, 'standard' is better. B{

Reply via email to