[clug] [OT] Capturing email for a testing environment

Daniel Pittman daniel at rimspace.net
Thu Sep 17 03:39:19 MDT 2009


Alex Satrapa <alexsatrapa at me.com> writes:

> I've written a tiny article on using Postfix to capture emails sent from an
> application and redirect them to a single external email account:
> http://manicdee.livejournal.com/61047.html - next on my list of things to do
> is write a filter to insert "[QA]" or something similar into the subject
> line of every email so that my customers know that this email came from the
> QA environment rather than the live one.

For Postfix, that requires routing the email through an external tool to
mutilate the content, then injecting it again.  On the plus side, you can
probably use a regexp header_match table to detect emails without the tag,
making life much easier for you when it comes to the routing decision.

[...]

> I'd love it if folks could have a look and come up with recipes for doing the
> same sort of thing using something that is not Postfix.

...which, um, anything in particular?  Just in general?

> I'd also appreciate any pointers to content-mungers that already exist to do
> the subject-line munging that I'm looking for.

I can't think of anything small.  Most of the tools that do this are
targeting something bigger, like injecting "disclaimers", or anti-spam
processing.

I would probably use something custom in Perl and MIME::Lite, which is only a
few dozen lines of code, but that is non-trivial work if you don't already
know how.  Python can almost certainly be turned to the same end.

        Daniel
-- 
✣ Daniel Pittman            ✉ daniel at rimspace.net            ☎ +61 401 155 707
               ♽ made with 100 percent post-consumer electrons
   Looking for work?  Love Perl?  In Melbourne, Australia?  We are hiring.


More information about the linux mailing list