I am looking to do the following:
- User sends an email to
1234@domain - Procmail recognizes
1234@domainas an email sent toticket+1234@domain - Procmail recipe handles ticket number and forwards email to the bug tracker
Where bold is my current obstacle.
Here is a proof of concept. At this point, the user still has to send the ticket to ticket+1234@domain for the email to forward correctly:
SUBJECT=`/usr/bin/formail -zx "Subject:"` :0fhw * To.*\/([0-9]+)@domain * MATCH ?? ^\/[0-9]+ |/usr/bin/formail -I "Subject: $SUBJECT (Case $MATCH)" :0 !tickets@bugtracker Some context:
There is one address created, ticket@domain, for ticket handling. Currently, a user sends to ticket+####@domain, and the Procmail recipe uses $MATCH to grab the ticket number that correlates to the bug tracker entry and forwards accordingly. This works.
What I want to do:
Prevent auto-completion errors (a user will enter ticket+ in the recipient field, and the wrong ticket # is auto-completed). To prevent these mistakes, a user needs to send an email to ####@domain instead of ticket+####@domain.
The Big Question:
Can I use Procmail to filter emails from ####@domain to be treated as emails from ticket+####@domain?..
To:header is not robust; thinkBcc:.)To:header. I am not experiencing trouble routing these messages to Procmail; I have an address (ticket@domain) that successfully forwards emails sent as ticket+####@domain to our bug tracker for a related entry where ticket = ####. My big question: Is it possible to use Procmail to alter the name of an address format (####@domain) to an existing address (ticket@domain)? The domain host has a Procmail integration which is where I am writing these rules. If this is outside the bounds of what Procmail can do, then that will help me redirect myself.987543@domaininstead ofticket@domain? You don't need to rewrite any headers to do that; just forward to$MATCH@domain(or maybeticket+$MATCH@domainif that's what you actually want).