At 15:52 2002-07-21 -0400, Kevin S. Brackett did say:
I have a ticketing support system in place, with multiple addresses going
to single departments, now, to keep track of these requests i'd like to
add a text tag to the subject header of the emails coming in...
Ie, user sends email to blah78682682(_at_)domain
and the tag : to be added to the subject header of those
emails while still keeping the original subject intact
so my question is this...
How do I alter the subject by taking a few characters of the ^To: header
address and then have it forward to another address (the actual
ticketing system address) while still keeping the ^From: address the same?
_Forwarding_ doesn't change the From:. It _does_ change the envelope-from
I was thinking about doing this all from the site wide procmailrc since
these are only aliases... so any pointers?
in your sendmail aliases file (in place of a simple alias definition to the
"real" support address):
supportsomenumber: "|/path/procmail -m /etc/procmailrcs/somercfile.rc
(do that for each of your aliases)
in the somercfile.rc:
# this is *ONLY* invoked for those accounts which specify this rcfile
# NOT for other generic accounts.
# since the TO: address may not be cleartexted to us, we use $1 for the number
# extract the original subject (this also eliminates leading whitespace)
* ^Subject:[ ]*\/[^ ].*
# create the new subject token
# insert it into the headers
| formail -I "Subject: $SUBJECT"
# and forward
(those last two steps could be combined by eliminating the 'hf' and piping
the output of formail into "$SENDMAIL realsupportaddr", but I prefer the
above split approach in most cases).
In any situation where you forward messages, you should consider adding
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