<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>MTA on Wimpy's World</title><link>https://blog.wimpys.world/tags/mta/</link><description>Recent content in MTA on Wimpy's World</description><generator>Hugo -- gohugo.io</generator><language>en-gb</language><managingEditor>martin@wimpress.com (Martin Wimpress)</managingEditor><webMaster>martin@wimpress.com (Martin Wimpress)</webMaster><lastBuildDate>Sat, 09 Mar 2013 23:27:43 +0000</lastBuildDate><atom:link href="https://blog.wimpys.world/tags/mta/rss.xml" rel="self" type="application/rss+xml"/><item><title>nullmailer on Arch Linux</title><link>https://blog.wimpys.world/posts/nullmailer-on-arch-linux/</link><pubDate>Sat, 09 Mar 2013 23:27:43 +0000</pubDate><author>martin@wimpress.com (Martin Wimpress)</author><guid>https://wimpysworld.com/posts/nullmailer-on-arch-linux/</guid><description>&lt;p&gt;I&amp;rsquo;ve been a fan of &lt;a href="http://untroubled.org/nullmailer/"&gt;nullmailer&lt;/a&gt; for some years
now, so much so that I took ownership of the &lt;a href="https://aur.archlinux.org/packages/nullmailer/"&gt;nullmailer package for Arch Linux&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;nullmailer is a sendmail/qmail/etc replacement MTA for hosts which
relay to a fixed set of smart relays. It is designed to be simple to
configure, secure, and easily extendable.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The other advantage &lt;code&gt;nullmailer&lt;/code&gt; has compared to similar tools is that is queues
email until it is able to deliver it upstream.&lt;/p&gt;
&lt;p&gt;Install &lt;code&gt;nullmailer&lt;/code&gt; as follows.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;packer -S --noedit --noconfirm nullmailer
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Configuring &lt;code&gt;nullmailer&lt;/code&gt; to relay via Gmail can be achieved using
&lt;a href="http://en.wikipedia.org/wiki/SMTPS"&gt;SMTPS&lt;/a&gt; or
&lt;a href="http://en.wikipedia.org/wiki/Mail_submission_agent"&gt;MSA&lt;/a&gt;. &lt;code&gt;nullmailer&lt;/code&gt; has
had these capabilities since 1.10. The following provides some useful clues
&lt;code&gt;/usr/lib/nullmailer/smtp --help&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;While these examples are specific to relaying via Gmail, you can see it is
trivial to adapt them to any other mail host.&lt;/p&gt;
&lt;h2 id="relay-via-gmail-using-msa"&gt;Relay via Gmail using MSA&lt;/h2&gt;
&lt;p&gt;Add to following to &lt;code&gt;/etc/nullmailer/remotes&lt;/code&gt;. I prefer this technique.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;smtp.gmail.com smtp --port&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;587&lt;/span&gt; --auth-login --user&lt;span class="o"&gt;=&lt;/span&gt;you@gmail.com --pass&lt;span class="o"&gt;=&lt;/span&gt;Yourpassword --starttls
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="relay-via-gmail-using-smtps"&gt;Relay via Gmail using SMTPS&lt;/h2&gt;
&lt;p&gt;Add to following to &lt;code&gt;/etc/nullmailer/remotes&lt;/code&gt;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;smtp.gmail.com smtp --port&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;465&lt;/span&gt; --auth-login --user&lt;span class="o"&gt;=&lt;/span&gt;you@gmail.com --pass&lt;span class="o"&gt;=&lt;/span&gt;Yourpassword --ssl
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Once you&amp;rsquo;ve got &lt;code&gt;/etc/nullmailer/remotes&lt;/code&gt; configured start the nullmailer service.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo systemctl start nullmailer
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To test &lt;code&gt;nullmailer&lt;/code&gt; can relay email correctly do the following.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Test 1&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; mailx -s &lt;span class="s2"&gt;&amp;#34;Test One&amp;#34;&lt;/span&gt; me@example.org
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can see what &lt;code&gt;nullmailer&lt;/code&gt; is up to by checking the systemd journal or syslog
(if you&amp;rsquo;ve syslog enabled systemd). This is how to get the logs from the systemd
journal.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;journalctl &lt;span class="nv"&gt;_SYSTEMD_UNIT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;nullmailer.service
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Or via syslog.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo grep nullmailer /var/log/daemon.log
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;When you&amp;rsquo;re happy &lt;code&gt;nullmailer&lt;/code&gt; is working enable the systemd unit.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo systemctl &lt;span class="nb"&gt;enable&lt;/span&gt; nullmailer
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Email will now flow as required.&lt;/p&gt;</description><summary>Configuring nullmailer on Arch Linux to relay email via Gmail</summary></item></channel></rss>