Dan Melomedman <[EMAIL PROTECTED]> writes:
> Sam Varshavchik wrote:
>> Dan Melomedman writes:
>>
>> >Questions about filtering:
>> >
>> >Do global filters allow modification of messages?
>>
>> No.
>
> That's a shame, quite a few users need this. How would I add an X-Spam
> header before a message enters the queue?
I made a Modest Proposal about this a little while ago. Here's a
summary:
- Assume that the directory /var/msgids is owned by the same user
as the courierd process (you can name this anything you want).
- In a global filter, extract the value of the Message-ID header
from the message that is being processed (call this value
MESSAGEID).
- From within the global filter, write your X-Spam header into
/var/msgids/MESSAGEID.
- Later, in a local filter, the first thing you do is pipe
your message through a utility which does the following:
* extract the value of the Message-ID header (call this
value MESSAGEID).
* try to open /var/msgids/MESSAGEID, and if it exists,
read the lines from this file.
* append each line from this file to the current message's
headers.
* delete /var/msgids/MESSAGEID.
* print the newly formatted message to stdout
- Subsequent local filter processing will see your X-Spam
header.
- Run a cron job to periodically delete stale files from
/var/msgids.
The only flaw I can see with this is that we can't be 100-percent
certain that every Message-ID header in the universe is unique. They
are supposed to be, but other people's mail software can have bugs or
deliberate deviations from the standard.
Another Modest Proposal:
In the "Received:" header that is prepended to every message that is
processed, I propose that Courier always will insert a sub-field called
"id XXXXXXXX", where XXXXXXXX is some sort of system-wide unique ID that
Courier maintains. If such an ID could be guaranteed to exist within
Courier's "Received" header, then the global and local filters could
both use this same ID as the name of the file in the /var/msgids
directory that I describe above.
This would then facilitate the implementation of an airtight mechanism
to pass state information about messages between a global filter step
and a local filter step.
What do all you think about this idea? ... Sam?
--
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