On Thu, May 22, 2003 at 01:11:28PM -0400, Sam Varshavchik wrote:
> Courier User writes:
> >A courierfilter program has access to a file name which points to
> >the message being filtered. Is it legal for the courierfilter to
> >alter the message and rewrite this file?
> No. This is due to the fact that filtering takes place after the message
> has been received and parsed, but before any MIME-related rewriting. For
> speed, messages are parsed at the same time they are received.
> If the message file is modified, and Courier decides to re-MIMeify the
> message, the start of MIME sections will not match the parsed offsets,
> resulting in corruption.
Well, this means that it's probably not a good idea to use
SpamAssassin from a courierfilter like "perlfilter" ... unless all
you plan to do is to simply reject failed messages outright at that
time. If the SpamAssassin results are to be queried during
subsequent message processing steps, SpamAssassin would have to be
re-invoked on the same message via maildrop or some ~/.courier
I can think of some convoluted ways around this:
One possibility is that I could run the messages through spamc from
within my perlfilter, and for any message that is not rejected at
that time, I could persist the altered message in a centrally
accessable data store, keyed by its message ID. Later processing
steps could look up this persisted message and process it
I might try this, but I'm not sure how worthwhile it would be.