I am looking to do the following:
- User sends an email to
1234@domain
- Procmail recognizes
1234@domain
as 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:
.) – tripleee Sep 30 '21 at 15:34To:
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. – Samuel V Sep 30 '21 at 15:48987543@domain
instead ofticket@domain
? You don't need to rewrite any headers to do that; just forward to$MATCH@domain
(or maybeticket+$MATCH@domain
if that's what you actually want). – tripleee Sep 30 '21 at 15:49ticket@domain
where users send emails to create entries in our bug tracker. Currently, a user does this by sending toticket+987543@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 is prevent auto-completion errors (a user will enterticket+
in the address field and the wrong ticket # is auto-completed). To do this a user needs to send an email to987543@domain
but follows the same process as before – Samuel V Sep 30 '21 at 16:00