[BangPypers] Embedded python mail server

Gopalakrishnan Subramani gopalakrishnan.subramani at gmail.com
Wed Aug 24 08:33:28 CEST 2011


Use the http://hg.python.org/cpython/file/2.7/Lib/smtpd.py server. smtpd is
a proxy so only look at the client interface level, you may not need to push
to local server, no need to store to DB etc.

you copy the file and modify and wrap to meet your automation needs and to
get the response confirmation once the mail delivered.

SMTP RFC is very simple to code even in C++ & Java.  But until or unless you
have mail client or mail proxy or a email server as your core
business/module or automating the application functional testing, you don't
need to worry about testing with real mail server.

Since you have mentioned as automated test, I assume that you don't mean
unit testing.

Regards,

Gopal




On Tue, Aug 23, 2011 at 11:39 PM, Dhananjay Nene
<dhananjay.nene at gmail.com>wrote:

> On Wed, Aug 24, 2011 at 11:06 AM, Anand Chitipothu <anandology at gmail.com>
> wrote:
> > 2011/8/24 Dhananjay Nene <dhananjay.nene at gmail.com>:
> >> What would be good options to embed a python mail server ?
> >>
> >> The scope is strictly restricted to automated testing. So the embedded
> >> mail server (embedded in the test cases) acts as the server which
> >> receives email and is in turn further queried to ensure receipt of
> >> email correctly.
> >>
> >> One option is http://lamsonproject.org/
> >>
> >> Are there any other options you might suggest?
> >
> > Do you really want to run a mail server for testing? I usually monkey
> > patch the function to send email and store the emails in a global
> > variable for later access.
> >
>
> In automated acceptance testing context I believe it would be
> appropriate to implement a mail server. With unit tests, stubbing the
> mail server with a mock would've been fine.
>
> Dhananjay
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>


More information about the BangPypers mailing list