Live data from Hacker News

Show HN: A fake SMTP server for software integration testing

fakemail.stream

31–40 of 51 posts

Re: Show HN: A fake SMTP server for software integration testing

#31
post #9

Earlier quoted context omitted.

From the Mailpit README: > Mailpit was originally inspired by MailHog which is no longer maintained and hasn't seen active development or security updates for a few years now.

Curious as to why it would need updates. Security updates sure, but what really needs to update on an STMP (+ TLS?) solution?

It's a web application too, not just a SMTP server. The MailHog web app is a little rough around the edges (it's an early AngularJS app) and had some bugs involving HTML mail content, so I can see the need for an updated version.

Re: Show HN: A fake SMTP server for software integration testing

#32
post #29

I don't want to burst bubbles, but postfix with few lines of config can redirect all email to DEVs. You really want, whenever possible, to test everything using real tools. Doubly so, using tools you'll use it PROD. However, at least postfix is de-facto standard. apt-get install postfix, postfix-pcre bsd-mailx, config and done. Here's an example redirecting ALL outgoing emails, UNLESS they are to your OK domains. Red…

It's always fascinating to me when people say "not to burst your bubble but it's really simple to use this other tool which can already do the task", and then write an essay about all the workarounds they had to apply to make the other tool work

Re: Show HN: A fake SMTP server for software integration testing

#33
post #27
post #20

Earlier quoted context omitted.

Add https://mailsnag.com to the list. You can share email samples with others for the review and it also allows receiving emails for your prod env - send emails to your app and process them in it.

Don't they all "allow receiving emails from your prod env"? They all speak SMTP. What am I missing?

The idea is that, in a a test environment, we should not actually deliver the mails to the recipient, instead making them available on a web page (or through an API).

Re: Show HN: A fake SMTP server for software integration testing

#34
post #32
post #29

I don't want to burst bubbles, but postfix with few lines of config can redirect all email to DEVs. You really want, whenever possible, to test everything using real tools. Doubly so, using tools you'll use it PROD. However, at least postfix is de-facto standard. apt-get install postfix, postfix-pcre bsd-mailx, config and done. Here's an example redirecting ALL outgoing emails, UNLESS they are to your OK domains. Red…

It's always fascinating to me when people say "not to burst your bubble but it's really simple to use this other tool which can already do the task", and then write an essay about all the workarounds they had to apply to make the other tool work

Reminds me of https://news.ycombinator.com/item?id=9224

Re: Show HN: A fake SMTP server for software integration testing

#35
post #29

I don't want to burst bubbles, but postfix with few lines of config can redirect all email to DEVs. You really want, whenever possible, to test everything using real tools. Doubly so, using tools you'll use it PROD. However, at least postfix is de-facto standard. apt-get install postfix, postfix-pcre bsd-mailx, config and done. Here's an example redirecting ALL outgoing emails, UNLESS they are to your OK domains. Red…

Most people these days are using a service provider for SMTP in production, so it isn't really possible to keep your prod and test configs in sync.

I do agree about using testing everything real tools, which is why this (fakemail) uses OpenSMTPD as the mail server.

All the work is in configuring it (similar complexity to your postfix configuration by the looks of it), interfacing to it, and deploying it (currently using ansible but will probably dockerize it).

The fact that no emails can get through to a real recipient is a feature.

Re: Show HN: A fake SMTP server for software integration testing

#36
post #32
post #29

I don't want to burst bubbles, but postfix with few lines of config can redirect all email to DEVs. You really want, whenever possible, to test everything using real tools. Doubly so, using tools you'll use it PROD. However, at least postfix is de-facto standard. apt-get install postfix, postfix-pcre bsd-mailx, config and done. Here's an example redirecting ALL outgoing emails, UNLESS they are to your OK domains. Red…

It's always fascinating to me when people say "not to burst your bubble but it's really simple to use this other tool which can already do the task", and then write an essay about all the workarounds they had to apply to make the other tool work

The thing is, it's not "another tool", but instead "a tool deployed in at least hundreds of millions of *nix servers, which is rigidly compliant with SMTP RFCs, etc, etc".

If you want to debug issues with sending mail from code, then ensuring you have something that will scream if you "do it wrong" is a big bonus. And having something tested for 20+ years with rigid adherence to RFCs, deployed more widely than any other *nix MTA, is probably a good thing too.

In terms of "essay", I know it looks big on your phone screen (I presume), but a few paragraphs of background info is hardly that.

Re: Show HN: A fake SMTP server for software integration testing

#37
post #29

I don't want to burst bubbles, but postfix with few lines of config can redirect all email to DEVs. You really want, whenever possible, to test everything using real tools. Doubly so, using tools you'll use it PROD. However, at least postfix is de-facto standard. apt-get install postfix, postfix-pcre bsd-mailx, config and done. Here's an example redirecting ALL outgoing emails, UNLESS they are to your OK domains. Red…

Thanks. I think this is the way to do it because it will be a more realistic test.

Re: Show HN: A fake SMTP server for software integration testing

#38
post #32
post #29

I don't want to burst bubbles, but postfix with few lines of config can redirect all email to DEVs. You really want, whenever possible, to test everything using real tools. Doubly so, using tools you'll use it PROD. However, at least postfix is de-facto standard. apt-get install postfix, postfix-pcre bsd-mailx, config and done. Here's an example redirecting ALL outgoing emails, UNLESS they are to your OK domains. Red…

It's always fascinating to me when people say "not to burst your bubble but it's really simple to use this other tool which can already do the task", and then write an essay about all the workarounds they had to apply to make the other tool work

Adding 8 lines to configuration files is too complicated?

Re: Show HN: A fake SMTP server for software integration testing

#40
A little more information:

So, it's called fakemail but there is a real SMTP server in there. Attachments should work fine. Getting the web app to create SMTP accounts was quite tricky, I'm sure there are better ways but I ended up implementing the unix crypt() algorithm in C#.

Server is holding up fine so far (there was a rate-limiting bug which brought the site down yesterday). Logs show 37K unique IPs have accessed it since yesterday, and it seems to be using about 1% of the CPU (it's on a free VM in the Oracle Cloud).

There is a whole API sitting behind the web page, including proper authentication, but the frontend is very much a MVP.

Very few actual emails have been sent to it, so I'd love it if people could actually send stuff. There are a bunch of websites that can be used to send test mails, e.g.

https://www.gmass.co/smtp-test

https://www.smtper.net/

https://smtpserver.com/smtptest

https://dnschecker.org/smtp-test-tool.php

Post reply on HN