{"id":499,"date":"2016-03-10T17:44:40","date_gmt":"2016-03-10T17:44:40","guid":{"rendered":"http:\/\/www.haxed.me.uk\/?p=499"},"modified":"2016-03-10T17:45:07","modified_gmt":"2016-03-10T17:45:07","slug":"sending-test-email-at-commandline-to-test-mailserver","status":"publish","type":"post","link":"https:\/\/haxed.me.uk\/index.php\/2016\/03\/10\/sending-test-email-at-commandline-to-test-mailserver\/","title":{"rendered":"Sending test email at commandline to test mailserver"},"content":{"rendered":"<p>I was migrating some mail today to a new mailserver, i needed to test mail quickly.<\/p>\n<p>So I run this on an external server<\/p>\n<pre>\r\necho \"Hello world\" | mail -s \"meh\" adam@somedomain.com\r\n<\/pre>\n<p>I then ran an tail -f \/var\/log\/mail.log on my local mail server<\/p>\n<pre>\r\ntail -f \/var\/log\/mail.log\r\n\r\nMar 10 17:42:22 mymail-7-wheezy postfix\/cleanup[14592]: 9EF95D42A5: message-id=<20160310174229.A5463E014E@pirax-test.localdomain>\r\nMar 10 17:42:22 mymail-7-wheezy postfix\/qmgr[4691]: 9EF95D42A5: from=<root@pirax-test.localdomain>, size=1097, nrcpt=1 (queue active)\r\nMar 10 17:42:22 mymail-7-wheezy postfix\/virtual[14604]: 9EF95D42A5: to=<adam@theteslasociety.com>, relay=virtual, delay=0.01, delays=0\/0\/0\/0, dsn=2.0.0, status=sent (delivered to maildir)\r\nMar 10 17:42:22 mymail-7-wheezy postfix\/qmgr[4691]: 9EF95D42A5: removed\r\nMar 10 17:42:22 mymail-7-wheezy amavis[14463]: (14463-01) Passed CLEAN {RelayedOpenRelay}, [37.1.1.1]:46386 [37.1.1.1] <root@pirax-test.localdomain> -> <adam@theteslasociety.com>, Queue-ID: 347DDD429D, Message-ID: <20160310174229.A5463E014E@pirax-test.localdomain>, mail_id: Y9fimRqJrWtV, Hits: 1.693, size: 650, queued_as: 9EF95D42A5, 1448 ms\r\nMar 10 17:42:22 mymail-7-wheezy postfix\/smtp[14596]: 347DDD429D: to=<adam@theteslasociety.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=1.5, delays=0.01\/0\/0.01\/1.4, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 9EF95D42A5)\r\nMar 10 17:42:22 mymail-7-wheezy postfix\/qmgr[4691]: 347DDD429D: removed\r\n<\/pre>\n<p>As we can see email is working rather nicely after my DNS updates!<\/p>\n<p>A good way to test this.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was migrating some mail today to a new mailserver, i needed to test mail quickly. So I run this on an external server echo &#8220;Hello world&#8221; | mail -s &#8220;meh&#8221; adam@somedomain.com I then ran an tail -f \/var\/log\/mail.log on &hellip; <a href=\"https:\/\/haxed.me.uk\/index.php\/2016\/03\/10\/sending-test-email-at-commandline-to-test-mailserver\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,9,38,7],"tags":[],"class_list":["post-499","post","type-post","status-publish","format-standard","hentry","category-bash","category-linux","category-mail","category-management-tools"],"_links":{"self":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/499","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/comments?post=499"}],"version-history":[{"count":1,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/499\/revisions"}],"predecessor-version":[{"id":500,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/499\/revisions\/500"}],"wp:attachment":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/media?parent=499"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/categories?post=499"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/tags?post=499"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}