procmail
[Top] [All Lists]

prepending text to the subject

2001-04-19 20:59:39
Scott Severance asked,

| Is there a way to append text to the beginning of the subject line of every
| incoming message then bounce it to another address? I going to be
| traveling and the Internet connection cost will be prohibitive if I don't
| use a shared-mail address :-( . But, My name needs to be it the start of
| the subject line so people will know the message is for me. Anyone have any
| ideas?

That's probably not the best approach; surely you'll have POP3 or IMAP or
HTTP access where you're visiting and you can forward mail for your usual
address to another that is accessible by POP3 or IMAP or by webmail.  You can
set up an account for yourself on a free server and not have to mix your mail
in with anyone else's.  You might even be able to use ssh or telnet to log
into your usual account and not have to forward your mail at all.

Besides, if you prepend "[Scott]" or something like that to every subject
line, all the responses you send will have subjects like "Re: [Scott] real
subject goes here" unless you remember to change every one of them; if you
must forward mail to somebody else's address, maybe that person can run
procmail to pick out your mail, remove the tag from the subject, and file it
in a separate folder from his/her own mail.  Then you won't have to remember
to change the subjects on your responses.  If you can do that, then there's
no need to alter the subject line at all: procmail on your mail address can
call formail to add a header reading something like "X-for-Scott: yes" to
every piece that it forwards, and procmail on your host's account can spot
that line and use it to file the message into a folder for you.

So I really feel that what you have in mind is far from the best way to do
the job, but to answer your question literally instead of analyzing the
problem,

 :0fwh # if the incoming piece has a non-blank subject
 * ^Subject:[   ]*\/[^  ].*
 | formail -I "Subject: [Scott] $MATCH"
 :0Efwh # in case the incoming piece has no subject or a blank or empty one
 | formail -I "Subject: [Scott] (no incoming subject)"

 :0
 ! address(_at_)of(_dot_)your(_dot_)host

The first pair of brackets on the second line enclose space and tab; the
second pair enclose caret, space, and tab.

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