<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Email on Noetic Nought</title>
    <link>https://punchagan.muse-amuse.in/tags/email/</link>
    <description>Recent content in Email on Noetic Nought</description>
    <generator>Hugo</generator>
    <language>en-US</language>
    <copyright>© 2006-2026 CC-BY-SA-4.0</copyright>
    <lastBuildDate>Sat, 18 Nov 2017 04:50:00 +0530</lastBuildDate>
    <atom:link href="https://punchagan.muse-amuse.in/tags/email/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Multiple remotes with nullmailer</title>
      <link>https://punchagan.muse-amuse.in/blog/multiple-remotes-with-nullmailer/</link>
      <pubDate>Sat, 18 Nov 2017 04:50:00 +0530</pubDate>
      <guid>https://punchagan.muse-amuse.in/blog/multiple-remotes-with-nullmailer/</guid>
      <description>&lt;p&gt;&lt;strong&gt;UPDATE 2018-08-20&lt;/strong&gt;: Moved away from nullmailer&lt;/p&gt;&#xA;&lt;p&gt;I updated my OS and &lt;code&gt;nullmailer&lt;/code&gt; possibly got updated, and this hack no longer&#xA;works. I&amp;rsquo;ve switched to &lt;code&gt;msmtp&lt;/code&gt; with a file based queue that I implemented&#xA;myself. &lt;code&gt;msmtp&lt;/code&gt; can be invoked with the &lt;code&gt;--read-recipient-from&lt;/code&gt; argument, to&#xA;choose the correct right mail server based on the from address.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;p&gt;This a reference for future-me, and possibly someone pulling off an all-nighter&#xA;trying to get &lt;code&gt;nullmailer&lt;/code&gt; to use the correct &amp;ldquo;remote&amp;rdquo;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;what-is-nullmailer-and-why-use-it&#34;&gt;What is nullmailer and why use it?&lt;/h2&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://github.com/bruceg/nullmailer&#34;&gt;Nullmailer&lt;/a&gt; is a simple mail transfer agent that can forward mail to a remote&#xA;mail server (or a bunch of them).&lt;/p&gt;&#xA;&lt;p&gt;I use Emacs to send email, and it can be configured to talk to a remote SMTP&#xA;server to send email. But, this blocks Emacs until the email is sent and the&#xA;connection closed. This is annoying, and having &lt;code&gt;nullmailer&lt;/code&gt; installed locally&#xA;basically lets Emacs delegate this job without blocking.&lt;/p&gt;&#xA;&lt;h2 id=&#34;why-multiple-remotes&#34;&gt;Why multiple remotes?&lt;/h2&gt;&#xA;&lt;p&gt;I have multiple email accounts, and I&amp;rsquo;d like to use the correct remote server&#xA;for sending email based on the FROM address.&lt;/p&gt;&#xA;&lt;p&gt;I expected &lt;code&gt;nullmailer&lt;/code&gt; to have some configuration to be able to specify this.&#xA;But, it turns out that &lt;code&gt;nullmailer&lt;/code&gt; just forwards the email to all the&#xA;configured remotes &lt;a href=&#34;https://github.com/bruceg/nullmailer/blob/master/src/send.cc#L382-L410&#34;&gt;until one of them succeeds&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-do-we-then-send-email-from-the-correct-remote-smtp-server&#34;&gt;How do we, then, send email from the correct remote SMTP server?&lt;/h2&gt;&#xA;&lt;p&gt;Currently, I have two remotes - my personal domain (&lt;code&gt;@muse-amuse.in&lt;/code&gt;) and GMail.&lt;/p&gt;&#xA;&lt;p&gt;Having GMail as the first remote in &lt;code&gt;nullmailer&lt;/code&gt;&amp;rsquo;s configuration wouldn&amp;rsquo;t let me&#xA;send emails from my personal domain. GMail seems to agree to send the email&#xA;coming from &lt;code&gt;@muse-amuse.in&lt;/code&gt;, but overwrite the MAIL FROM address and change it&#xA;to my GMail address.&lt;/p&gt;&#xA;&lt;p&gt;So, &lt;code&gt;@muse-amuse.in&lt;/code&gt; has to be the first remote. But, this server also seemed to&#xA;accept and send emails with a &lt;code&gt;@gmail.com&lt;/code&gt; &lt;code&gt;FROM&lt;/code&gt; address. This was causing&#xA;emails sent from my GMail ID to go into spam, as expected.&lt;/p&gt;&#xA;&lt;p&gt;I had to reconfigure this mail server to reject relaying mails that didn&amp;rsquo;t&#xA;belong to the correct domain names &amp;ndash; i.e., reject relaying emails which had&#xA;&lt;code&gt;@gmail.com&lt;/code&gt; in the &lt;code&gt;FROM&lt;/code&gt; address.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;smtpd_sender_restrictions&lt;/code&gt; had to modified to have &lt;code&gt;reject_sender_login_reject&lt;/code&gt;&#xA;along with other values, and the &lt;code&gt;smtpd_sender_login_maps&lt;/code&gt; had to be set to&#xA;allow only the &lt;code&gt;@muse-amuse.in&lt;/code&gt; domain. &lt;a href=&#34;https://serverfault.com/questions/318334/how-to-enforce-sender-address-to-be-logged-in-userexample-org-in-postfix&#34;&gt;This serverfault answer&lt;/a&gt; explains this in&#xA;more detail.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Scraping Google Groups</title>
      <link>https://punchagan.muse-amuse.in/blog/scraping-google-groups/</link>
      <pubDate>Tue, 31 Dec 2013 00:00:00 +0530</pubDate>
      <guid>https://punchagan.muse-amuse.in/blog/scraping-google-groups/</guid>
      <description>&lt;p&gt;I was playing around with a few ideas for creating a timeline for the&#xA;mumbai ultimate group, and as a part of playing around with stuff, for&#xA;that idea, I ended up wanting to scrape all the emails on our google&#xA;group.  After looking around a little bit, I failed to find anything&#xA;that claims to be able to do this.&lt;/p&gt;&#xA;&lt;p&gt;So I ended up writing my own &lt;a href=&#34;https://gist.github.com/punchagan/7947337&#34;&gt;hacky script&lt;/a&gt; to download all the emails&#xA;sent on the group.  Like I said, this is a hack and can be improved&#xA;quite a bit, but I am not inclined to do anything about it, right&#xA;now.  Since, everything about google groups is ajaxy, this script uses&#xA;selenium and does things on the page, that one would do by hand.  It&amp;rsquo;s&#xA;not something that I am proud of, but it does the job!&lt;/p&gt;&#xA;</description>
    </item>
  </channel>
</rss>
