"Julian Mehnle" <[EMAIL PROTECTED]> writes:

> Lloyd Zusman [EMAIL PROTECTED] wrote:
>> You indeed have to read that message ID from the "Received:" header,
>> because there is no other place to get it.
>
> I first thought I could get the queue ID from the control files's base
> name, as implied by the Courier queue documentation[1] in the section
> "Adding messages to the queue" in step G.  But in step H it gets renamed
> to something different, so that's not an option.

Yep.  That's why I came up with the current hack.


> I think having to parse the message text, and the highly structured
> "Received:" header in particular, to obtain the queue ID is not very
> elegant.

I agree.


> Sam, would it be a good idea if the queue ID were available from within
> the control file as a control record?
>
>> [ ... ]
>
> Yeah, I know the story.  I also know that courierfilters cannot modify the
> message due to MIME-related optimizations in Courier.  But now I'm
> beginning to wonder whether this is all still in proportion.
>
> All these inelegant work-arounds we're currently implementing are so
> complicated that the optimizations which prevent messages from being
> modified in the first place look pretty useless with regard to CPU load
> and memory usage.
>
> Maybe there should be a configuration flag to disable these optimizations
> if one wants courierfilters to be able to modify messages.  Then all these
> work-arounds wouldn't be necessary.

I'm in favor of this idea, or any other proposal that would allow us to
modify messages (or at least to add/change/delete headers) during the
global filter step.

Here's another possiblity:

Using some sort of special syntax, allow a global filter step to write
commands into the control file that can tell courier to
add/modify/delete headers.  At a later time within the message
processing chain, these commands are read from the control file and
executed.

For example, the command could be defined as follows:

  Hx YYYYYY[: ZZZZZZ]

where 'H' is the command keyword (as in _H_eader)
      'x' is one of the following actions:
          'a'  =>  add "YYYYYY: ZZZZZZ" as a header
          'd'  =>  delete header "YYYYYY:"
          'm'  =>  modify header "YYYYYY:" to be "YYYYYY: ZZZZZZ"

So, if you wanted to add a "Received-SPF:" header, you could write the
following line to the control file:

  Ha Received-SPF: foo bar ...

At an appropriate time within the message processing chain (when?),
Courier would re-read the control file and look for these 'H' lines, and
if any are found, it will modify the message headers accordingly.


>> Fortunately, that ID is guaranteed to always be found within the topmost
>> "Received:" header, so it should be fairly straightforward to extract it
>> during an early Courier:Filter processing step.
>
> Yes, it's inelegant, but at least it's not horribly ugly. ;-)

Agreed.  Anything that would allow a message (or at least its headers)
to be altered solely within the global filtering step, without keeping
state that is checked and acted upon later during local filtering, would
be a great improvement.


-- 
 Lloyd Zusman
 [EMAIL PROTECTED]
 God bless you.



-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to