<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Within Reason: Category Mail</title>
    <link>http://typo.submonkey.net/articles/category/mail</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>I do what I want</description>
    <item>
      <title>Gone to the bad</title>
      <description>&lt;p&gt;There has been a lot of &lt;a href="http://www.timgaden.com/hawkwings/2006/02/15/talking-mailapp-drunkenbatman/"&gt;complaining&lt;/a&gt; done about &lt;a href="http://the.taoofmac.com/space/blog/2005-05-06"&gt;problems&lt;/a&gt; with Apple&amp;#8217;s &lt;a href="http://daringfireball.net/2003/06/you_have_new_mail"&gt;&lt;code&gt;Mail.app&lt;/code&gt;&lt;/a&gt;.   &lt;/p&gt;

&lt;p&gt;The major annoyances with it for me have been its utter refusal to mark messages as read or to retrieve addresses from our LDAP servers reliably.  Since we have a site-wide license for Office, I decided to try &lt;a href="http://www.microsoft.com/mac/products/entourage2004/entourage2004.aspx"&gt;Entourage&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Yes, it&amp;#8217;s from Microsoft.  The secret is this though: on Mac OS X, Office isn&amp;#8217;t really, really shit and annoying.  &lt;/p&gt;

&lt;p&gt;Entourage basically does everything that I want; it has sensible defaults with respect to top-posting (and not doing it) and text formats (plain by default), and can actually mark a message as read once I have read it.  LDAP stuff works too.&lt;/p&gt;

&lt;p&gt;It did manage to &lt;a href="http://lists.freebsd.org/pipermail/freebsd-www/2006-February/003739.html"&gt;mangle my signature&lt;/a&gt;, but that was imported from &lt;code&gt;Mail.app&lt;/code&gt; so I&amp;#8217;ll give it the benefit of the doubt there.&lt;/p&gt;</description>
      <pubDate>Fri, 17 Feb 2006 20:54:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:6031e74ea7b3383cd17ff1748dc0fc5a</guid>
      <author>Ceri Davies</author>
      <link>http://typo.submonkey.net/articles/2006/02/17/gone-to-the-bad</link>
      <category>Apple</category>
      <category>Mail</category>
      <category>Software</category>
      <trackback:ping>http://typo.submonkey.net/articles/trackback/64</trackback:ping>
    </item>
    <item>
      <title>SMTP AUTH with Exim</title>
      <description>&lt;p&gt;Although I am unsure of both the wisdom and utility of &lt;a href="http://typo.submonkey.net/articles/2005/11/21/defeating-the-purpose"&gt;dragging my laptop to EuroBSDcon&lt;/a&gt;, I&amp;#8217;m also sure that I don&amp;#8217;t want to &lt;a href="http://typo.submonkey.net/articles/2005/01/31/rcec"&gt;get laughed at for using mutt&lt;/a&gt; again.  Kmail seems a little more stable than a year ago, and my IMAP setup is seeing the benefit of experience too.&lt;/p&gt;

&lt;p&gt;Not reading your mail from the same command line all the time brings another problem though: how to send outbound mail?&lt;/p&gt;

&lt;p&gt;The obvious solution is SMTP AUTH, but I&amp;#8217;ve always shied away from actually looking at how to do it.  Turns out that  Exim makes it an utter piece of cake.&lt;/p&gt;

