procmail
[Top] [All Lists]

Re: forking two copies of a mail

2002-06-24 07:24:00
Here's one that will deliver mail as usual, then send a copy (with a modofied 
subject line) to another
user. This is working for me, but it's running in a local .procmailrc file, 
rather than the global one.

It seems to me that an issue could possibly arise if the original "To" or "Cc" 
field contains the
address of the one who's getting the copied delivery. I haven't seen this occur 
yet, but perhaps a more
expert opinion would be of some help...

:0
* ^TO_(_dot_)*foo(_at_)bar(_dot_)com
* !^X-Loop: fooMail
{
  :0
  {
    SUBJ_=`formail -x"Subject:" \
      | expand | sed -e 's/^[ ]*//g' -e 's/[ ]*$//g'`
  }
  :0:
 | (formail -A"X-Loop: fooMail" -I"Subject: foos Mail - ${SUBJ_}" -I"To: 
fooB(_at_)bar(_dot_)com") | $SENDMAIL -t

}

This copies mail 'To" foo to a user named "fooB" the subject has "foos Mail -" 
followed by the original
subject line.

Eric Smith wrote:

Not sure if the Subject: gives the appropriate solution but I
have the following section in my rc:

:0
* ! 
(^TO_(Eric.*Smith|eric.*fruitcom)|^In-Reply-To.*(Eric.*Smith|eric.*fruitcom)|^From:.*eric.*frui
tcom)|^References.*fruitcom
{
 :0B
 *  ^Eric Smith
 *  ^In-reply-to:(_dot_)*(_at_)fruitcom(_dot_)com>
 {
    :0f
    | formail -I "X-eric-filter: not addressed to me but containing my name"
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 }

:0
* ^TOdebian-user(_at_)lists(_dot_)debian(_dot_)org
/dev/null

:0:
* ^Mailing-List: list \/[^(_at_)]+
`echo $MATCH | sed -e 's/[\/]/_/g'`

:0:
* ^Sender: owner-\/[^(_at_)]+
`echo $MATCH | sed -e 's/[\/]/_/g'`

... other dynamic list catchers ...

Where I marked the filter that adds a header, this is usually list
traffic that refers to (probably) me - i.e. I am in the thread
but not addresses to me directly.  I want a copy in the list folder
and another copy to default delivery - how?

For the same situation, I am considering keeping a cache
of Message-ID:'s for all mail that I send out, then check incoming mail for
In-reply-to:'s containing the Message-ID and act accordingly.

thanx

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

--
mv $win /dev/null


_______________________________________________
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>