Lloyd Zusman <[EMAIL PROTECTED]> writes:

> I just realized that there is a minor flaw in the courierfilter
> implementation of SPF.
>
> The SPF people suggest that a message which doesn't fail the SPF test
> should have an extra header added.  For their discussion of this, go
> here:  http://spf.pobox.com/newheader.html
>
> But as far as I know, it's not possible to add a header to an email
> message from within a courierfilter module, [ ... ]
>
> Also, I'm hoping that there's some sort of hack^H^H^H^Htrick to get this
> behavior that doesn't involve changing the Courier source code.
>
> Any ideas?

I just thought of a possible hack to handle this case.  What do you
folks think of this idea? ...

I create a directory called, for example, /var/messageids.  In the SPF
courier-pythonfilter, if the message is not rejected, create a file in
/var/messageids whose name is the Message-ID of the currently processed
message.  In this file, write the extra header(s) before returning '' or
'200 Ok' from the filter step.

Then, very early in the subsequent maildrop step (which is set up for
all mail passing through my system), pipe each message through a program
which reads its message ID, and if a file with that name exists in
/var/messageids, appends any headers in this file to the message.  This
message will then be processed by any other maildrop rules that might
exist.

That header-appending program will delete the file in /var/messageids
after adding the headers, and also, a cron-based cleanup script can
periodically delete old files from /var/messageids.

The advantage of this is that the SPF testing takes place during the
SMTP dialog, and the headers are added a bit later, before any further
rules are processed.

How does this sound?


-- 
 Lloyd Zusman
 [EMAIL PROTECTED]



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to