Ugh, any suggestions for mocking out an smtp server?

606 views
Skip to first unread message

Marak Squires

unread,
Jan 25, 2011, 1:10:37 AM1/25/11
to nodejs
I've been maintaining a node mailer library ( http://github.com/marak/node_mailer ) for a while now and it's been a pain to test. 

Does anyone have any good suggestions for an easy mock smtp server I can use for my unit tests? A quick google search turned up http://www.jera.com/tools/fakesmtpd/ , was wondering if any node ninjas had a better suggestion.

- Marak

Aria Stewart

unread,
Jan 25, 2011, 1:16:40 AM1/25/11
to nod...@googlegroups.com

On Jan 24, 2011, at 11:10 PM, Marak Squires wrote:

> I've been maintaining a node mailer library ( http://github.com/marak/node_mailer ) for a while now and it's been a pain to test.
>
> Does anyone have any good suggestions for an easy mock smtp server I can use for my unit tests? A quick google search turned up http://www.jera.com/tools/fakesmtpd/ , was wondering if any node ninjas had a better suggestion.


My node smtp daemon would be pretty easy to hack into that. Patches welcome.

http://github.com/aredridel/node-smtp/

Aria

Shashishekhar S

unread,
Jan 25, 2011, 1:34:18 AM1/25/11
to nod...@googlegroups.com
Hi Marak,

On Tue, Jan 25, 2011 at 11:40 AM, Marak Squires <marak....@gmail.com> wrote:

Does anyone have any good suggestions for an easy mock smtp server I can use for my unit tests? A quick google search turned up http://www.jera.com/tools/fakesmtpd/ , was wondering if any node ninjas had a better suggestion.


I suggest you install postfix and set it up to deliver all mails to a local user. http://www.postfix.org/VIRTUAL_README.html

If you're looking for anything in particular, feel free to mail me offlist and I might be able to help you set it up.

cheers

- Shashishekhar S

Marak Squires

unread,
Jan 25, 2011, 3:22:56 AM1/25/11
to nod...@googlegroups.com
Shashishekhar -

So could I setup a test where I blasted out 100 emails from the mailer to a local postfix server, then the postfix server would write all those messages to a directory somewhere ( local user mail folder ? ), then node could parse that directory and determine if all 100 messages made it there in tact with no issues?

- Marak



--
You received this message because you are subscribed to the Google Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com.
To unsubscribe from this group, send email to nodejs+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nodejs?hl=en.

Shashishekhar S

unread,
Jan 25, 2011, 4:36:51 AM1/25/11
to nod...@googlegroups.com
On Tue, Jan 25, 2011 at 1:52 PM, Marak Squires <marak....@gmail.com> wrote:
Shashishekhar -

So could I setup a test where I blasted out 100 emails from the mailer to a local postfix server, then the postfix server would write all those messages to a directory somewhere ( local user mail folder ? ), then node could parse that directory and determine if all 100 messages made it there in tact with no issues?


Exactly! Then you could simply grep out the mail headers or write a node script to automate.
 

--
- Shashishekhar S

James Carr

unread,
Jan 25, 2011, 6:18:57 AM1/25/11
to nod...@googlegroups.com
I used to use fakemail (http://www.lastcraft.com/fakemail.php) to
capture email messages for acceptance tests. It's pretty handy.


Thanks,
James

Marak Squires

unread,
Jan 25, 2011, 12:10:14 PM1/25/11
to nod...@googlegroups.com
James -

The python fake mail script seems good enough, but it doesn't seem to support auth? 

John Engstrom

unread,
Jan 25, 2011, 5:42:57 PM1/25/11
to nod...@googlegroups.com
Hey, just received an email re. Amazon's new SES service which may be of use
to the Node community :)

http://docs.amazonwebservices.com/ses/latest/DeveloperGuide/


Matt Duncan

unread,
Jan 25, 2011, 9:19:04 PM1/25/11
to nod...@googlegroups.com
If anyone is looking to try it out, I just added support for SES to my fork of aws-lib (pull request also sent upstream).


Reply all
Reply to author
Forward
0 new messages