cyrus-imapd 2.1.15, sieve, lmtpd, and return-path header

Andrew Morgan morgan at orst.edu
Tue Sep 23 03:01:54 EDT 2003



On Mon, 22 Sep 2003, Chris Stromsoe wrote:

> On Mon, 22 Sep 2003, Pat Lashley wrote:
>
> > Return-Path doesn't exist at all until final delivery, at which point, I
> > believe it is optional.
>
> from RFC2821 (which, I realize, is smtp and not lmtp)
>
>    When the delivery SMTP server makes the "final delivery" of a
>    message, it inserts a return-path line at the beginning of the mail
>    data.  This use of return-path is required; mail systems MUST support
>    it.  The return-path line preserves the information in the
>    path from the MAIL command.

I can't believe I'm wading into this discussion...  :)

It sounds to me like the return-path header should be added when the
message is delivered to its final resting place.  When sieve is looking at
the message, it hasn't been delivered yet.  A sieve script may decide to
redirect the message or generate a bounce.  In that case, the return-path
should not be added to the message because it has not reached its final
destination.

When lmtpd writes the message to disk, it is *delivered*.

> The envelope extension does not provide the functionality that I need.
> Open any message that is stored in cyrus and was delivered via lmtp.
> Look at the headers.  The first header that you will see looks something
> like:
>
>   Return-Path: <cbs at cts.ucla.edu>
>
> I need to be able to filter on that header.  In my opinion, sieve code
> like
>
>   if anyof (header :contains "return-path" "cbs at cts.ucla.edu") {
>      fileinto "cbs";
>   }
>
> needs to work

But where does return-path come from?  Somehow lmtpd knows how to generate
that header, but it's not clear to me how it does it.

What I'm getting at is, maybe it is possible to filter on some other
header that is equivalent to return-path.

	Andy






More information about the Info-cyrus mailing list