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

steve jenkin sjenkin at canb.auug.org.au
Thu Sep 17 16:41:33 MDT 2009


Alex Satrapa wrote on 17/9/09 4:48 PM:
> 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.
> 
> The aim here is to have the (Django) application deployed in an
> environment that is as close to "Production" as possible, without
> causing problems in the real world. I don't want to load special Python
> classes to do funky stuff in the application itself, because that will
> (by definition) alter the behaviour of the application.
> 
> 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. I'd
> also appreciate any pointers to content-mungers that already exist to do
> the subject-line munging that I'm looking for.
> 
> Thanks,
> Alex


In the dim, distant past when 'sendmail' was the only MTA, people who
worried about 'security' ran "smtpd" (IIRC) on port 25.

It understood the SMTP protocol but nothing more & wrote files to a
directory, from whence sendmail picked them up.

That, plus a script to hack the subject line & resend the file would
fulfil your need/requirements.

I've had a quick look, and cannot find it. My Google Fu is ebbing :-(
The term 'transparent proxy' came up a few times.

There is a lightweight server:
<http://ezix.org/project/wiki/NoRelaySMTP>

BUT, qmail-smtpd says it does this sort of thing.
<http://www.qmail.org/qmail-manual-html/man8/qmail-smtpd.html>

The Anti-Spam Proxy seems over kill:
<http://www.linuxsecurity.com/content/view/125691/169/>

An SMTP daemon in PERL. Who'd have thought the swiss-army chainsaw tool
for Admins could do that :=]
<http://en.wikipedia.org/wiki/Qpsmtpd>

A random page on Perl Net::SMTP
<http://members.toast.net/strycher/perl/example_net_smtp.htm>

HTH
s

-- 
Steve Jenkin, Info Tech, Systems and Design Specialist.
0412 786 915 (+61 412 786 915)
PO Box 48, Kippax ACT 2615, AUSTRALIA

sjenkin at canb.auug.org.au http://members.tip.net.au/~sjenkin


More information about the linux mailing list