procmail
[Top] [All Lists]

Re: formail and Apparently-To:

1999-06-05 13:15:34
James McGill <james(_dot_)mcgill(_at_)mindspring(_dot_)net> writes:
On Fri, 4 Jun 1999, Philip Guenther wrote:
Or better yet, don't tell sendmail to scan the header for receipients.
Instead, put the one recipient on the sendmail command line.  That way
the only change to make to the header is the addition of the X-Loop:
line:

     |formail -A"X-Loop: mark(_at_)box(_dot_)com" | \
             $SENDMAIL $SENDMAILFLAGS juan(_at_)box(_dot_)com

We tried that, but what about for multiple recipients?  We ran into line
length limitations, if I recall correctly, which was the reason for having
sendmail look for recipients in the header.  

Line length limit?  Are you hitting the 2048 character LINEBUF?  Or is
your shell broken?  Putting
        SHELL = /bin/sh

at the top of the rcfile may help.


But Apparently-To: fields in the DATA are not really headers,
are they?  Admittedly, we are doing insane things with procmail...

Everything after the DATA statement to the first blank line is the
header.  Everything after that to a line containing just a period is
the body.  (The body and blank line before it are optional -- the
header could be terminated by the period-only line, in which case there
would be no body.)

Here are the rules:

In SMTP mode, sendmail *ignores* the recipient headers.  Sendmail will
        instead deliver to the addresses given via the RCPT To: lines.

In non-SMTP mode, if the -t flag was _not_ given, then sendmail again
        will ignore the heades and only pay attention to the envelope,
        this time given as the address on the command line.

Only in non-SMTP mode when the -t flag was given does sendmail look at
        the recipient headers.  Which headers?  Well, sendmail will
        first look too see if _any_ of the following headers are
        present:
                resent-sender:
                resent-from:
                resent-reply-to:
                resent-to:
                resent-cc:
                resent-bcc:
                resent-message-id:
                resent-date:
        If any of those are present, the sendmail will extract receipient
        addresses from the following headers:
                resent-to:
                resent-cc:
                resent-bcc:
        Otherwise, sendmail will extract recipient address from
        the following headers:
                to:
                cc:
                bcc:
                apparently-to:

Got it?


Philip Guenther

<Prev in Thread] Current Thread [Next in Thread>