&lt;p&gt;Simply add an authenticator for the AUTH mechanism of your choice:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;lookup_cram:
  driver = cram_md5
  public_name = CRAM-MD5
  server_secret = ${lookup{$1}lsearch{/usr/local/etc/exim/authpwd}{$value}fail}
  server_set_id = $1
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;(Note that &lt;a href="http://typo.submonkey.net/articles/2005/09/09/use-gmail-as-a-smart-host"&gt;I previously added an authenticators section&lt;/a&gt; to my exim configuration; if you don&amp;#8217;t already have one, you&amp;#8217;ll need to add it.)&lt;/p&gt;

&lt;p&gt;You&amp;#8217;ll also need to edit your &lt;code&gt;acl_smtp_rcpt&lt;/code&gt; ACL and add:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt; accept  authenticated = *
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;at an appropriate point.&lt;/p&gt;

&lt;p&gt;Then create &lt;code&gt;/usr/local/etc/exim/authpwd&lt;/code&gt; which contains a &lt;code&gt;username:password&lt;/code&gt; pair on each line, separated by a comma.  Make sure that this file has appropriate permissions, of course.  Easy.&lt;/p&gt;</description>
      <pubDate>Tue, 22 Nov 2005 00:01:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:e16eb0be774045f14d4c45b5d3cbc2bc</guid>
      <author>Ceri Davies</author>
      <link>http://typo.submonkey.net/articles/2005/11/22/smtp-auth-with-exim</link>
      <category>Mail</category>
      <category>Software</category>
      <trackback:ping>http://typo.submonkey.net/articles/trackback/53</trackback:ping>
    </item>
    <item>
      <title>Use Gmail as a Smart Host</title>
      <description>&lt;p&gt;I like to send mail direct from my home network for various reasons, not least being that I used to work on my current ISP&amp;#8217;s mail servers and I know that they are in and out of blackholes these days like Hawking radiation.  By sending mail directly from my dynamic block, the results are at least somewhat consistent.&lt;/p&gt;

&lt;p&gt;Some may suggest changing ISP, but I am happy with every other aspect of their service, and there is no guarantee that any other ISP won&amp;#8217;t run in to the same problems at any point in the future.  Exim makes it easy for me to maintain a list of domains that do require me to use my ISP&amp;#8217;s smart host, and even has the decency to read it dynamically, so it&amp;#8217;s little hardship for me to:

&lt;code&gt;echo painintheass.net &gt;&gt; /usr/local/etc/exim/smarthost.domains&lt;/code&gt;

for those domains that do need it.&lt;/p&gt;

&lt;p&gt;Occasionally, however, I run into problems whereby the recipient that I am trying to mail won&amp;#8217;t accept mail from me or the upstream smart host at the ISP.  In the past, that has meant that I&amp;#8217;ve been stuffed, which would normally be the would-be recipient&amp;#8217;s problem, but every so often I really, really want to send them the message.&lt;/p&gt;

&lt;p&gt;This just happened twice in the space of ten minutes, so I worked out how to get exim to relay mail via smtp.gmail.com:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;p&gt;First, enable POP for your gmail account.  You do that in the &amp;#8220;Forwarding and POP&amp;#8221; section of the settings.  Strangely enough.&lt;/p&gt;&lt;/li&gt;

  &lt;li&gt;&lt;p&gt;Next, add a domain list to your exim configuration:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;domainlist use_gmail_domains = /usr/local/etc/exim/gmail.domains&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This domain list will hold the list of domains to send via gmail, one domain per line.  If you don&amp;#8217;t have any to add now, create the file empty with touch(1) so that you don&amp;#8217;t forget later.  Exim won&amp;#8217;t complain either way.&lt;/p&gt;&lt;/li&gt;

  &lt;li&gt;&lt;p&gt;Create an authenticator.  Note that although we&amp;#8217;re using the plaintext mechanism here, we&amp;#8217;ll force TLS in the transport so your details will not get transferred in the clear:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;gmail_login:
  driver = plaintext
  public_name = LOGIN
  client_send = : &lt;em&gt;YourGmailUsername&lt;/em&gt;@gmail.com : &lt;em&gt;YourGmailPassword&lt;/em&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Note that in a default exim configuration there are usually no authenticators, so don&amp;#8217;t forget the &lt;code&gt;begin authenticators&lt;/code&gt; statement if this is your first one.&lt;/p&gt;&lt;/li&gt;

  &lt;li&gt;&lt;p&gt;Add a router:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;send_via_gmail:
  driver = manualroute
  domains = +use_gmail_domains
  transport = gmail_smtp
  route_list = "* smtp.gmail.com byname"&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Add a transport, forcing it to use AUTH and TLS:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;gmail_smtp:
  driver = smtp
  hosts = smtp.gmail.com
  hosts_require_auth = smtp.gmail.com
  hosts_require_tls = smtp.gmail.com&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That&amp;#8217;s all it requires.  You may now need to lock down the permissions on your configuration file to stop anyone reading your username and password from it.  Advanced exim users can work out how to put this information in a separate file easily enough.&lt;/p&gt;</description>
      <pubDate>Fri, 09 Sep 2005 21:36:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:a8c86067f27f41d889a372327e062f31</guid>
      <author>Ceri Davies</author>
      <link>http://typo.submonkey.net/articles/2005/09/09/use-gmail-as-a-smart-host</link>
      <category>Mail</category>
      <category>Software</category>
    </item>
  </channel>
</rss>
