procmail
[Top] [All Lists]

Re: invoking procmail from sendmail alias, and...

2002-07-21 14:56:03
On Sun, 21 Jul 2002, Kevin S. Brackett wrote:

KSB> I have a unique situation...
KSB>
KSB> I have a ticketing support system in place, with multiple addresses going
KSB> to single departments, now, to keep track of these requests i'd like to
KSB> add a text tag to the subject header of the emails coming in...
KSB>
KSB> Ie, user sends email to blah78682682(_at_)domain
KSB> and the tag [78682682]: to be added to the subject header of those
KSB> emails while still keeping the original subject intact
KSB>
KSB> so my question is this...
KSB>
KSB> How do I alter the subject by taking a few characters of the ^To: header
KSB> address and then have it forward to another address (the actual
KSB> ticketing system address) while still keeping the ^From: address the same?
KSB>
KSB> I was thinking about doing this all from the site wide procmailrc since
KSB> these are only aliases... so any pointers?
KSB>

I should think the most difficult bit of this is extracting the tag from
the to: header.  Unless blah is always non-numeric and the tag always
starts with a number.

Something along these lines:


:0
* To:[^0-9]*/\(_dot_)*[^(_at_)]
{
  TAG=$MATCH
}

:0 hw
{
  OLDSUBECT=| formail -x Subject:
}

:0 fw
| formail -I "Subject: [$TAG]$OLDSUBJECT



Alan

( Please do not email me AS WELL as replying to the list. Personal
  email may invoke a password autoresponder. )



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