procmail
[Top] [All Lists]

Re: He's Baaaaaackkk... [COPY] Inserting a word into a subject name

1996-01-26 06:12:30

I use procmail to handle the messages that come to the webmaster
alias here. Since there are different people that handle
different aspects of the job, I forward the messages to the
appropriate people and then send a copy to myself with an 
indication of what happened. This is done suing a simple
perl on-liner as shown:


:0 h
* ! ^From:.*ctron.com
{

   :0 c
   * ^Subject:.*ftp.*
   ! ftpadmin

   :0 fa
   | perl -pe 's/Subject: (.+)/Subject: \*Fwd to ftpadmin\* \1/'

}

:0
! mbehr


The result of this is that the original message is forwarded to
the desired person, and I get a copy of the message with the
subject changed 

from:

Subject: I need help with ftp

to:

Subject: *Fwd to ftpadmin* I need help with ftp

I think that is what you are looking for.

Marc
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Marc D. Behr              | Email: mbehr(_at_)ctron(_dot_)com
Web Projects Leader       | 
Cabletron Systems Inc.    | phone: (603) 337-1751
P.O. Box 5005 - Bldg 35   | fax:   (603) 337-1731
Rochester, NH 03867-5005  | 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


-- On Fri, 26 Jan 1996 00:33:27 -0800, Dave Runkle 
<procmail-request(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE> wrote 
Thank you all for your replies to my question about my recipe.
The replies were a big help - and got me going with this. The 
recipe now works - to a point <g>.

Here's the result that works:
-----------------------
# recipe sends the original to the inbox
# recipe formats the message by appending the word
#       [COPY] onto the front of the subject
# recipe sends the formatted mail to the first person
# recipe sends the formatted mail to the second person

:0 c:
/var/spool/mail/billing

:0fhw
| formail -I "Subject: [COPY] $SUBJECT"

:0 c
! billingperson(_at_)ourcompany(_dot_)com

:0
! billingsupervisor(_at_)ourcompany(_dot_)com
-----------------------

The problem is that the formail line does a Replace rather than
just inserting the word. Is this all I can do? I'd like to put the string
[COPY] at the beginning (or even the end) of the subject line, but
all it does is replace the whole line.

Any further help will be [gulp! are you bothering them again?]
appreciated!

Thank you!
Dave

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