<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Ryan Kavanagh's /dev/brain</title>
    <description>Ryan Kavanagh's musings on computer science, mathematics, and languages—spoken or otherwise.
</description>
    <link>https://ryanak.ca/</link>
    <atom:link href="https://ryanak.ca/feeds/planet-debian.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Thu, 21 Sep 2017 10:26:35 -0400</pubDate>
    <lastBuildDate>Thu, 21 Sep 2017 10:26:35 -0400</lastBuildDate>
    <generator>Jekyll v3.2.1</generator>
    
    <item>
      <title>Specifying a custom MTA path in caff</title>
      <description>&lt;p&gt;I recently had to sign someone’s GPG key. I’ve long used the &lt;code class=&quot;highlighter-rouge&quot;&gt;caff&lt;/code&gt;
tool from the &lt;code class=&quot;highlighter-rouge&quot;&gt;signing-party&lt;/code&gt; package to help me with
this. Unfortunately, I’m using a new laptop and hadn’t yet configured
&lt;code class=&quot;highlighter-rouge&quot;&gt;caff&lt;/code&gt; on it. Moreover, &lt;code class=&quot;highlighter-rouge&quot;&gt;caff&lt;/code&gt; uses the system MTA by default,
normally found at &lt;code class=&quot;highlighter-rouge&quot;&gt;/usr/sbin/sendmail&lt;/code&gt;, and I hadn’t yet properly
configured it to send mail to the outside world. Since I have multiple
email accounts and use &lt;code class=&quot;highlighter-rouge&quot;&gt;mutt&lt;/code&gt; as my mail client, I use &lt;code class=&quot;highlighter-rouge&quot;&gt;msmtp&lt;/code&gt; as my
SMTP client / sendmail drop-in. This post describes how to configure
&lt;code class=&quot;highlighter-rouge&quot;&gt;caff&lt;/code&gt; to use &lt;code class=&quot;highlighter-rouge&quot;&gt;msmtp&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Reading the &lt;code class=&quot;highlighter-rouge&quot;&gt;caff&lt;/code&gt; man page, one sees the following tantalising hint,
which leads you to believe it’s completely trivial to specify your own
MTA:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$CONFIG{'mailer-send'} = [ 'sendmail', '-f', $CONFIG{'email'}, '-it' ];
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Unfortunately, substituting in a custom path, e.g.,
&lt;code class=&quot;highlighter-rouge&quot;&gt;/home/rak/bin/msmtp/msmtp-default&lt;/code&gt;, for &lt;code class=&quot;highlighter-rouge&quot;&gt;sendmail&lt;/code&gt; in the above line
results in a long sequence of errors when &lt;code class=&quot;highlighter-rouge&quot;&gt;caff&lt;/code&gt; tries to mail the
signed keys:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Bareword &quot;home&quot; not allowed while &quot;strict subs&quot; in use at (eval 218) line 1.
Bareword &quot;rak&quot; not allowed while &quot;strict subs&quot; in use at (eval 218) line 1.
Bareword &quot;bin&quot; not allowed while &quot;strict subs&quot; in use at (eval 218) line 1.
Bareword &quot;msmtp&quot; not allowed while &quot;strict subs&quot; in use at (eval 218) line 1.
Bareword &quot;msmtp&quot; not allowed while &quot;strict subs&quot; in use at (eval 218) line 1.
Bareword &quot;default&quot; not allowed while &quot;strict subs&quot; in use at (eval 218) line 1.
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Fortunately, it’s still straightforward to accomplish after reading the perldoc for
&lt;a href=&quot;http://search.cpan.org/~markov/MailTools-2.14/lib/Mail/Mailer.pod&quot;&gt;Mail::Mailer&lt;/a&gt;.
In my case, it was sufficient to add the following to my &lt;code class=&quot;highlighter-rouge&quot;&gt;~/.caffrc&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ENV{'PERL_MAILERS'} = 'sendmail:'.$ENV{'HOME'}.'/bin/msmtp/msmtp-default';
$CONFIG{'mailer-send'} = [ 'sendmail' ];
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;To specify alternate paths to your sendmail-style MTA, simply modify
the value of &lt;code class=&quot;highlighter-rouge&quot;&gt;$ENV{'PERL_MAILERS'}&lt;/code&gt; after the initial &lt;code class=&quot;highlighter-rouge&quot;&gt;sendmail:&lt;/code&gt;
bit. If you’re using stock &lt;code class=&quot;highlighter-rouge&quot;&gt;msmtp&lt;/code&gt;, I believe the following pair of
lines will work, though I haven’t tested it:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;$ENV{'PERL_MAILERS'} = 'sendmail:/usr/bin/msmtp';
$CONFIG{'mailer-send'} = [ 'sendmail' ];
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;If there’s a more elegant way to accomplish this, I’d be happy to hear
about it!&lt;/p&gt;
</description>
      <pubDate>Sat, 16 Apr 2016 12:19:53 -0400</pubDate>
      <link>https://ryanak.ca/2016/04/16/Specifying-a-custom-MTA-path-in-caff.html</link>
      <guid isPermaLink="true">https://ryanak.ca/2016/04/16/Specifying-a-custom-MTA-path-in-caff.html</guid>
      
      <category>planet-debian</category>
      
      
    </item>
    
  </channel>
</rss>
