<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[Thieves Like Us]]></title><description><![CDATA[Opinions and code. But mostly opinions.]]></description><link>http://brianmajewski.com/</link><generator>Ghost 0.6</generator><lastBuildDate>Wed, 08 Apr 2026 13:10:16 GMT</lastBuildDate><atom:link href="http://brianmajewski.com/tag/postfix/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[Going Postal]]></title><description><![CDATA[<p>As mentioned previously, I went with a barebones roll-your-own approach to setting up this server. One of the things that slipped my mind initially was mail forwarding. My former cPanel site made setting up things like mail forwarding a matter of a few clicks. Instead, I got to play with</p>]]></description><link>http://brianmajewski.com/2014/11/09/going-postal/</link><guid isPermaLink="false">9a9cff45-08fd-46b3-8b82-39726c032bd2</guid><category><![CDATA[configuration]]></category><category><![CDATA[dns]]></category><category><![CDATA[postfix]]></category><category><![CDATA[email]]></category><dc:creator><![CDATA[Brian Majewski]]></dc:creator><pubDate>Sun, 09 Nov 2014 16:37:35 GMT</pubDate><media:content url="http://brianmajewski.com/content/images/2015/01/post-office-tub-1109.jpg" medium="image"/><content:encoded><![CDATA[<img src="http://brianmajewski.com/content/images/2015/01/post-office-tub-1109.jpg" alt="Going Postal"><p>As mentioned previously, I went with a barebones roll-your-own approach to setting up this server. One of the things that slipped my mind initially was mail forwarding. My former cPanel site made setting up things like mail forwarding a matter of a few clicks. Instead, I got to play with DNS and Postfix<sup><a href="http://brianmajewski.com/2014/11/09/going-postal/#fn1" id="ref1">1</a></sup> this morning.</p>

<p>Here is what I ended up doing:</p>

<ul>
<li><p>Modified my DNS records</p>

<p>When I set up my original DNS, I only did the bare minimum, pointing my raw domain at my IP address. Now, I added a couple of CNAME records, <code>www</code> and <code>mail</code> to point to my main domain and an MX record to point to my mail subdomain with a priority of 1. Digital Ocean has <a href="https://www.digitalocean.com/community/tutorials/how-to-set-up-a-host-name-with-digitalocean">a control panel</a> to make these changes. When all were entered, the configuration had the following new entries:</p></li>
</ul>

<pre><code>www.brianmajewski.com. 1800 IN CNAME brianmajewski.com.  
mail.brianmajewski.com. 1800 IN CNAME brianmajewski.com.  
brianmajewski.com. 1800 IN MX 1 mail.brianmajewski.com.  
</code></pre>

<ul>
<li><p>Took a shower while the DNS propagated.</p></li>
<li><p>Now, with my server listening for incoming mail, I had to send it somewhere. I wanted to forward all mail to this domain to a catch-all address I have with gmail. So, first, ensure that Postfix is installed, with <code>dpkg -s postfix</code> and if not, install it with <code>apt-get install postfix</code></p></li>
<li><p>Now we want to tell Postfix about our virtual domain. I added the following lines to <code>/etc/postfix/main.cf</code>:</p></li>
</ul>

<pre><code>virtual_alias_domains = brianmajewski.com  
virtual_alias_maps = hash:/etc/postfix/virtual  
</code></pre>

<ul>
<li>And then I created the mapping rules in <code>/etc/postfix/virtual</code>. You can do individual mapping of addresses, but for me, the catch-all is more useful.</li>
</ul>

<pre><code>@brianmajewski.com   (not-really-)my-actual-address@gmail.com
</code></pre>

<ul>
<li>Time to reload Postfix.</li>
</ul>

<pre><code>postmap /etc/postfix/virtual  
/etc/init.d/postfix reload
</code></pre>

<ul>
<li>And finally I fired off an email to <a href="mailto:hireme@brianmajewski.com">hireme@brianmajewski.com</a> and basked in the glory of success.</li>
</ul>

<p>And all of this before 8:30am on a Sunday morning...</p>

<p><sup id="fn1">1. I use the word play loosely. I used to regularly do work like this, had the O'Reily book and everything, but it's amazing what one forgets over a couple decades.<a href="http://brianmajewski.com/2014/11/09/going-postal/#ref1">↩</a></sup></p>]]></content:encoded></item></channel></rss>