LittleGreyCat has asked for the wisdom of the Perl Monks concerning the following question:

I am a PERL newbie, but familiar with SMTP.

I am looking for a simple implementation of an SMTP server so that I can catch an incoming SMTP message and store everything - RFC821/2821 protocol and RFC822/2822 content - verbatim for future analysis.

This server would replace a normal mail server.
A single test message would be sent.
The results would then be analysed.

I have SuperSearched here, and looked in CPAN, but can't seem to find anything.

Most of the code seems to be for sending mail to SMTP servers.

Any pointers to free code or modules would be greatly appreciated.

Alternatively, a pointer to a textbook or tutorial would give me a chance to extend my minimal PERL skills.

Apologies if there are loads of these in an obvious place which I haven't found so far.

TIA
Dave R

Replies are listed 'Best First'.
Re: Simple SMTP server to catch test mail
by gellyfish (Monsignor) on May 06, 2005 at 14:06 UTC
      Doh!
      Naively I went and looked in the Mail section of CPAN.
      Searched for "SMTP" on everything soon found loads of stuff.

      Thanks for the pointers.

      Cheers
      Dave R

Re: Simple SMTP server to catch test mail
by ghenry (Vicar) on May 06, 2005 at 14:18 UTC

    If you want to analyse the test message there and then or save it for later, you should consider (depending on how complex the test message is):

    1. MIME::Parser
    2. MIME::Parser::Filer

    I'm sure other people can recommend different/better solutions though.

    HTH.

    Walking the road to enlightenment... I found a penguin and a camel on the way.....
    Fancy a yourname@perl.me.uk? Just ask!!!