WebFaction
Community site: login faq

I want to be able to send emails to my bug-tracking database (FogBugz) and attach them to an existing case. FogBugz supports this if I include the text "Case 1234" in the subject of the email. But I don't want to have to explain what that is to every client. I'd rather be able to simply correspond with my client and BCC to an email address with the case number embedded and leave the subject line alone.

For example, my webfaction mailbox would receive a message like the following:

  • BCC: fb+1234@mydomain.com
  • Subject: RE: I have a problem

And would forward it accordingly:

  • To: cases@mydomain.fogbugz.com
  • Subject: RE: I have a problem (Case 1234)

How would I accomplish this through WebFaction? More specifically:

  • Does (WebFaction's implementation of) procmail support this natively?
  • Can I pipe the email to a python script? If so, are there any restrictions on where that script may reside?

asked 22 Feb '16, 20:13

mwolfe02
316
accept rate: 0%


Does (WebFaction's implementation of) procmail support this natively?

Yes. You can modify the subject and forward the message by selecting the advanced spam filtering option for your mailbox, and then plug in a procmail rule like this:

SHELL=/bin/bash
SUBJECT=`/usr/bin/formail -zx "Subject:"`
:0fhw
* ^Bcc:.*fb\+\/[0-9]+@mydomain\.com
* MATCH ?? ^\/[0-9]+
|/usr/bin/formail -i "Subject: $SUBJECT (Case $MATCH)"

:0
!cases@mydomain.fogbugz.com

Can I pipe the email to a python script? If so, are there any restrictions on where that script may reside?

If you want to pipe mail to a Python script, you can do so (using our mail2script implementation). The target script must reside in your main user's home directory on your web server.

permanent link

answered 23 Feb '16, 01:49

seanf
12.2k41836
accept rate: 37%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×261
×25
×17

question asked: 22 Feb '16, 20:13

question was seen: 1,622 times

last updated: 23 Feb '16, 01:49

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM