{"id":646,"date":"2013-01-26T00:10:46","date_gmt":"2013-01-25T23:10:46","guid":{"rendered":"http:\/\/thoughtflow.dk\/?p=646"},"modified":"2013-01-26T00:11:27","modified_gmt":"2013-01-25T23:11:27","slug":"an-smtp-server-for-testing","status":"publish","type":"post","link":"https:\/\/davidlebech.com\/thoughtflow\/an-smtp-server-for-testing\/","title":{"rendered":"An SMTP server for testing"},"content":{"rendered":"<p>Today I needed to send some test emails from my application and I searched around for a very simple SMTP server that can save outgoing emails to a folder instead of actually sending them. This is nice for debugging and testing email functionality in an application.<\/p>\n<p>Unfortunately, it was very difficult to find something useful. In the end, I found a <a href=\"http:\/\/www.technoreply.com\/finally-a-dummy-smtp-for-linux\/\">very simple script<\/a> that did the trick. I forked it and added some command-line options so now I can easily run a simple SMTP server on my development computer in Linux, like this:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ndummy_smtp.py -p 8081\r\n<\/pre>\n<p>In case you were wondering, this works really well with the Google App Engine mail API. Simply run the development server like this:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ndev_appserver.py --smtp_host=localhost --smtp_port=8081\r\n<\/pre>\n<p>The source code for the server is right here:<br \/>\n<a href=\"https:\/\/github.com\/dlebech\/Dummy-SMTP\" title=\"Dummy SMTP server on Github\">https:\/\/github.com\/dlebech\/Dummy-SMTP<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I needed to send some test emails from my application and I searched around for a very simple SMTP server that can save outgoing emails to a folder instead of actually sending them. This is nice for debugging and testing email functionality in an application. Unfortunately, it was very difficult to find something useful. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[85,104],"class_list":["post-646","post","type-post","status-publish","format-standard","hentry","category-tips","tag-google-app-engine","tag-smtp"],"_links":{"self":[{"href":"https:\/\/davidlebech.com\/thoughtflow\/wp-json\/wp\/v2\/posts\/646","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/davidlebech.com\/thoughtflow\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/davidlebech.com\/thoughtflow\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/davidlebech.com\/thoughtflow\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/davidlebech.com\/thoughtflow\/wp-json\/wp\/v2\/comments?post=646"}],"version-history":[{"count":0,"href":"https:\/\/davidlebech.com\/thoughtflow\/wp-json\/wp\/v2\/posts\/646\/revisions"}],"wp:attachment":[{"href":"https:\/\/davidlebech.com\/thoughtflow\/wp-json\/wp\/v2\/media?parent=646"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/davidlebech.com\/thoughtflow\/wp-json\/wp\/v2\/categories?post=646"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/davidlebech.com\/thoughtflow\/wp-json\/wp\/v2\/tags?post=646"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}