procmail
[Top] [All Lists]

Re: Redirect to two persons

2006-01-31 12:18:06
At 14:24 2006-01-31 -0200, JEMF wrote:
Hello!

I need redirect an email to two persons. I tried:

:0
* To(_dot_)*sector1(_at_)internal
* From(_dot_)*(_at_)external(_dot_)com
{
        :0 c
        /var/mail/sector2

        :0
        /var/mail/sector3
}


However, with this configuration all messagens are posted in
/var/mail/sector3 only. How to make it works correctly?

First, WHERE is your procmail rule - in a personal ~/.procmailrc, or in 
/etc/procmailrc ?  your personal .procmailrc should not be able to write to 
other user mailboxes.

# note DOT is escaped, and headers are ANCHORED and have trailing colons
:0
* ^To:(_dot_)*sector1(_at_)internal
* ^From:(_dot_)*(_at_)external\(_dot_)com
!sector2,sector3

This forwards the message to the other two mailboxes.  If they're likely to 
bounce mail back into the sector1 mailbox, you should add loop checking, 
for example:

:0
* ^To:(_dot_)*sector1(_at_)internal
* ^From:(_dot_)*(_at_)external\(_dot_)com
* ! ^X-Loop:[   ]sector1(_at_)internal
| formail -A "X-Loop: sector1(_at_)internal" | $SENDMAIL sector2 sector3

---
  Sean B. Straw / Professional Software Engineering

  Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
  Please DO NOT carbon me on list replies.  I'll get my copy from the list.


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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