procmail
[Top] [All Lists]

Re: Bounceing/forwarding

1995-11-17 14:13:41
Hello,

      I am trying to setup a very small scale mailing list using 
procmail.  What I would like to do is like "bouncing" mail in PINE.  Ie.  
Forwarding a mail that was sent to my account to 3rd party, which keeping 
the org. sender's info.  For example of the header:
...
In words, org(_dot_)sender(_at_)abc(_dot_)com sent a mail to 
List(_at_)home(_dot_)of(_dot_)maillist,
which is runing procmail and would Resent to 
3rdParty(_at_)another(_dot_)domain(_dot_)

If you don't need the Resent-* lines, you can do it with the '!' action:

:0
*       From: whomever(_at_)whereever(_dot_)org
! 3rdParty(_at_)another(_dot_)domain

The '!' action just invokes "sendmail -oi" with the letter on stdin,
and any arguments on the action as extra-arguments to sendmail.  The
-oi flag keeps sendmail from ending the message if there's a line
containing just a period.  Therefore, the above is in fact equivalent to:

:0
*       From: whomever(_at_)whereever(_dot_)org
| $SENDMAIL -oi 3rdParty(_at_)another(_dot_)domain



Okay, what if you _do_ want the Resent-* headers?  Well, you use formail
to add the headers, feeding the output directly into sendmail:

:0
*       From: whomever(_at_)whereever(_dot_)org
| formail -a "Resent-Date: `date`" -a "Resent-From: $LOGNAME" \
        -a "Resent-To: 3rdParty(_at_)another(_dot_)domain" -a 
Resent-Message-Id: \
        | $SENDMAIL -oi 3rdParty(_at_)another(_dot_)domain

Notes:
        We use the date command to generate the value of the Resent-Date:
        field.  That's probably not optimal, but it works.

        You shouldn't need to use a fully qualified address in the
        Resent-From: field, as the MTA should rewrite it as needed,
        in the same manner as it rewrites the From: field.

        Formail does magic on the Resent-Message-Id: field if you don't
        supply your own value, and generates a value for you.  Look at
        the formail manpage, under the '-a' option description.



Philip Guenther

----------------------------------------------------------------
Philip Guenther                 UNIX Systems and Network Administrator
Internet: guenther(_at_)gac(_dot_)edu   Phonenet: (507) 933-7596
Gustavus Adolphus College       St. Peter, MN 56082-1498

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