procmail
[Top] [All Lists]

Re: Handling N-way discussions

2000-08-22 11:15:49
Hello,

I sometimes have discussions with two or more people, with
liberal use of To:, Cc: and Bcc:. I would like to get Procmail
to file a copy of each such message in the mailboxes of *each*
of the participants.

Figuring out the Bcc: recipients is Really Hard to do.


The obvious recipe doesn't work well :

  :0
  ^ From: (_dot_)*stan(_at_)laurel\(_dot_)com
  stan

  :0
  ^ From: (_dot_)*oliver(_at_)hardy\(_dot_)com
  oliver

Several reasons:
1. Unless you're using an old version of procmail, I think you should
   have '*' at the start of the condition lines.
2. The blank between '^' and 'From:' .
3. I think you want "to:" and "cc:" and "apparently-to:" and so on,
   (see man procmailrc in the section on "^TOxxx" or "^TO_xxx"
   depending on your version) rather than "From:" .
4. Finally, you need the 'c' flag to let the message continue to the
   2nd recipe after it's been processed by the first.


Putting all these together,

  # you can skip this Given... stuff if you don't care to track
  # whether msg was distributed or not

  GivenToStanOrOllie=no

  :0c
  * ^TO_stan(_at_)laurel\(_dot_)com
  {
    GivenToStanOrOllie=yes

    :0:
    stan
  }

  :0c
  * ^TO_oliver(_at_)laurel\(_dot_)com
  {
    GivenToStanOrOllie=yes

    :0:
    oliver
  }

  :0
  * GivenToStanOrOllie ?? yes
  /dev/null

Oops, looks like I overlooked something:  Note that the above recipes
will put the message into $MAILDIR/stan and/or $MAILDIR/oliver -- is
this what you want?  If you're running as root and $MAILDIR is
/var/spool/mail then it still could work (except for file ownership).
Perhaps the delivery part should be changed from

    :0:
    stan
to
    :0
    ! stan

?

-- 
Neither I nor my employer will accept any liability for any problems
or consequential loss caused by relying on this information.
Collin Park                         Not a statement of my employer.

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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