Help: Procmail won't send to multiple addresses. - Help

This is a discussion on Help: Procmail won't send to multiple addresses. - Help ; Hi All: I'm having an issue with procmail, and have been struggling for days... I'm trying to setup procmail to forward incoming mail (going to one account) - out to a few other people... I have a rule in my ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Help: Procmail won't send to multiple addresses.

  1. Help: Procmail won't send to multiple addresses.


    Hi All:

    I'm having an issue with procmail, and have been struggling for days... I'm
    trying to setup procmail to forward incoming mail (going to one account) -
    out to a few other people... I have a rule in my .procmailrc file that looks
    like this:

    :0
    {
    * ^TO_*
    ! address1@nowhere.net
    ! address2@nowhere.net
    ! address3@whatever.com
    ! itgoes@on.ca

    }

    This just won't work:

    however,

    :0
    * ^TO_*
    ! oneaddreess@nowhere.net


    works!

    How can I get procmail to forward to more than one address? am I doing
    something wrong?
    If I create a few like the working one above (i.e. multiple lines - it only
    seems to send to the top on
    the list, and ignores the rest...

    Thanks in advance everyone.
    Morrison



  2. Re: Help: Procmail won't send to multiple addresses.

    On Fri, 22 Oct 2004 06:11:32 -0700, "Morrison"
    wrote:

    >
    >How can I get procmail to forward to more than one address? am I doing
    >something wrong?
    >If I create a few like the working one above (i.e. multiple lines - it only
    >seems to send to the top on
    >the list, and ignores the rest...


    Have you tried a comma-seperated list, all on one line? That would
    work on the To: line of the message, and if procmail just copies the
    line as the address it might well work.

    --
    Joe Zeff
    The Guy With the Sideburns
    Actually, I quite enjoy getting "snarfed"
    http://www.lasfs.org http://home.earthlink.net/~sidebrnz

  3. Re: Help: Procmail won't send to multiple addresses.

    "Morrison" writes:
    >
    > I'm having an issue with procmail, and have been struggling for days... I'm
    > trying to setup procmail to forward incoming mail (going to one account) -
    > out to a few other people... I have a rule in my .procmailrc file that looks
    > like this:


    Hmmm. I was going to point out that you could have found the answer
    in the manpages, but the manpages don't properly address this at all.
    The correct syntax is to use a single "!" line with a
    whitespace-separated list of target email addresses all on the same
    line, like so:

    :0
    * matching regexp
    ! address1@nowhere.net address2@nowhere.net address3@whatever.com itgoes@on.ca

    If your address list is really long, you can probably use the "\"
    continuation character at the end of all lines but the last to make
    things look nicer. I haven't tested this though.

    However, note that the regexp you posted, namely "^TO_*", is bogus,
    since it matches anything. And this sets up a dangerous situation.
    What if there's a temporary server problem and mail to "itgoes@on.ca"
    bounces? Guess where your procmail recipe is going to try to forward
    the bounce message.

    You can try:

    :0
    * !^FROM_MAILER
    ! address1@nowhere.net address2@nowhere.net address3@whatever.com itgoes@on.ca

    which will at least avoid trying to forward bounce messages.

    It might be safer to do:

    :0
    * !^FROM_MAILER
    * !^X-Loop: thisaccount@this.host.ca
    | formail -A"X-Loop: thisaccount@this.host.ca" | \
    $SENDMAIL $SENDMAILFLAGS address1@nowhere.net \
    address2@nowhere.net address3@whatever.com itgoes@on.ca

    Replace "thisaccount@this.host.ca" in both places with the account
    that's receiving and forwarding this mail. This rule uses procmail's
    companion "formail" program to add an "X-Loop" header to the mail
    before forwarding it, and it won't re-forward mail that already has
    that "X-Loop" header.

    --
    Kevin

+ Reply to Thread