[ale] how to intercept outbound emails on a qmail server

Bob Toxen transam at verysecurelinux.com
Mon Jan 15 12:23:05 EST 2007


The easiest solution is to tweak your home-made java code to
"send" the message to your desired test location.

Another simple solution would be to wait until the system is not sending
"real mail" and use IP Tables to redirect a destination of localhost:25
to your test location.

The least pleasant solution would be to hack qmail.  I find qmail a
far worse pain to deal with than Sendmail and that's saying a lot.
Of course I could hack qmail for you if you really want.

Bob Toxen
bob at verysecurelinux.com               [Please use for email to me]
http://www.verysecurelinux.com        [Network&Linux/Unix security consulting]
http://www.realworldlinuxsecurity.com [My book:"Real World Linux Security 2/e"]
Quality Linux & UNIX security and SysAdmin & software consulting since 1990.

"Microsoft: Unsafe at any clock speed!"
   -- Bob Toxen 10/03/2002

On Fri, Jan 12, 2007 at 01:03:40PM -0500, Jerry Yu wrote:
> In our QA server running qmail/Linux/tomcat, a piece of home-made java code
> sends outbound ('remote' in qmail's term) emails using javax.mail with
> localhost:25 as mail server. For testing purposes, we want to intercept all
> these outbound emails and redirect it to some other arbitrary email address
> instead of bothering/spamming/overwhelming customers with our tests.
> I know james.apache has some matcher magic to do this. In our case, From:
> and Reply-to: headers are fixed and known, while To: is dynamically pulled
> from a RDBMS. How can I accomplish this with qmail?

> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale



More information about the Ale mailing list