Julian Mehnle wrote:
> Gordon Messmer wrote:
>> Lorenzo Perone wrote:
>>> If I understood correctly the rest of this thread, at the moment it is
>>> not a good idea to modify the message even once, within a
>>> courierfilter. So it wouldn't be possible to save a modified copy,
>>> which is desired in my as well as in other setups.
>> You can't modify it, but the technique I use in pythonfilter is to
>> modify the control files to mark all recipients complete, inject a new,
>> modified message into the queue with the same control data, and then
>> tell courier to accept the message.  courierd will examine the message
>> from SMTP and remove it because it's already done, and then deliver the
>> modified message that the filter added to the queue.
> 
> Ironically, this, too, defies Courier's attempts at being efficient, at 
> least for messages that you want to modify.  In setups where you modify 
> practically all messages that you don't reject, it makes Courier's 
> efficiency attempts pointless.

Not only Courier has to discard the old message, but it has to accept
a new one. Perhaps, the "resubmit path" can be optimized slightly?
Anyway, it will remain a technique suitable for setups where messages
are modified in a few cases only.

Filters that always add a header could overwrite a previously inserted
header mask. We need a hook to pre-insert masks, then. Filters setting
a result that maildrop filters can use, could set a variable in the
control file. The latter implies maildrop should be able to retrieve
such variables.

> My point being, I think Courier should offer a mode where it parses 
> messages' MIME structure only _after_ having called the courierfilters.

As an alternative mode, Courier could rewrite the message before invoking
global filters. I.e., invoke global filters just before recipient-specific
filters. It may be somewhat inefficient to rewrite a message if a filter
is going to discard it. Thus it may still be better for some other filters
to be called in one of the currently existing modes.

For yet another approach, a filter response could contain some
modification commands, e.g. "add this header", "drop that attachment"...













-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
courier-users mailing list
courier-users@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to