[CentOS] Replay mail to test MTA + filtering

Fri Nov 17 00:02:41 UTC 2006
Kevan Benson <kbenson at a-1networks.com>

On Wednesday 15 November 2006 13:30, MrKiwi wrote:
> Hi All,
>
> My kit : Centos4.4 + Postfix + SA + ClamAV (not that its relevant)
>
> General question - Does anyone know of a product which can take a folder
> / mbox
> of mail (spam, ham, virus infected stuff, scam mail and hoaxes) and
> "replay" it back
> against a test server to determine the servers ability to filter?
>
> I have looked at some low level (IP) packet replayers, but i cant really
> find anything suitable
> at the mail/smtp level.
> It would have to "simulate" connections from external IP addresses to
> allow RBL etc to work and
> also i guess i would have to choose an "MTA style" of the sender to be
> simulated so that the MTA
> i am testing can do its thing when some tries something which fails the
> smtpd_*_restrictions tests.
>
> It will probably be the case that i need to "recapture" the mail at a
> higher detail, as an RFC compliant
> unit of mail in my mailbox doesn't tell me anything about how the smtp
> conversation went, and certainly
> doesn't allow me to recreate the conversation.
>
> Is anyone building something like this?
>
> Any hints appreciated.

For general redelivery of a mail spool, fetchmail might do what you want.

Accurately redelivering messages to a server with the express purpose of 
testing it's filtering system with regard to the original delivery seems 
extremely hard.  One problem is that the filtering systems today generally do 
quite a few live checks of remote resources to determine spam, which you have 
no way or guaranteeing are the same.  The other is getting the SMTP daemon 
(postfix in your case) to treat the incoming messages as if they were coming 
from the correct remote location.

If there's something out there that does it though, I'd definitely be 
interested.


-- 
- Kevan Benson
- A-1 Networks