Procmail: Send ticket numbers to an address named "ticket@domain"?
1
vote
1
answer
44
views
I am looking to do the following:
1. User sends an email to
1234@domain
2. **Procmail recognizes 1234@domain
as an email sent to ticket+1234@domain
**
3. 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:
=/bin/bash
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
?..
Asked by Samuel V
(13 rep)
Sep 30, 2021, 03:16 PM
Last activity: Sep 30, 2021, 06:52 PM
Last activity: Sep 30, 2021, 06:52 PM