<?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[Bill's Adventures in Cyberspace]]></title><description><![CDATA[Hopefully helpful, interesting stuff.]]></description><link>https://blog.softwareschmiede-herndon.de/</link><generator>Ghost 0.11</generator><lastBuildDate>Mon, 06 Apr 2026 00:01:43 GMT</lastBuildDate><atom:link href="https://blog.softwareschmiede-herndon.de/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[Rant]]></title><description><![CDATA[<p>It's been far too long. And I need to rant.</p>

<p>Recently I've mostly been working with PHP, and debugging my programs on a server, using Eclipse and XDebug remote debugging when it needed to be step-by-step. This has not always worked well, but it worked well enough for most purposes.</p>]]></description><link>https://blog.softwareschmiede-herndon.de/rant/</link><guid isPermaLink="false">dccd2931-0f88-4157-ac37-d3c255c74ea1</guid><dc:creator><![CDATA[William David Herndon]]></dc:creator><pubDate>Thu, 12 Oct 2017 11:00:38 GMT</pubDate><content:encoded><![CDATA[<p>It's been far too long. And I need to rant.</p>

<p>Recently I've mostly been working with PHP, and debugging my programs on a server, using Eclipse and XDebug remote debugging when it needed to be step-by-step. This has not always worked well, but it worked well enough for most purposes.</p>

<p>Usually I just wrote the code, uploaded it, tried it out, fixed problems. Only occasionally would I need to open Eclipse and do step-by-step debugging. When I opened Eclipse, all of the windows to the source code would be blank, and I had to close them all, open the remote-access project, and then re-open the source. It was a pain, but doable.</p>

<p>Then, for some reason Eclipse and XDebug decided that they weren't going to handle breakpoints properly on my latest Joomla-based project (Joomla is a PHP-based CMS).</p>

<p>And then Eclipse refused to terminate - it had to be killed using the Task Manager.</p>

<p>After several rounds of dealing with that, I figured out how to fix the termination problem using the "-clean" and "-clearPersistedState" options at startup. But it still didn't want to do step-by-step debugging.</p>

<p>Okay. It is probably some interaction between the remote access and Joomla's massive number of files. I'll have to install and work it locally. Originally that was a problem, but I managed to get Microsoft SQL Server working with PHP locally a couple of months ago, so this should be no biggie. Right?</p>

<p>Joomla installation is simple - just unzip the files and open the root folder in your browser. Enter some data - especially database login credentials - and you're off to the races.</p>

<p>Except this time, it returns to the final "these are the options you chose" screen, before the "success" screen.</p>

<p>No error message. No red markings saying "this option is bad", nothing. It just returns.</p>

<p>After several rounds of retrying with varied options, I tried duckduckgoing the problem (Duckduckgo is like Google, but without tracking you and biasing your results). No one seemed to have my specific problem: most people were using Linux instead of Windows. And when they were using Windows, they used XAMP (a package containing everything one needs for a modern webserver: Apache WebServer, Tomcat, Java, MySQL). I hadn't installed that because when I first tried it, I didn't have enough space, and because I needed some feature of Microsoft's IIS at the time.</p>

<p>So... being the stubborn SOB I am, I decided to debug the problem. After a false start or two, I got Eclipse and XDebug to play nice locally, and started the Joomla installation. Boom: before the first Joomla screen, it gives me two error messages in the browser: some MySQL error, followed by an error about sending headers twice. <em>sigh</em>.</p>

<p>So, why is it even trying MySQL? I try debugging into it, to find out why it's calling MySQL, which I don't have installed. It turns out it simply tries it as its first default. Hmmm. I change the default to SQLSRV (which I think I have), but that fails for some reason - it later turns out that the Express version is handled differently, but at this point, I decide that maybe, just maybe, the second error message is the real problem.</p>

<p>I deactivate XDebug, and the error messages go away, we're back to the previous situation. I re-activate, the error messages are back. Some duckduckgoing, and I find that the second header problem occurs when one attempts to setup output and there's already output - like an error screen. Looking through the XDebug options I find that there's an option I've been activating that sends the error messages straight to the screen. I deactivate this, and <em>vóila!</em>, I get my Joomla installation screen. MySQL fails silently, it recovers correctly and then proceeds to try other options until it finds the one that works.</p>

<p>Okay. So, I proceed to install Joomla with the debugger in the background, and ... it returns to the final screen, just as before. The debugger doesn't automatically stop at an error. Of course not. That would make things too easy.</p>

<p>So, hours of step-by-step debugging later, using all the tricks I know to debug through the forest that is Joomla, I find that it is throwing an exception in JArrayHelper::toObject, trying to create an object of type "stdclass". The header is:</p>

<p>public static function toObject(&amp;$array, $class = 'stdClass', $recursive = true)</p>

<p>Anyone notice anything?</p>

<p>Take your time.</p>

<p>Yeah. So, I set a breakpoint at the function and ... no, that doesn't work at all: this thing is called <em>everywhere</em>!</p>

<p>Okay. I go and modify toObject(), telling it to do something if the class is all lowercase, and then setting a breakpoint on that "do something" line. This works: it stops right where it should.</p>

<p>Looking up the stack, the call only provides one parameter, so $class should be 'stdClass'. But it's 'stdclass'. That should not happen - it looks like a problem in PHP.</p>

<p>I correct it to 'stdClass' and let it proceed: I get the "success" screen from Joomla installation.</p>

<p>Did I mention that I'm stubborn? There's thousands of Joomla programmers, some of them must have hit this rock and given up - installed XAMP, worked around it, or gone and joined a monastery.</p>

<p>I set about figuring out what PHP call provokes the problem, and it turns out that the last call before 'stdClass' becomes 'stdclass' is a call to "$query->execute()" - in other words, to my non-standard database. So probably not PHP directly - probably the PHP database driver for Microsoft SQL Server. The one that everyone seems to complain about, just before telling you to use MySQL instead.</p>

<p>I look for the most recent version, and: apparently the drivers are offered for download by Microsoft, and it tells you that the most recent version is 4.3 and only supported for Windows 8 and later (I'm still on Windows 7). I decide to download and try it anyway. Except that the download only gives me 4.0 as an option. I double-check. Yep. The Microsoft page with the description telling me about 4.3 links to a page where 4.3 isn't available. A bit of work later, I deduce that I'm using the latest version of the 4.0 driver already.</p>

<p>A bit more searching later, and I find the one 4.3 'native' binary (shouldn't there be two? The PDO and the native version?) - I install the native binary anyway, but it doesn't work. Of course. PHP thinks there's no database access at all.</p>

<p>This is a challenge. I find the sources for the driver and download them, but they don't come with instructions. And don't compile properly if I just try the obvious.</p>

<p>Okay. The driver is a PHP extension, I'll lookup how to build PHP extensions in general - that's likely a clue.</p>

<p>The recommendation is, that one build PHP before one builds extensions. And for my version, PHP 7.0, if you are building under Windows instead of Linux, you will need Microsoft Visual C/C++ 2015 or later (Note: I already have two previous versions of Visual Studio cluttering my hard drive, I don't want a third). <em>Why</em> does it need Microsoft tools (as opposed to MingW), and why that version? Apparently because it was developed by people at Microsoft, who are familiar with SQL Server, and of course they use the latest and greatest.</p>

<p>Did I mention that I'm stubborn?</p>

<p>After some modifications to the include files and two source files, I get it through the compile phase of Visual C/C++ 2010, but the link fails with an unknown link option "-FitObjData".</p>

<p>One of the things I had to change to get it to compile, was a misuse of the ALLOCA_FLAG() macro - something that could overwrite things on the stack and cause random problems precisely like the one observed. I should probably notify the PHP developers about that.</p>

<p>So, none of the build files passes this "-FitObjData" anywhere. It must be an implicit flag of some sort. A search online shows first that this occurs when you use newer libraries with an older linker. Recommended solution is to use the same compiler for both. Hmmm. The libraries are provided, and it would take days or weeks to get all of their sources and recompile them all for this. A bit more searching, and somewhere, someone mentions "inlining" in connection with this linker problem, and that they gave up, too. Aha! Inlining is an optimization. If I set it up for debugging, then optimizations should be turned off, and maybe that will get rid of the problem.</p>

<p>It does. But now it's having trouble with doubly-defined functions and missing functions, related to vsprintf(). Oh, no. I've run into this kind of problem before, when I was working on embedded software. I ended up rolling my own vsprintf() equivalent, because all the different vsprintf()s are incompatible depending on your compiler options and dangerous to mix-and-match. It is time to give up on this path.</p>

<p>So, I go and install MySQL? You don't know me very well.</p>

<p>No, I'm going to compile PHP, even if I have to bite the bullet and install Visual Studio 2015. A couple hours later, I've signed up for some free developer stuff from Microsoft and have  started the install for the free version of Visual Studio 2015. The installation takes a couple hours, and the installation of the Windows 10 SDK fails, but the rest appears to work.</p>

<p>So, this is the recommended toolset with everything setup exactly as recommended in the instructions. Everything should just work, right?</p>

<p>Ha.</p>

<p>A clean build of the default configuration tells me: "fatal error C1007: unrecognized flag '-FitObjData' in 'p2'", just as before. That isn't supposed to happen - I have the new tools! Well, what worked once may work again - activate debug build!</p>

<p>The debug version tells me: lots of trouble with missing vsprintf() functions again! Verfluchte ... Wait a sec. It's "php7ts_debug.dll" is missing these functions - that's the thread safe version. Despite thread-safe being, well, safer, I know that the standard version is non-thread-safe. Time to rebuild!</p>

<p>The non-thread safe and debug version tells me: vsprintf() functions are still missing.</p>

<p>It's been over two days now. I've got things to get done. I don't have time for this crap anymore. I'm going to install Joomla using the debugger to set "stdclass to "stdClass" and move on. For now.</p>]]></content:encoded></item><item><title><![CDATA[Serving Email Part 6: Debugging]]></title><description><![CDATA[<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2017/02/debugging.png" alt="red circle and slash over a bug"></div>

<p>This is the final post in the now six part series "Serving Email". In this post we will explore how to figure out what's wrong when your email server isn't working properly.</p>

<p>This series:</p>

<ul>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-1/">Part 1: The Pieces of the Puzzle</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-2/">Part 2: Subdomains and DNS</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-3/">Part 3: Encryption and</a></li></ul>]]></description><link>https://blog.softwareschmiede-herndon.de/serving-email-part-6/</link><guid isPermaLink="false">02fad3d1-8553-4381-b972-3b7d7627f9ce</guid><dc:creator><![CDATA[William David Herndon]]></dc:creator><pubDate>Thu, 02 Mar 2017 08:37:00 GMT</pubDate><content:encoded><![CDATA[<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2017/02/debugging.png" alt="red circle and slash over a bug"></div>

<p>This is the final post in the now six part series "Serving Email". In this post we will explore how to figure out what's wrong when your email server isn't working properly.</p>

<p>This series:</p>

<ul>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-1/">Part 1: The Pieces of the Puzzle</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-2/">Part 2: Subdomains and DNS</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-3/">Part 3: Encryption and SSL Certificates</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-4/">Part 4: The Email Server(s)</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-5/">Part 5: Autoconfiguration</a></li>
<li><strong>Part 6: Debugging Email Problems</strong> &lt;- You are here</li>
</ul>

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2017/03/direction-signs.png" alt="sign post pointing in 3 different directions"></div>

<h3 id="wheretostart">Where to Start</h3>

<p>There are several parts to test when testing an email server. At the most basic level:</p>

<ul>
<li>Can you send emails from the server?</li>
<li>Can you receive emails sent to the server?</li>
</ul>

<p>Each of these can be broken down further:</p>

<ul>
<li>Can the service be located: is the meta information (DNS, et al.) about the service correct?</li>
<li>Can the appropriate service be connected to on the appropriate socket?</li>
<li>Is the SSL-certificate correct? (correct name? correct dates? etc.)?</li>
<li>Does a secure connection occur?</li>
<li>Is the authentication information correct?</li>
<li>Does autoconfiguration set things correctly?</li>
</ul>

<p>Also: is the MTA (SMTP/outgoing server) storing the emails in the same format and location that the IMAP/POP3/incoming server is expecting? </p>

<p>This is my process (YMMV):</p>

<ul>
<li>Set up Thunderbird as a client to the mail server
<ul><li>if it autoconfigures, I verify the parameters</li>
<li>if needed correct the parameters manually</li></ul></li>
<li>Send myself an email (server -&gt; itself)</li>
<li>Once that works, I try sending an email from another server</li>
<li>Once that works, I try sending an email to another server</li>
<li>Verify that autoconfiguration works for Thunderbird, Outlook</li>
<li>Test Configuration Profile for iPhone</li>
</ul>

<p>I leave fixing autoconfiguration for last, even though it occurs first: I can always configure manually until it works. At any other point where it fails, I check likely failure points.</p>

<p>If the connection fails it is usually obvious in the test phase of your email client configuration. I try manually connecting using the appropriate tool (see section below) and if that succeeds, manually authenticating. Possible causes are misconfiguration of the server and firewall interference.</p>

<p>More commonly (in my experience) the connection works, but it fails to send or receive mails. The most common cause for that is misconfigured DNS entries.</p>

<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2017/03/meter.png" alt="multimeter"></div>

<h3 id="testingconnections">Testing Connections</h3>

<p>If you're having trouble receiving emails or connecting as a client, you'll want to test if the appropriate port for the protocol is open and you can connect correctly.</p>

<p>I usually test the unencrypted connection before testing the encrypted connection - you can go straight to the encrypted connection (below), but if the server supports the unencrypted ports (STARTTLS starts out unencrypted) I like to use telnet to make sure that the ports are open and the server responding.</p>

<p>There are several programs that you can use to test the connections to a selected port that you need for testing.</p>

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2017/03/telnet.gif" alt="telnet prompt in a box"></div>

<h5 id="telnetunencryptedonly">telnet - Unencrypted Only</h5>

<p><code>telnet</code> is an ancient program (I used it in college over 30 years ago) that only gives you a simple unencrypted TCP/IP connection. It is available under both Linux and Windows by default.</p>

<p>Example testing the connection to SMTP (port 25):<code> <br>
 $ <b>telnet mail.example.com 25</b>
 220 mail.example.com ESMTP Postfix (Ubuntu)
 <b>EHLO example.com</b>
 250-example.com
 250-PIPELINING
 250-SIZE 10240000
 250-ETRN
 250-STARTTLS
 250-AUTH DIGEST-MD5 CRAM-MD5 PLAIN LOGIN
 250-ENHANCEDSTATUSCODES
 250-8BITMIME
 250 DSN
 <b>QUIT</b>
 221 2.0.0 Bye
 &nbsp;
 Connection to host lost.
</code> <br>
Example testing the connection to IMAP (port 143):<code> <br>
 $ <b>telnet example.com 143</b>
 * OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 AUTH=CRAM-SHA1 AUTH=CRAM-SHA256 AUTH=PLAIN IDLE ACL ACL2=UNION STARTTLS] Courier-IMAP ready. Copyright 1998-2015 Double Precision, Inc.  See COPYING for distribution information.
 <b>CAPABILITY</b>
 * CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 AUTH=CRAM-SHA1 AUTH=CRAM-SHA256 AUTH=PLAIN IDLE ACL ACL2=UNION STARTTLS
 CAPABILITY OK CAPABILITY completed
 <b>LOGOUT</b>
 * BYE Courier-IMAP server shutting down
 LOGOUT OK LOGOUT completed
 &nbsp;
 Connection to host lost.
</code></p>

<p>Example testing the connection to POP3 (port 110):<code> <br>
 $ <b>telnet example.com 110</b>
 +OK Hello there. &lt;5277.1488453319@localhost.localdomain&gt;
 QUIT
 +OK Better luck next time.
 &nbsp;
 Connection to host lost.
</code></p>

<p><a href="http://www.putty.org/"><div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2017/03/putty.gif" alt="PuTTY logo"></div></a></p>

<h5 id="puttyunencryptedonly">PuTTY - Unencrypted Only</h5>

<p><a href="http://www.putty.org/">PuTTY</a> is a popular terminal program used primarily under Windows, but also available under Linux. Although it supports an encrypted ssh mode, this is not compatible with the encryption on the mail ports.</p>

<p>If, for some reason, you have an aversion to telnet or just really love PuTTY, telnet mode is supported. To use <code>putty</code> in telnet mode, there are two options: <br>
<code> putty telnet:&lt;address&gt;:&lt;port&gt;</code> <br>
or <br>
<code> putty -telnet &lt;address&gt; &lt;port&gt;</code></p>

<p>For the SMTP example from <code>telnet</code> above:<code> <br>
 $ <b>putty telnet:mail.example.com:25</b>
 $
</code> <br>
The interaction then occurs in a separate PuTTY terminal:<code> <br>
 220 mail.example.com ESMTP Postfix (Ubuntu)
 <b>EHLO example.com</b>
 250-example.com
 ...
</code></p>

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2017/03/openssl.png" alt="OpenSSL logo"></div>

<h6 id="opensslsecureconnections">openssl - Secure Connections</h6>

<p><code>openssl</code> supports both STARTTLS used on the default ports to upgrade an unencrypted connection to an encrypted connection (SMTP: 25, IMAP: 143, POP3: 110), and client SSL used on the encrypted ports (SMTPS: 465, IMAPS: 993, POP3S: 995).</p>

<p>Under Linux you may have to install the package. This will be <br>
<code> sudo apt install openssl</code> <br>
 on most Linux systems.</p>

<p>Under Windows, the simplest way to get openssl is via <a href="https://cygwin.com/">Cygwin</a> - at setup, add the openssl package to the default installation. The setup should install a Linux-like shell - you enter the <code>openssl</code> commands at that Linux-like shell rather than the usual DOS Prompt.</p>

<p>One can get OpenSSL for Windows, but I currently don't trust many of the sites offering binaries - you're on your own if you wish to pursue that.</p>

<p>Other MTAs will expect to port 25 to be open on your MTA, so testing SMTP/STARTTLS on port 25 should work. Note below that <code>smtp</code> is lowercase: <code>openssl</code> is case sensitive and expects the protocol in lowercase. In the examples, user input is bold, the shell prompt is "$": <code> <br>
 $ <b>openssl s_client -connect mail.example.com:25 -starttls smtp</b>
 CONNECTED(00000003)
 depth=2 C = BE, O = GlobalSign nv-sa, OU = Root CA, CN = GlobalSign Root CA
 ... &lt;Information on the certificate chain&gt; ...
 ... &lt;Information on the handshake/session&gt; ...
 ---
 250 DSN
 <b>EHLO mail.example.com</b>
 250-mail.example.com
 250-PIPELINING
 250-SIZE 10240000
 250-ETRN
 250-AUTH DIGEST-MD5 CRAM-MD5 PLAIN LOGIN
 250-ENHANCEDSTATUSCODES
 250-8BITMIME
 250 DSN
 <b>QUIT</b>
 DONE
</code></p>

<p>Example testing IMAPS on port 993, without STARTTLS: <code> <br>
 $ <b>openssl s_client -connect mail.example.com:993</b>
 CONNECTED(00000003)
 ... &lt;Information on the certificate chain&gt; ...
 ... &lt;Information on the handshake/session&gt; ...
 * OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE  THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 AUTH=CRAM-SHA1 AUTH=CRAM-SHA256 AUTH=PLAIN IDLE ACL ACL2=UNION] Courier-IMAP ready. Copyright 1998-2015 Double Precision, Inc.  See COPYING for distribution information.
 <b>QUIT</b>
 DONE
</code></p>

<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2017/03/login-failed.png" alt="Message box: Login Failed Authentication Error"></div>

<h3 id="authentication">Authentication</h3>

<p>A common mistake is assuming that your Linux user-base is the same as your email user-base - this is often not the case. For example, the plesk control panel on my VPS by default allows you to set up email accounts entirely independent of user login accounts. Conversely, under Windows, <a href="https://en.wikipedia.org/wiki/Lightweight_Directory_Access_Protocol">LDAP</a> is configured to use the same logins.</p>

<p>Usually you can enable plain text logins when the connection is encrypted, so you can test a username/password pair when you connect using <code>openssl</code>. For both SMTP and IMAP, "plain" is actually <a href="https://en.wikipedia.org/wiki/Base64">base64</a> encoding. The following will work under Linux and Cygwin, substituting your login info for <code>myname@myserver.com</code> and <code>mY-pasSwoRd</code>, and of course your SMTP/IMAP server for <code>myserver.com</code> in the <code>openssl</code> command: <code> <br>
 $ <b>######## SMTP Login Example ########</b>
 $ <b># Get the username encoded in base64</b>
 $ <b>echo -en "myname@myserver.com" | base64</b>
 bXluYW1lQG15c2VydmVyLmNvbQ==
 &nbsp;
 $ <b># Get the password encoded in base64</b>
 $ <b>echo -en "mY-pasSwoRd" | base64</b>
 bVktcGFzU3dvUmQ=
 &nbsp;
 $ <b># Now login using those two strings in that order</b>
 $ <b>openssl s<em>client -connect myserver.com:25 -starttls smtp</em></b>
 CONNECTED(00000003)
 ...
 250 DSN
 <b>AUTH LOGIN</b>
 334 VXNlcm5hbWU6
 <b>bXluYW1lQG15c2VydmVyLmNvbQ==</b>
 334 UGFzc3dvcmQ6
 <b>bVktcGFzU3dvUmQ=</b>
 235 2.7.0 Authentication successful
 <b>QUIT</b>
 DONE
 $ <b># In case you are wondering about the lines beginning with "334":</b>
 $ <b>echo -en "VXNlcm5hbWU6" | base64 --decode</b>
 Username:
 $ <b>echo -en "UGFzc3dvcmQ6" | base64 --decode</b>
 Password:
 $
 $ <b>######## IMAP Login Example ########</b>
 $ <b># Get the IMAP-login (username and password together) encoded in base64</b>
 $ <b>echo -en "\0myname@myserver.com\0mY-pasSwoRd" | base64</b>
 AG15bmFtZUBteXNlcnZlci5jb20AbVktcGFzU3dvUmQ=
 &nbsp;
 $ <b># Now connect and login using the string we got</b>
 $ <b>openssl sclient -connect myserver.com:993</b>
 ...
 * OK [CAPABILITY IMAP4rev1 ...
 <b>a001 AUTHENTICATE PLAIN</b>
 +
 <b>AG15bmFtZUBteXNlcnZlci5jb20AbVktcGFzU3dvUmQ=</b>
 a001 OK LOGIN Ok.
 <b>QUIT</b>
 DONE
</code></p>

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2017/03/check-dns.png" alt="Stethoscope and phone book"></div>

<h3 id="checkingdnsentries">Checking DNS Entries</h3>

<p>Before checking your DNS entries, you may want to review part 2 of this series, <a href="https://blog.softwareschmiede-herndon.de/serving-email-part-2/">Subdomains and DNS</a>.</p>

<p>There are two basic tools for examining DNS records that are essentially equivalent: <code>nslookup</code> and <code>dig</code>.</p>

<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2017/03/building-directory.jpeg" alt="building directory"></div>

<h5 id="nslookup">nslookup</h5>

<p><code>nslookup</code> is an old program for looking up DNS entries. There are different variants available under Linux and Windows, but they have the same basic purpose, have a similar syntax and are installed by default. If you enter <code>nslookup</code> without parameters, it will enter interactive mode. I will not be covering interactive mode here.</p>

<p>The most essential DNS entry is the MX entry: this tells external servers where they should send email. For example, if you receive mail for <code>example.com</code>, the lookup syntax would be the same under Windows and Linux, though the response will look slightly different:<code> <br>
 $ <b>nslookup -query=MX example.com</b>
</code></p>

<p>If this returns the wrong entry, I would try again using the host itself as the DNS server:<code> <br>
 $ <b>nslookup -query=MX example.com example.com</b>
</code></p>

<p>If it shows the wrong server, too, I would check my configuration (in my case, the panel in my VPS).</p>

<p>If it does return the correct entry, then I know I have a propagation error: my settings aren't being propagated to a higher level DNS server. On my server, this also means checking the panel: propagating to my primary DNS server is not automatic, but can be initiated via the panel. This may or may not be the case on your server(s).</p>

<p>Looking up the TXT records of example.com:<code> <br>
 $ <b>nslookup -query=TXT example.com</b>
 Server: local-dns-server.xyz
 Address: 111.222.123.234#53
 &nbsp;
 Non-authoritative answer:
 example.com     text = "v=spf1 +a +mx -all"
 example.com     text = "\"mailconf=https://example.com/mail/config-v1.1.xml\""
 example.com     text = "google-site-verification=qwertzuiop123456789"
</code> <br>
Note that in this example response, there are two answers that are interesting here: the <code>SPF</code> record and the <code>mailconf</code> record. The <code>SPF</code> record lets other servers know who is allowed to send mail from <code>example.com</code> (unless you're using a huge server, it should be identical to that above). The <code>mailconf</code> record can redirect where Thunderbird clients look for their autoconfiguration file and is optional.</p>

<p>The <code>google-site-verification</code> record is not relevant for email: it is an entry a Google user adds to verify to Google that they own the site (look up Google WebMaster Tools).</p>

<p>Finally, SRV records do not propagate, so one must always specify the host itself as the DNS server. Here is an example looking up the IMAP / SRV record of softwareschmiede-herndon.de:<code> <br>
 $ nslookup -query=SRV _imap.<em>tcp.softwareschmiede-herndon.de softwareschmiede-herndon.de
 Server:  softwareschmied-herndon.de
 Address:  5.35.246.86
 &nbsp;
 _imap.</em>tcp.softwareschmiede-herndon.de  SRV service location:
          priority       = 0
          weight         = 10
          port           = 143
          svr hostname   = softwareschmiede-herndon.de
 softwareschmiede-herndon.de     nameserver =  ns2.hans.hosteurope.de
 softwareschmiede-herndon.de     nameserver = lvps5-35-246-86.dedicated.hosteurope.de
 softwareschmiede-herndon.de     internet address = 5.35.246.86
lvps5-35-246-86.dedicated.hosteurope.de internet address = 5.35.246.86 <br>
</code></p>

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2017/03/dig.png" alt="Men at work sign, with a man digging"></div>

<h5 id="dig">dig</h5>

<p><code>dig</code> is the same basic functionality as <code>nslookup</code>, with some minor differences:</p>

<ul>
<li><code>dig</code> uses the OS's resolver libraries, <code>nslookup</code> uses its own internal libraries</li>
<li><code>nslookup</code> was deprecated for a time in favor of <code>dig</code> - it is no longer deprecated.</li>
<li><code>dig</code> will automatically use the host itself as DNS server when looking up SRV records.</li>
<li><code>dig</code> output is generally easier to parse and manipulate if you are writing a script.</li>
<li><code>dig</code> is not installed by default under Windows - if you need it instead of <code>nslookup</code>, you should probably install Cygwin and use it there.</li>
</ul>

<p>Some examples:<code> <br>
 $ <b>dig MX example.com</b>
 $ <b>dig TXT example.com</b>
 $ <b>dig SRV _imap._tcp.example.com</b>
</code></p>

<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2017/02/jetsons-reverse-small.gif" alt="Cartoon GIF of a man setting a briefcase down, it unfolding to a flying car, him hopping in and flying away"></div>

<h3 id="autoconfiguration">Autoconfiguration</h3>

<p>If Thunderbird or Outlook fails to configure correctly for your server, then the simplest test is to retrieve the XML document from your server. Open your browser and enter the URL in the address bar. Some browsers don't present XML well, especially the MS autodiscovery XML - you can then press Ctrl-U to examine the source.</p>

<p>My own server as an example for Thunderbird: <br>
<a href="http://softwareschmiede-herndon.de/mail/config-v1.1.xml">http://softwareschmiede-herndon.de/mail/config-v1.1.xml</a></p>

<p>My own server as an example for Outlook: <br>
<a href="http://www.softwareschmiede-herndon.de/autodiscover/autodiscover.xml?<EMailAddress>wdh@softwareschmiede-herndon.de</EMailAddress>">www.softwareschmiede-herndon.de/autodiscover/autodiscover.xml?&lt;EMailAddress&gt;wdh@softwareschmiede-herndon.de&lt;/EMailAddress&gt;</a></p>

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/thunderbird-logo.png" alt="Thunderbird logo"></div>

<h3 id="forprogrammers">For Programmers</h3>

<p>It is quite possible to download and compile Thunderbird or other Open Source clients to see what is happening under the hood client-side. In fact, I did so to debug problems I was having with Thunderbird autoconfiguration. If you have programming experience, you may want to do likewise to debug client problems.</p>

<p>Some quick notes for people who want to debug in Thunderbird:</p>

<ul>
<li><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Simple_Thunderbird_build">Here are quick instructions on how to build Thunderbird</a></li>
<li>At least for autoconfiguration, the real action occurs in JavaScript. If you've installed as recommended, you'll find the files at: <code>~/src/comm-central/mailnews/base/prefs/content</code></li>
<li>I did not find the log file for debug output, I ended up just adding additional information to the exception, which you see in the output when Thunderbird is started from a shell. I recommend redirecting stderr/stdout to a log file of your choice.</li>
</ul>

<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2017/03/detective.jpeg" alt="The author looking through a magnifying glass"></div>

<h3 id="inclosing">In Closing</h3>

<p>The aim of this post has been to provide you with the tools you need to find whatever is causing your email server problems. I hope it has succeeded.</p>

<p>The final blog post is done! Hooray! What I thought would be a single longish blog post has ended up being six longish blog posts spread out over months. I hope it has been helpful to you.</p>

<p>If you have corrections, updates, or suggestions for improvements, please <a href="mailto:wdh@softwareschmiede-herndon.de">contact me</a>!</p>

<p>Thank you for reading!</p>

<p>Copyright © 2017 William David Herndon. All rights reserved.</p>

<p>This series:</p>

<ul>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-1/">Part 1: The Pieces of the Puzzle</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-2/">Part 2: Subdomains and DNS</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-3/">Part 3: Encryption and SSL Certificates</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-4/">Part 4: The Email Server(s)</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-5/">Part 5: Autoconfiguration</a></li>
<li><strong>Part 6: Debugging Email Problems</strong> &lt;- You are here</li>
</ul>]]></content:encoded></item><item><title><![CDATA[Serving Email Part 5: Autoconfiguration]]></title><description><![CDATA[<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2017/02/jetsons-reverse-small.gif" alt="Cartoon GIF of a man setting a briefcase down, it folding out to a flying car, him hopping in and flying away"></div>

<p>This is part five of a six part series. In this part we will cover setting up <strong>Autoconfiguration</strong> for Email Clients.</p>

<p>This series:</p>

<ul>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-1/">Part 1: The Pieces of the Puzzle</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-2/">Part 2: Subdomains and DNS</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-3/">Part 3: Encryption and SSL Certificates</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-4/">Part 4: The Email Server(s)</a></li>
<li><strong>Part 5: Autoconfiguration</strong></li></ul>]]></description><link>https://blog.softwareschmiede-herndon.de/serving-email-part-5/</link><guid isPermaLink="false">2bc11ab7-a2fb-4229-9f0f-851ed07369fe</guid><dc:creator><![CDATA[William David Herndon]]></dc:creator><pubDate>Wed, 22 Feb 2017 13:23:00 GMT</pubDate><content:encoded><![CDATA[<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2017/02/jetsons-reverse-small.gif" alt="Cartoon GIF of a man setting a briefcase down, it folding out to a flying car, him hopping in and flying away"></div>

<p>This is part five of a six part series. In this part we will cover setting up <strong>Autoconfiguration</strong> for Email Clients.</p>

<p>This series:</p>

<ul>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-1/">Part 1: The Pieces of the Puzzle</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-2/">Part 2: Subdomains and DNS</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-3/">Part 3: Encryption and SSL Certificates</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-4/">Part 4: The Email Server(s)</a></li>
<li><strong>Part 5: Autoconfiguration</strong> &lt;- You are here</li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-6/">Part 6: Debugging Email Servers</a></li>
</ul>

<p>This post in the series will cover <strong>Autoconfiguration</strong>: setting things up so that clients can automatically get the right server settings, bothering the user as little as possible. Preferably they should only need to give the Email Client their email address and password, and it should just work.</p>

<p>There are two major clients that support autoconfiguration: Microsoft Outlook (Microsoft calls it "autodiscovery") and Mozilla Thunderbird. The Apple iPhone does not support autoconfiguration, but it does support importing what they call a "configuration profile". I will be covering all three of these and some other issues surrounding configuration of other clients.</p>

<p>Practically this means that you, as an operator of an Email Server, will want to implement everything you can to minimize user support requests, unless by some lucky chance you're users are limited to some subset of the email clients.</p>

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/thunderbird-logo.png" alt="Thunderbird logo"></div>  

<h3 id="mozillathunderbird">Mozilla Thunderbird</h3>

<h3 id="autoconfiguration">Autoconfiguration</h3>

<h5 id="quickstart">Quick Start</h5>

<ul>
<li>Right-click and <a href="http://softwareschmiede-herndon.de/.well-known/autoconfig/mail/config-v1.1.xml" download="config-v1.1.xml">download this XML-file</a></li>
<li>Modify it to fit your server settings, deleting sections that don't apply.</li>
<li>Then, if you can, upload it to your server at this location:</li>
</ul>

<p><code>&lt;base-domain&gt;/.well-known/autoconfig/mail/config-v1.1.xml</code></p>

<p>If your website redirects using ProxyPass / ProxyPassReverse, you can set it up to not redirect that one directory. An example from the Apache settings for this blog: <br>
<code>
     RewriteEngine On
     ProxyPass /.well-known !
     ProxyPass / http://localhost:2368/
     ProxyPassReverse / http://localhost:2368/
</code></p>

<p><code>.well-known</code> is a sub-directory that is also used for other files that are not directly connected with website content. For instance for verifying site ownership.</p>

<p>Alternatively, if it is not possible to make the file available at directory <code>.well-known</code>, but you can create a new subdomain, then create the subdomain autoconfig.&lt;base-domain&gt;, and place the configuration file at:</p>

<p><code>autoconfig.&lt;base-domain&gt;/mail/config-v1.1.xml</code></p>

<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2017/02/short-explanation.jpeg" alt="Kid President at a chalkboard"></div>

<h5 id="shortexplanation">Short Explanation</h5>

<p>Thunderbird will check the MX record in DNS of the host part of the email address (user@<strong>myhost.com</strong>). If it finds none, it will use the host part of the email address instead. Then it will try to download the file first from autoconfig.&lt;base-address&gt;/..., then from &lt;base-address&gt;.well-known/... location. I suggest the other way around, because a simple upload is usually easier than creating a new subdomain.</p>

<p>The XML configuration file then has all the information needed to configure the client: the servers, the protocols, the ports and some of the security options (other security options are negotiated at connection).</p>

<h5 id="originaldocumentation">Original Documentation</h5>

<ul>
<li><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Thunderbird/Autoconfiguration">Here is the original documentation from Mozilla</a></li>
<li><a href="https://wiki.mozilla.org/Thunderbird:Autoconfiguration:ConfigFileFormat">Here is a direct link to a description of the file format</a></li>
</ul>

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/outlook-logo.jpg" alt="Microsoft Outlook logo"></div>

<h3 id="microsoftoutlook">Microsoft Outlook</h3>

<h3 id="autodiscovery">Autodiscovery</h3>

<h5 id="quickstartbutprobablyincomplete">Quick Start: but probably incomplete</h5>

<ul>
<li>Right-click and <a href="http://softwareschmiede-herndon.de/autodiscover/autodiscover.xml" type="application/xml" download="autodiscover.xml">download this XML-file</a></li>
<li>Delete the &lt;LoginName&gt; sections.</li>
<li>Modify it to fit your server settings</li>
<li>Then upload it to this location:</li>
</ul>

<p><code>&lt;base-domain&gt;/autodiscover/autodiscover.xml</code></p>

<p>Why it is probably incomplete: when the &lt;LoginName&gt; section is missing, Outlook will assume the login name is the username part of the email address without the domain-name (<strong>user</strong>@mydomain.com). Most modern Email Servers support multiple domains, and consequently require the full email address, with domain, for login.</p>

<p>The Thunderbird autoconfiguration handles this simply: <code>%EMAILADDRESS%</code> substitutes for the full email address. Microsoft Outlook, instead, passes the email address as a parameter, unavailable to non-executing files. If you want to get a complete fix, press on.</p>

<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2017/02/runwalk.gif" alt="a walk-run marathon"></div>  

<h5 id="notsoquickstart">Not so Quick Start</h5>

<p>In order to retrieve the email address, you need to execute code when Outlook retrieves the autodiscover.xml. If your website supports PHP, you may copy my solution and adjust as needed. If you have something other than PHP, then you will need to write your own code. My solution:</p>

<ul>
<li><a href="https://softwareschmiede-herndon.de/autodiscover.txt" download="autodiscover.php">Download this file</a></li>
<li>Rename extension from .txt to .php</li>
<li>Adjust the fields as needed for your email server.</li>
<li>Upload it to the autodiscover directory</li>
<li>Adjust your Apache configuration to retrieve autodiscover.php when autodiscover.xml is requested:
<code>
 RewriteEngine On
 RewriteRule autodiscover/autodiscover.xml /autodiscover/autodiscover.php
</code></li>
</ul>

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2017/02/peter-dinklage-explains.jpeg" alt="Peter Dinklage at a podium"></div>  

<h5 id="shortexplanation">Short Explanation</h5>

<p>When Outlook retrieves <code>autodiscover.xml</code>, it passes the emailaddress and other parameters in the POST data in XML format. POST data may be passed in one of two forms: one is  in the address following a "?" - you can simply enter this in the browser - the other is embedded in the POST-exchange - the one that Outlook uses. The PHP I wrote checks both, so that I can test the results using a browser:</p>

<p><a href="http://www.softwareschmiede-herndon.de/autodiscover/autodiscover.xml?%3CEMailAddress%3Etest@example.com%3C/EMailAddress%3E">http://www.softwareschmiede-herndon.de/autodiscover/autodiscover.xml?&lt;EMailAddress&gt;test@example.com&lt;/EMailAddress&gt;</a></p>

<h5 id="originaldocumentation">Original Documentation</h5>

<ul>
<li><a href="https://technet.microsoft.com/en-us/library/cc511507.aspx">Here is the original autodiscovery documentation from TechNet</a></li>
</ul>

<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/apple-iphone-logo.png" alt="Apple iPhone logo"></div>  

<h3 id="appleiphoneipadios">Apple iPhone/iPad/iOS</h3>

<h3 id="configurationprofile">Configuration Profile</h3>

<p>Unless you have an Email Server large enough that Apple includes you in their database, there is no autoconfiguration for you. You have two options: your users enter all the server info by hand, or you give your user a "Configuration Profile", that makes the entries for them.</p>

<p>I've developed a PHP program that will generate a configuration profile and, when a user clicks download on their iPhone, it will start installing.</p>

<p><a href="http://softwareschmiede-herndon.de/email-en.html">You can see the program in action here.</a></p>

<p><a href="http://softwareschmiede-herndon.de/mobileconfig.txt">You can download the source here.</a> It has the .txt extension so it is not interpreted, you will need to rename it to use it. Note that it is expecting two parameters, <code>emailname</code> and <code>emailaddress</code>. You can modify the program as needed for your website and direct your users to a webpage where they can use it.</p>

<h5 id="originaldocumentation">Original Documentation</h5>

<ul>
<li><a href="https://developer.apple.com/library/content/featuredarticles/iPhoneConfigurationProfileRef/">Here is the original Configuration Profile Reference from Apple</a> (search for "Email Payload")</li>
</ul>

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/k-9-mail-logo.png" alt="K-9 Mail logo"></div>  

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/maildroid-logo.png" alt="Maildroid logo"></div>  

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/bluemail-logo.png" alt="bluemail logo"></div>  

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/ClawsMailLogo.png" alt="ClawsMail logo"></div>  

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/the-bat-logo.png" alt="TheBat Mail logo"></div>  

<h3 id="otheremailclients">Other Email Clients</h3>

<p>I tested out other clients using an account at dojo-wehrda.de, which has an MX entry to softwareschmiede-herndon.de and a correct Thunderbird config file in .well-known, and a correctly functioning autodiscovery.xml.</p>

<p>So far <strong><em>none</em></strong> have done correct autoconfiguration, despite the standards for DNS SRV entries and the autoconfiguration info presented here. If you have an Email Client that you're fond of, and they don't support autoconfiguration for smaller servers, please inform them about it.</p>

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/k-9-mail-logo.png" alt="K-9 Mail logo"></div>  

<p>I started out this series by showing screenshots of <strong>K-9 Mail</strong> and how it should work. Since I use K-9 for multiple email addresses, and some of them automatically configured, I thought they must have some form of autoconfiguration I could use. I was wrong: they have a database of all the major providers and how they should be configured. For smaller Email Servers like mine it will simply throw you into advanced configuration. It is an Open Source project: I intend to talk to them about this and get it fixed or fix it myself.</p>

<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/maildroid-logo.png" alt="MailDroid logo"></div>  

<p>Next I tried <strong>MailDroid</strong>, a commercial Android App, with a free ad-based version. It simply said it could not locate the server. And threw me into the incoming/outgoing server dialog. Oh, well.</p>

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/bluemail-logo.png" alt="bluemail logo"></div>  

<p><strong>BlueMail</strong>, another commercial Android App with a free version, seemed to work - it didn't complain about anything, and even showed an email from itself congratulating me on my choice. After waiting several minutes for an update that never came, I went to the advanced settings, where I discovered that it had ignored the DNS and the autoconfiguration files and was trying to synchronize via webmail.dojo-wehrda.de. Fail.</p>

<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/ClawsMailLogo.png" alt="Claws-Mail logo"></div>  

<p><strong>Claws-Mail</strong>, the Linux-based Email client, fared a little bit better: at first it tried to setup a POP3 account on my local machine, despite my email address. However when I changed the setting to IMAP and pressed [Auto-configure], it correctly found softwareschmiede-herndon.de and its settings. It then proceeded to SMTP, and again had the local machine set as server, without an [Auto-configure] button - to correctly configure outgoing, I would have to enter everything by hand.</p>

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/the-bat-logo.png" alt="TheBat Mail logo"></div>  

<p>The hardest fail was <strong>TheBat</strong>, a very old Windows-based client - I used it for a number of years with Windows 95. It is a favorite of old programmers. Despite the version being from this year, it failed hard: it did not find softwareschmiede-herndon.de. Clicking the [Testen!] button on the IMAP page with the defaults did not react - no success or error message - it should have told me that the certificate presented was for the wrong server (the certificate is for softwareschmiede-herndon.de, of course). Proceeding to the SMTP page, clicking on [Testen!] caused the dialog to freeze up, so that I ended up using the task manager to kill the process. I used TheBat 32-bit version on Windows 7 Professional, 32-Bit version.</p>

<h3 id="notes">Notes</h3>

<div style="float:right;margin-left:0.5em;"><a href="https://xkcd.com/340/"><img src="https://imgs.xkcd.com/comics/fight.png" alt="XKCD: We had a fight last night. I guess she's still mad. I woke up to find she'd written a sappy love note. To my boot sector. Operating System not found."></a></div> 

<h5 id="regardingdnsandclients">Regarding DNS and Clients</h5>

<p>If you've been following along, you'll know the importance of DNS records regarding Email Server configuration - post #2 was mostly about DNS. Funny thing: a lot of clients cannot access DNS at all, either because of limitations on their platform, or due to being blocked by a firewall. Mozilla Thunderbird skirts the problem by using an MX-lookup server available via HTTP(S).</p>

<h3 id="inclosing">In Closing</h3>

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2017/02/debugging.png" alt="red circle and slash over a bug"></div>  

<p>If you've been implementing as you follow along, you <em>should</em> have a functioning server that is easy for users to configure their client software for. If you don't, you'll be happy to know that I've decided to extend this series by yet one more post: Debugging Email Servers.</p>

<p>Thank you for reading my blog post!</p>

<p>Copyright © 2017 William David Herndon. All rights reserved.</p>

<p>This series:</p>

<ul>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-1/">Part 1: The Pieces of the Puzzle</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-2/">Part 2: Subdomains and DNS</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-3/">Part 3: Encryption and SSL Certificates</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-4/">Part 4: The Email Server(s)</a></li>
<li><strong>Part 5: Autoconfiguration</strong> &lt;- You are here</li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-6/">Part 6: Debugging Email Servers</a></li>
</ul>]]></content:encoded></item><item><title><![CDATA[Serving Email Part 4: The Email Server(s)]]></title><description><![CDATA[<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2017/02/email-agent.png" alt="Man in trench coat carrying email"><br><b><small><center>Message Transfer Agent</center></small></b></div>

<p>This is part four of a six part series. In this part we will cover the Email Server(s).</p>

<p>This series:</p>

<ul>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-1/">Part 1: The Pieces of the Puzzle</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-2/">Part 2: Subdomains and DNS</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-3/">Part 3: Encryption and SSL Certificates</a></li>
<li><strong>Part 4: The Email Server(s)</strong> &lt;-</li></ul>]]></description><link>https://blog.softwareschmiede-herndon.de/serving-email-part-4/</link><guid isPermaLink="false">361117c8-e32d-4b7e-bea9-e02e9d26a56d</guid><dc:creator><![CDATA[William David Herndon]]></dc:creator><pubDate>Sat, 18 Feb 2017 23:40:00 GMT</pubDate><content:encoded><![CDATA[<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2017/02/email-agent.png" alt="Man in trench coat carrying email"><br><b><small><center>Message Transfer Agent</center></small></b></div>

<p>This is part four of a six part series. In this part we will cover the Email Server(s).</p>

<p>This series:</p>

<ul>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-1/">Part 1: The Pieces of the Puzzle</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-2/">Part 2: Subdomains and DNS</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-3/">Part 3: Encryption and SSL Certificates</a></li>
<li><strong>Part 4: The Email Server(s)</strong> &lt;- You are here</li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-5/">Part 5: Autoconfiguration</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-6/">Part 6: Debugging Email Servers</a></li>
</ul>

<p>In this post: I discuss the criteria for choosing your email server(s) and then link to the <a href="https://en.wikipedia.org/wiki/Comparison_of_mail_servers">Wikipedia email server comparison table</a>, where you can find email servers that match your criteria.</p>

<p>There may be up to three different email server programs, possibly on separate servers, or they may all be combined in one software. They are:</p>

<ul>
<li>The <a href="https://en.wikipedia.org/wiki/Message_transfer_agent"><strong>Message Transfer Agent (MTA)</strong></a>, also called the Outgoing Server.</li>
<li>The Incoming Server.</li>
<li>The WebMail Server (optional)</li>
</ul>

<p>This diagram is the most complex part of the post - don't let it scare you:</p>

<div style="float:left;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2017/02/email-1.png" alt="Diagram of email data paths"></div>  

<div style="clear:both;margin-bottom:1em;"></div>  

<p>Things to note about the diagram:</p>

<ul>
<li>I made the SMTP/IMAP/POP3 arrows unidirectional to indicate which way the emails flow, even though there is bidirectional flow of information (for example to authenticate, or to delete emails).</li>
<li>Each of the components in the Local Server can be separated out onto a different machine, despite being shown on one machine here.</li>
<li>In concept, the MTA is relatively simple: it will check an incoming email's address against its user-base and either put it in Email Storage, or look for an appropriate MTA to pass it on to. All communication is via SMTP.</li>
<li>The Email Storage is shared between the Incoming Server (MTA) and the Outgoing Server, so they must use the same format and synchronize properly, whether that storage is file(s) or a database or something else.</li>
<li>The Incoming Server never actively sends email, it waits for a client to retrieve it via IMAP and/or POP3.</li>
<li>Most WebMail Servers work just like an IMAP-based Email Client Software, except that the user accesses it through HTTP(S) and Browser Software.</li>
<li>This diagram leaves out the authentication database - user/password information. The Incoming Server and Outgoing Server should also share this information.</li>
</ul>

<p>I put the criteria roughly in the order I think of as most relevant and important, not the order they appear in the Wikipedia comparison.</p>

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2017/02/panel.jpeg" alt="Control panel of a Jumbo Jet"></div>

<h5 id="panel">Panel</h5>

<p>If you have a panel, like Plesk or cPanel, then I recommend using their defaults: their choice is usually pretty flexible and you will get better support. Personally I have Plesk on Linux and use the defaults: Postfix for outgoing, Courier for incoming, and Horde for WebMail.</p>

<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2017/02/apple-logo.jpeg" alt="Apple logo"></div>  

<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/Windows7Logo.png" alt="Windows 7 logo"></div>  

<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/tux-1.jpg" alt="Linux penguin logo"></div>

<h5 id="theoperatingsystemlinuxwindowsormacos">The Operating System: Linux, Windows, or MacOS</h5>

<p>Not much to say, really: you probably already have your operating system. Linux is free. Windows will cost. Linux has the largest market share for Email Servers. MacOS the smallest. Almost all that support MacOS support Linux, too, since they're both Unix derivatives and Linux has the larger market.</p>

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2017/02/servants.jpeg" alt="Butler, Maid, Chauffer"></div>

<h5 id="servertypes">Server Types</h5>

<div style="clear:both;margin-bottom:1em;"></div>

<ul>
<li>Outgoing Server: <a href="https://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol"><strong>SMTP</strong></a> - sends and receives Email from remote servers.</li>
<li>Incoming Server: <a href="https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol"><strong>IMAP</strong></a>, <a href="https://en.wikipedia.org/wiki/Post_Office_Protocol"><strong>POP3</strong></a> - retrieve the email on the server for a client. IMAP keeps the email on the server. POP3 deletes it from the server after retrieval - the client must store it.</li>
<li><a href="https://en.wikipedia.org/wiki/Webmail"><strong>WebMail</strong></a> - Access via a web browser.</li>
<li><a href="https://en.wikipedia.org/wiki/ActiveSync"><strong>ActiveSync</strong></a> - this is a Microsoft protocol for synchronizing emails, contacts, calendars, tasks and notes. Supporting these is beyond the scope of this series, but may be something you want to consider.</li>
</ul>

<p>WebMail is the simplest to separate out: there are specialized WebMail server programs that do nothing else and only need IMAP and SMTP access to work. I would not make it a criteria that WebMail be integrated with my other servers. Note also that the Wikipedia comparison list excludes WebMail only servers.</p>

<p>Your incoming and outgoing server can be independent, but if they are, you will still need them to access common storage and want them to access a common set of usernames/passwords, so in that case, pay attention to the storage and the authentication storage options: filesystem, database, LDAP, other.</p>

<p>Earlier people used to always retrieve their email and delete it from the server - space on the server was expensive and you had one computer. That is the POP3 model. Nowadays, server space is cheap and people want to read their email on their mobile, their tablet and their laptop, so the email needs to be on the server to be accessible. This is the IMAP model. For general customers I recommend supporting both - there are some old-school folk still around. If you have to drop one, drop POP3. Separate IMAP and POP3 servers are not practical.</p>

<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/ssl-logo.png" alt="green lock and https:// from address bar"></div>

<h5 id="secureconnection">Secure Connection</h5>

<p>Unless you're doing an in-house mail system in a local network, secure connections are an absolute must, both for outgoing and incoming. The <strong>SSL</strong> feature is straightforward: it means the supported protocols appear on their alternate SSL ports, often signified by appending an "S" to the protocol name (SMTPS on port 587, IMAPS on port 993, POP3S on port 995). The <a href="https://en.wikipedia.org/wiki/Opportunistic_TLS">"Opportunistic TLS"</a> options (also called STARTTLS), <strong>SMTP over TLS</strong> and <strong>POP over TLS</strong> mean that a plain text connection is made over the old lower port number, and then the connection is upgraded to a secure connection. Some people prefer the former, so that no meta-data can be caught by eavesdroppers. Some prefer the latter, so that fewer ports are used. Most servers I've seen support both, letting the client decide.</p>

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2017/02/key-in-lock.png" alt="Internal workings of a physical lock and key"></div>

<h5 id="authentication">Authentication</h5>

<p>Authentication means asking for username/password, and is an absolute must. Whether or not encrypted passwords are supported doesn't seem to be in the Wikipedia comparison, probably because with an encrypted connection, password encryption is now unimportant.</p>

<p><strong>SMTP Auth</strong>entication is in the list: there are servers that allow <em>sending</em> of emails without asking for a username and password at all, even though that is very likely to get your server blacklisted these days.</p>

<p>If you're using separate ingoing and outgoing servers, be sure they can use the same authentication database (<strong>Filesystem/Database/LDAP</strong>).</p>

<p>I would ignore "<strong>POP before SMTP</strong>" - it is almost never used anymore. I would also ignore <strong>APOP</strong>, a specialized form of encrypted authentication for POP3 that is not relevant for most with the rise of MAPI.</p>

<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2017/02/storage.jpeg" alt="Boxes in a warehouse"></div>

<h5 id="storagedatabasefilesystemother">Storage: Database, File System, Other</h5>

<p>The storage system for incoming and outgoing must be compatible. A given if you're only using one program for both, but needs to be checked if you're splitting it up.</p>

<p>This may also be relevant to your backup system or to your personal preferences: some old school programmers may like to see actual files they can edit with a text editor; a database specialist might like to be able to mangle things with SQL.</p>

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2017/02/robert-plant.jpeg" alt="Rock group of grannies"></div>

<h5 id="matureactivedevelopment">Mature / Active Development</h5>

<p>New software tends to be buggy, so mature is good. It's not on the comparison list, so I would google the software that makes it to the final rounds. I would only go "bleeding edge" with email that I don't care about.</p>

<p>I think that <strong>IPv6</strong> support is a good indicator of how actively the project is being developed. Support of IPv6 is usually not important yet, but it will be, and so a software that does support it is forward looking. I would, again, google to verify in the final rounds.</p>

<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2017/02/antispam.png" alt="Red circle and slash over the word SPAM"></div>

<h5 id="antispamfeatures">Antispam Features</h5>

<p>I could do a whole series on antispam features. That said, for small operations I don't think they're a killer criterion - I receive spam, my email <em>client</em> mostly sorts it into the spam bin. It's not been a problem for me so far. If you're customers are not tech-savvy, you may want one with integrated antivirus.</p>

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2017/02/junk-drawer.jpeg" alt="Junk drawer"></div>

<h5 id="othercriteria">Other Criteria</h5>

<div style="clear:both;margin-bottom:1em;"></div>

<ul>
<li><strong>IMAP - IDLE</strong> - real time update to email clients, without continually refreshing. Maybe relevant if you have client software that supports this and people want it.</li>
<li><strong>NNTP</strong> - Network News Protocol - for news readers. I've never actually used this, but if you do, go for it.</li>
<li><strong>Sieve</strong> is a filtering language. Examples of use: auto-rejecting too large emails, pre-sorting spam, pre-sorting of email into other groups. I think this has lost a lot of importance, especially with the other antispam options.</li>
<li>Upgrade Path - there are tools that can do IMAP backup and restore, so I wouldn't worry about that too much. If you're doing ActiveSync/WebDAV, that's a different can of worms.</li>
</ul>

<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2017/02/bodytypes.jpeg" alt="ectomorph, mesomorph, endomorph"></div>

<h5 id="comparetheservers">Compare the Servers</h5>

<p>Click here: <strong><a href="https://en.wikipedia.org/wiki/Comparison_of_mail_servers">The Wikipedia Comparison of Mail Servers</a></strong></p>

<p>Take your time and compare.</p>

<p>Most of them are free, so if you're having trouble deciding, you can do a temporary install to test it out.</p>

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2017/02/installation.jpeg" alt="man installing a permanent powered home device"></div>

<h5 id="installation">Installation</h5>

<div style="clear:both;margin-bottom:1em;"></div>

<ul>
<li>If you're running one of the panels, then it's probably already installed, and you only need to activate it. Your panel will have documentation.</li>
<li>If you're under Linux, many of these are available in the distribution channel - e.g. my synaptic package manager lists these packages from the comparison list: Citadel, Courier, Cyrus, Dovecot, Exim, OpenSMTPD, Postfix, qmail, sendmail.</li>
<li>For other everything else: find their website and follow their instructions.</li>
</ul>

<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/certificate.jpg" alt="Paper SSL Certificate with seal"></div>

<h5 id="donotforgetthesslcertificate">Do not forget the SSL Certificate!</h5>

<p>Your package will generally have instructions on how to set the certificate to be used. Just don't forget it, otherwise your users will get nasty messages and may not be able to use your server at all.</p>

<p>Special note for Plesk users: Plesk will automatically use the default certificate for the email server. Plesk has documentation on how to bypass this if you need to.</p>

<h3 id="inclosing">In Closing</h3>

<p>We're almost there! You should have a working email server now. All that's left is to set it up so that email clients can find the proper settings more easily - which is a <em>lot</em> more complicated than it should be, in my opinion.</p>

<p>Thank you for reading my blog post!</p>

<p>Copyright © 2017 William David Herndon. All rights reserved.</p>

<p>This series:</p>

<ul>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-1/">Part 1: The Pieces of the Puzzle</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-2/">Part 2: Subdomains and DNS</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-3/">Part 3: Encryption and SSL Certificates</a></li>
<li><strong>Part 4: The Email Server(s)</strong> &lt;- You are here</li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-5/">Part 5: Autoconfiguration</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-6/">Part 6: Debugging Email Servers</a></li>
</ul>]]></content:encoded></item><item><title><![CDATA[Serving Email Part 3: Encryption and SSL Certificates]]></title><description><![CDATA[<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/certificate.jpg" alt="Paper SSL certificate with seal"></div>

<p>This is part three of a six part series on setting up an email server and covers encryption and SSL Certificates<a href="https://blog.softwareschmiede-herndon.de/serving-email-part-3/#sslcert">*</a>. This post is also useful for someone who just wants https support for their website.</p>

<p>This series:</p>

<ul>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-1/">Part 1: The Pieces of the Puzzle</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-2/">Part 2: Subdomains and DNS</a></li></ul>]]></description><link>https://blog.softwareschmiede-herndon.de/serving-email-part-3/</link><guid isPermaLink="false">16893be0-c6a6-4b4b-95cf-a95d0eb529fb</guid><dc:creator><![CDATA[William David Herndon]]></dc:creator><pubDate>Sun, 25 Dec 2016 04:17:32 GMT</pubDate><content:encoded><![CDATA[<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/certificate.jpg" alt="Paper SSL certificate with seal"></div>

<p>This is part three of a six part series on setting up an email server and covers encryption and SSL Certificates<a href="https://blog.softwareschmiede-herndon.de/serving-email-part-3/#sslcert">*</a>. This post is also useful for someone who just wants https support for their website.</p>

<p>This series:</p>

<ul>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-1/">Part 1: The Pieces of the Puzzle</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-2/">Part 2: Subdomains and DNS</a></li>
<li><strong>Part 3: Encryption and SSL Certificates</strong> &lt;- You are here</li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-4/">Part 4: The Email Server(s)</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-5/">Part 5: Autoconfiguration</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-6/">Part 6: Debugging Email Servers</a></li>
</ul>

<p><small><a id="sslcert">*</a> Technically a TLS Certificate, a type of <a href="https://en.wikipedia.org/wiki/Public_key_certificate">Public Key Certificate</a>, but it is still normally referred to by the old name, "SSL Certificate".</small></p>

<div style="float:left;margin-right:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2017/02/certificate-question.jpeg" alt="Paper SSL certificate with question mark"></div>

<h3 id="whattheheckisansslcertificate">What the Heck is an SSL Certificate?</h3>

<p>An <a href="https://en.wikipedia.org/wiki/Public_key_certificate">SSL certificate</a> is used to verify that your browser, email program, or other program is communicating securely with the address in the certificate. It does this by combining the address, a <a href="https://en.wikipedia.org/wiki/Public-key_cryptography">public key</a> and a little bit of other info, then having a trusted entity <a href="https://en.wikipedia.org/wiki/Digital_signature">digitally sign</a> that combination.</p>

<p>Your web-browser, email program or other program has a list of self-signed "root certificates" that it trusts. If a certificate from a website is signed by one of these, then it will trust that certificate. Not only that, it will also trust any chain (certificate signed by certificate signed by ... signed by root certificate) that end in a trusted root certificate. An important proviso, is that any parent certificates needs to be a <a href="https://en.wikipedia.org/wiki/Certificate_authority">certificate authority</a> certificate - thus you can't sign someone else's certificate, just because you have a website certificate. There are other important provisos, but that's the basics.</p>

<h5 id="validation">Validation</h5>

<p>Certificate Authorities are required to verify that the certificates they sign are who they purport to be. There are three levels of validation: domain validation, organizational validation, and extended validation.</p>

<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/approved.png" alt="APPROVED stamp mark"></div>

<h6 id="domainvalidation">Domain Validation</h6>

<p>This lowest level of validation simply verifies that you have control of the site. There are 3 ways this is usually done:</p>

<ul>
<li>Respond to an email to the registered webmaster or postmaster of the site</li>
<li>Place a file in a specific location on the site</li>
<li>Make a DNS record (see <a href="https://blog.softwareschmiede-herndon.de/serving-email-part-2/">previous post in this series</a>)</li>
</ul>

<p>You may need to do these in combination: e.g. place a file sent to the webmaster on your website, or make a DNS record specified in an email to the postmaster.</p>

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/seal_of_approval.jpeg" alt="SEAL OF APPROVAL, with a circus seal animal"></div>

<h6 id="organizationvalidationorbusinessvalidation">Organization Validation (or Business Validation)</h6>

<p>Certificates with organizational validation fill in the "organization" field in the certificate. They usually cost significantly more than just domain validation certificates.</p>

<p>Proving that you are the organizational or business entity that you say you are usually involves sending copies of your letter of incorporation, organizational charter or other business documents and may take days for the review.</p>

<h6 id="extendedvalidation">Extended Validation</h6>

<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/ev-shield.png" alt="3D EV Shield logo"></div>

<p>Then there's <a href="https://en.wikipedia.org/wiki/Extended_Validation_Certificate">"Extended Validation" (EV)</a> that will turn the address bar or text green and may place the organization's name in the address bar. In this case, the business validation is more extensive and should ensure the customer that your business entity is "above board". Note that wildcard certificates are not possible with EV. EV certificates are very expensive.</p>

<p>I find it telling, that neither <a href="https://www.amazon.com/">Amazon</a>, nor <a href="http://www.ebay.com/">ebay</a> have adopted EV, though <a href="https://www.paypal.com/">PayPal</a> has.</p>

<h3 id="whatcertificateswillyouneed">What Certificate(s) will you need?</h3>

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/ssl-logo.png" alt="green lock and https:// from address bar"></div>

<p>You can and should use the same certificate(s) for https and for your MTA (Mail Transfer Agent). You will need certificate support for each subdomain the MTA is using, whether that is the single domain solution (<strong>example.com</strong>), the single extra subdomain solution (<strong>mail.example.com</strong>), or a multi-subdomain solution (<strong>imap.example.com</strong>, <strong>pop3.example.com</strong>, <strong>smtp.example.com</strong>).</p>

<p><strong><em>Note that because of inherent limitations in the mail protocols, your MTA has only one domain per protocol / IP-Address.</em></strong> This means only one SSL Certificate per protocol / IP-Address. This does not mean that it cannot handle emails from all your domains: it merely requires that the domain be explicit in the email username. For instance: if you have the domains <strong>example.com</strong> and <strong>example2.com</strong> on the same server / IP address, the email client setup for <strong>me@example2.com</strong> might set the server to <strong>mail.example.com</strong> and the user for login to <strong>me@example2.com</strong>. One could not set the user to just <strong>me</strong>, because it would not be able to differentiate between <strong>me@example.com</strong> and <strong>me@example2.com</strong>.</p>

<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/wildcard.png" alt="Wild card from UNO card game"></div>

<p>A wildcard certificate should work, be careful however: I ran into a hitch with a wildcard certificate I bought: "*.softwareschmiede-herndon.de" is not a valid certificate for "softwareschmiede-herndon.de" (it's missing the ".") - this was not an email specific problem. This can be solved by either always redirecting to "www." or by getting a certificate that explicitly covers the main domain as well.</p>

<p>You will not <em>need</em> certificates for autoconfiguration (<strong>autoconfig.example.com</strong>, <strong>autodiscover.example.com</strong>), though they don't hurt either.</p>

<p>If you already have the certificate(s) you need and they are installed for https, then you should continue with Part 4 when that is posted.</p>

<p>If you have certificate(s), but they are not installed for https, you can <a href="https://blog.softwareschmiede-herndon.de/serving-email-part-3/#certinstall">skip to installation</a>.</p>

<h3 id="obtainingcertificates">Obtaining Certificates</h3>

<p>If you don't have the certificate(s) you need yet, there are the following options:</p>

<ul>
<li>Self-signed certificates.</li>
<li>Obtain from Let's Encrypt. These are free, but only good for three months at a time.</li>
<li>Obtain from your webhoster: this is often the easiest (sometimes Let's Encrypt is actually easier).</li>
<li>Obtain from a third party.</li>
</ul>

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/escher-hands.jpeg" alt="Escher work 'Drawing Hands' - two hands each drawing the other"></div>

<h5 id="selfsignedcertificates">Self-signed Certificates</h5>

<p>One can generate a certificate for oneself and there are several guides in the internet to generating them. I tried it, and I no longer consider this an option: your users will get nasty warnings when they visit your website or try to use your mail server. On some clients, I found no in-program way to circumvent the lack of trust, meaning that the user has to figure out how to install a trusted certificate on their platform.</p>

<p>If you choose this option, you are on your own.</p>

<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/letsencrypt.png" alt="Let's Encrypt! logo"></div>

<h5 id="letsencrypt">Let's Encrypt!</h5>

<p><a href="https://letsencrypt.org/">Let's Encrypt (letsencrypt.org)</a> is a "free, open, and automated Certificate Authority." These certificates only have domain validation and are only good for three months, but they are <em>free</em>.</p>

<p>How that works in specifics is different based on which panel you're using or if you're using a panel at all.</p>

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/unobtainium.jpeg" alt="Element 121, Ub, Unobtainium"></div>

<h6 id="verificationdifficulties">Verification Difficulties</h6>

<p>If your Let's Encrypt verification does not work, then you probably have some sort of redirect going on, such that the verification files placed on the website are not found. For instance this blog uses ProxyPass to serve from ghost blogging software, which is on port 2368. Let's Encrypt! uses the subdirectory ".well-known" (which is also used for other purposes), so I added "ProxyPass /.well-known !" to my "Apache &amp; Nginx Settings" in Plesk which now looks like this:</p>

<p><strong>HTTP:</strong></p>

<pre><code>RewriteEngine On
ProxyPass /.well-known !
ProxyPass / http://localhost:2368/
ProxyPassReverse / http://localhost:2368/
</code></pre>

<p><strong>HTTPS:</strong></p>

<pre><code>RewriteEngine On
ProxyPass /.well-known !
ProxyPass / http://localhost:2368/
ProxyPassReverse / http://localhost:2368/
RequestHeader set X-Forwarded-Proto "https"
</code></pre>

<p>If you are using a different panel or a different webserver, you will need to adjust according to that software.</p>

<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/plesk.jpeg" alt="Plesk logo"></div>

<h6 id="pleskletsencryptplugin">Plesk Let's Encrypt! Plugin</h6>

<p><a href="https://ext.plesk.com/packages/f6847e61-33a7-4104-8dc9-d26a0183a8dd-letsencrypt">Here is the Plesk extension for Let's Encrypt!</a>. It is free. Login to Plesk, click on "Extensions", click the button "Add Extension" and upload the extension. Then start the extension by clicking on it. You will see a list of your domains. For most domains, simply click on the domain to install a "Let's Encrypt!" certificate.</p>

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/cpanel.png" alt="cPanel logo"></div>

<h6 id="cpanelletsencryptplugin">cPanel Let's Encrypt! Plugin</h6>

<p>I do not currently use cPanel, but <a href="https://letsencrypt-for-cpanel.com/">here is the cPanel plugin</a>. It is probably worth the $30: doing a hand verification yourself every couple months will get old real quick.</p>

<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/diy.png" alt="DIY made of wood"></div>

<h6 id="doityourselfletsencryptcertificates">Do it yourself Let's Encrypt! Certificates</h6>

<p>Go to <a href="https://letsencrypt.org/getting-started/">"Getting Started" at letsencrypt.org</a> and follow the instructions. Currently, this mostly mean using <a href="https://certbot.eff.org/">certbot</a>. Certbot can be setup on the webserver (if you have command line access) to do automatic renewals. Or it can be run in manual mode if you don't have command line access.</p>

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/data-center.jpeg" alt="Computer racks from a data center"></div>

<h5 id="sslcertificatefromyourwebhoster">SSL Certificate from your Webhoster?</h5>

<p>If Let's Encrypt! is not for you - you need organizational validation, a wildcard certificate, or certificates that are valid for years - then the <em>easiest</em> route is almost certainly your webhoster: your webhoster will already have domain validation, may already have organizational validation through your business relationship with them and the process may or may not be integrated into your panel. They may also allow you to pay for the certificate monthly: be careful not to compare monthly prices to yearly prices!</p>

<p>A certificate from your webhoster will almost certainly be more expensive than from a 3rd party: the margins are thin and competition fierce in webhosting, so ISPs try to cash in on their "captive audience" once they have you. Fortunately, webhosters generally allow 3rd party certificates - they would lose many transfer customers if they didn't. So unless money is no object, I recommend shopping around.</p>

<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/3rdparty.jpeg" alt="blue speaker on left, red speaker on right, question mark in middle"></div>

<h5 id="sslcertificatefroma3rdparty">SSL Certificate from a 3rd Party</h5>

<p>If you buy from a reputable 3rd party, you will have to do the validation from scratch.</p>

<p>A note of caution: I started with a commercial certificate from <a href="https://startssl.com/">StartSSL</a>. They had the cheapest commercial plan for my purposes. Unfortunately, StartSSL was bought by WoSign, another certificate provider, without revealing this - meaning they had two votes in the <a href="https://cabforum.org/">CAB forum</a> where they should have only had one. Due to this and other irregularities, Firefox and Chrome will no longer trust their certificates starting in January 2017. I have since moved all my websites to Let's Encrypt! So, research the trustworthiness of your certificate seller.</p>

<p>Here are some popular SSL certificate sellers with their current (December, 2016) price for a single domain / year with domain validation only. This list is not exhaustive - it is only intended to give you an idea of the range and a place to start. Note also that you can usually get a cheaper cost/year by buying a three year certificate.</p>

<ul>
<li><a href="https://www.digicert.com/buy-ssl-certificates.htm">DigiCert</a> - $175</li>
<li><a href="https://www.geotrust.com/">GeoTrust</a> - $149</li>
<li><a href="https://www.globalsign.com/en/ssl/domain-ssl/">GlobalSign</a> - $179</li>
<li><a href="https://www.godaddy.com/web-security/ssl-certificate">GoDaddy</a> - $50.99</li>
<li><a href="https://www.instantssl.com/">InstantSSL</a> - $79.95</li>
<li><a href="https://www.rapidssl.com/">RapidSSL</a> - $59</li>
<li><a href="https://www.ssls.com/">SSLs.com</a> - $8.95</li>
</ul>

<p><a id="certinstall"></a></p>

<h3 id="installingcertificatesforhttps">Installing Certificates for HTTPS</h3>

<p>How you install a certificate will, once again, depend on which panel / platform you have. MTA specific installation will be covered in the next part of the series.</p>

<ul>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-3/#pleskinstall">Plesk</a> (https/mail)</li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-3/#cpanelinstall">cPanel</a> (https/mail)</li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-3/#apacheinstall">Apache</a> (https)</li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-3/#iisinstall">Windows/IIS</a> (https)</li>
</ul>

<p><a id="pleskinstall"></a></p>

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/plesk.jpeg" alt="Plesk logo"></div>

<h5 id="installingcertificatesinplesk">Installing Certificates in Plesk</h5>

<p>If you're using the Let's Encrypt! extension, congratulations! You're done for now.</p>

<p>Otherwise, <a href="https://support.plesk.com/hc/en-us/articles/213946825">as per the instructions</a>:</p>

<ul>
<li>go to the "Hosting Settings" of the domain</li>
<li>enable "SSL Support"</li>
<li>go to the "SSL Certificates" of the domain</li>
<li>select "Add SSL Certificate" (I've never gotten the "Upload certificate button here to work correctly)</li>
<li>enter a name you will remember for that certificate</li>
<li>if you received your certificate in file form (the most common case), upload the three files you need. Otherwise copy and paste what you need, then click on the appropriate "Upload Certificate" button.</li>
</ul>

<p><a id="cpanelinstall"></a></p>

<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/cpanel.png" alt="cPanel logo"></div>

<h5 id="installingcertificatesincpanel">Installing Certificates in cPanel</h5>

<p><a href="https://documentation.cpanel.net/display/ALD/Install+an+SSL+Certificate+on+a+Domain">Here is the cPanel guide to installing certificates</a>. Unlike Plesk, cPanel will let you choose which domain / certificate to use for the MTA.</p>

<p><a id="apacheinstall"></a></p>

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/apache-feather.png" alt="Apache logo"></div>

<h5 id="installingcertificatesinapache">Installing Certificates in Apache</h5>

<p>If you're running under Linux, you are almost certainly using Apache. If you're not using a panel, then this is the right place. <br>
<a href="http://httpd.apache.org/docs/current/ssl/ssl_howto.html">Here is Apache's documentation on setting up SSL/TLS</a>.</p>

<p><a id="iisinstall"></a></p>

<h5 id="installingcertificatesinmicrosoftiis">Installing Certificates in Microsoft IIS</h5>

<p>If you're running Windows through a panel, it should handle configuring your webserver for you. If you're not using a panel, and you're using IIS, not Apache, then:</p>

<p><a href="https://technet.microsoft.com/en-us/library/cc732230.aspx">Here is the guide for configuring certificates in IIS 7.0</a>.</p>

<h3 id="inclosing">In Closing</h3>

<p>I highly recommend using certificates and HTTPS for your websites, even if you don't technically need them or only need them for your mail server:</p>

<ul>
<li>Too many ISPs are doing deep-packet inspection and some even do ad injection. Encryption prevents that.</li>
<li>HTTPS, though theoretically slower than HTTP, is <a href="https://samrueby.com/2015/01/26/why-is-https-faster-than-http/">actually faster in practice</a>.</li>
</ul>

<p>I also highly recommend getting your certificates from <a href="https://letsencrypt.org/">Let's Encrypt!</a> and, if you can, <a href="https://www.generosity.com/community-fundraising/make-a-more-secure-web-with-let-s-encrypt">supporting them</a> in their good work.</p>

<p>Thank you for reading my blog post!</p>

<p>Copyright © 2016 William David Herndon. All rights reserved.</p>

<p>This series:</p>

<ul>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-1/">Part 1: The Pieces of the Puzzle</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-2/">Part 2: Subdomains and DNS</a></li>
<li><strong>Part 3: Encryption and SSL Certificates</strong> &lt;- You are here</li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-4/">Part 4: The Email Server(s)</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-5/">Part 5: Autoconfiguration</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-6/">Part 6: Debugging Email Servers</a></li>
</ul>]]></content:encoded></item><item><title><![CDATA[Sundry Links]]></title><description><![CDATA[<p><strong>Main Website</strong></p>

<p><a href="https://www.softwareschmiede-herndon.de">Softwareschmiede Herndon</a></p>

<p><strong>Developer Stuff</strong></p>

<p><a href="http://devonwheels.net/">Dev On Wheels</a></p>

<p><strong>Religion</strong></p>

<p><a href="http://www.bahai.org/">Baha'i Faith</a></p>

<p><a href="http://bahairesearch.com/">Interfaith Explorer</a></p>

<p><a href="http://runder-tisch-marburg.org/">Runden Tisch der Religionen / Marburg</a></p>

<p><strong>Martial Arts</strong></p>

<p><a href="http://www.taido-ryu-jujutsu.de/">Taido Ryu Jujutsu</a></p>

<p><a href="http://www.dojo-wehrda.de/">Dojo Wehrda</a></p>

<p><strong>Guitar</strong></p>

<p><a href="http://johannestreml.de/">Johannes Treml</a></p>

<p><a href="http://silverborras.eu/">Silvestre (Silver) Borrás Navaro</a></p>

<p><a href="https://www.facebook.com/Paul-Bowman-Guitarist-159756194213349/">Paul Bowman</a> (facebook)</p>

<p><a href="https://www.facebook.com/jodycoopermusic/">Jody Cooper</a> (facebook)</p>

<p><a href="https://www.youtube.com/channel/UCYARZQ4m_xIrP6O3_EZO1Tg">Anton Skrobanek</a> (youtube)</p>

<p><strong>Writing</strong></p>

<p><a href="https://virtualwritinggroup.org/">Virtual Writing Group</a> (forum)</p>

<p><a href="http://www.writingexcuses.com/">Writing Excuses</a> (podcast)</p>]]></description><link>https://blog.softwareschmiede-herndon.de/sundry-links/</link><guid isPermaLink="false">f9c53ec9-d79a-44a8-967c-589084e0a9da</guid><dc:creator><![CDATA[William David Herndon]]></dc:creator><pubDate>Mon, 19 Dec 2016 12:27:21 GMT</pubDate><content:encoded><![CDATA[<p><strong>Main Website</strong></p>

<p><a href="https://www.softwareschmiede-herndon.de">Softwareschmiede Herndon</a></p>

<p><strong>Developer Stuff</strong></p>

<p><a href="http://devonwheels.net/">Dev On Wheels</a></p>

<p><strong>Religion</strong></p>

<p><a href="http://www.bahai.org/">Baha'i Faith</a></p>

<p><a href="http://bahairesearch.com/">Interfaith Explorer</a></p>

<p><a href="http://runder-tisch-marburg.org/">Runden Tisch der Religionen / Marburg</a></p>

<p><strong>Martial Arts</strong></p>

<p><a href="http://www.taido-ryu-jujutsu.de/">Taido Ryu Jujutsu</a></p>

<p><a href="http://www.dojo-wehrda.de/">Dojo Wehrda</a></p>

<p><strong>Guitar</strong></p>

<p><a href="http://johannestreml.de/">Johannes Treml</a></p>

<p><a href="http://silverborras.eu/">Silvestre (Silver) Borrás Navaro</a></p>

<p><a href="https://www.facebook.com/Paul-Bowman-Guitarist-159756194213349/">Paul Bowman</a> (facebook)</p>

<p><a href="https://www.facebook.com/jodycoopermusic/">Jody Cooper</a> (facebook)</p>

<p><a href="https://www.youtube.com/channel/UCYARZQ4m_xIrP6O3_EZO1Tg">Anton Skrobanek</a> (youtube)</p>

<p><strong>Writing</strong></p>

<p><a href="https://virtualwritinggroup.org/">Virtual Writing Group</a> (forum)</p>

<p><a href="http://www.writingexcuses.com/">Writing Excuses</a> (podcast)</p>

<p><a href="http://nanowrimo.org/">National Novel Writing Month (NaNoWriMo)</a></p>

<p><strong>Other Stuff</strong></p>

<p><a href="http://www.rukens-galerie.de/">Rukens Galerie</a></p>]]></content:encoded></item><item><title><![CDATA[Serving Email Part 2: Subdomains and DNS]]></title><description><![CDATA[<p>This is part three of a six part series on setting up an email server. It covers subdomains you may want to setup and the DNS records that tell others where to find your servers and services.</p>

<p>This series:</p>

<ul>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-1/">Part 1: The Pieces of the Puzzle</a></li>
<li><strong>Part 2: Subdomains and</strong></li></ul>]]></description><link>https://blog.softwareschmiede-herndon.de/serving-email-part-2/</link><guid isPermaLink="false">427aef53-02d5-4364-86de-30a5fe62d9f1</guid><dc:creator><![CDATA[William David Herndon]]></dc:creator><pubDate>Sun, 18 Dec 2016 00:59:33 GMT</pubDate><content:encoded><![CDATA[<p>This is part three of a six part series on setting up an email server. It covers subdomains you may want to setup and the DNS records that tell others where to find your servers and services.</p>

<p>This series:</p>

<ul>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-1/">Part 1: The Pieces of the Puzzle</a></li>
<li><strong>Part 2: Subdomains and DNS</strong> &lt;- You are here</li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-3/">Part 3: Encryption and SSL Certificates</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-4/">Part 4: The Email Server(s)</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-5/">Part 5: Autoconfiguration</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-6/">Part 6: Debugging Email Servers</a></li>
</ul>

<h3 id="subdomains">Sub-Domains</h3>

<p>Given a main domain named <strong>example.com</strong>, here are two configurations I will <em>not</em> be handling:</p>

<ul>
<li>Your ISP handles the mail: <strong>example.com</strong> DNS entries point to the ISP's mail handlers. See your ISP's documentation.</li>
<li>You handle someone else's mail: their DNS entries and configuration files point to your servers. Do mail for yourself first, then worry about getting it right for third parties.</li>
</ul>

<p>Here are some common configurations I will be covering:</p>

<ul>
<li>All in one: everything is handled on <strong>example.com</strong>. If you setup all your DNS records correctly and support autoconfiguration, then  this should work fine.</li>
<li>A single separate mail subdomain, usually <strong>mail.example.com</strong>. Sometimes with a separate autoconfig subdomain, but usually not.</li>
<li>Separate servers for each protocol: <strong>pop.example.com</strong>, <strong>imap.example.com</strong>, <strong>smtp.example.com</strong>, plus usually separate autoconfig servers <strong>autoconfig.example.com</strong>, and/or <strong>autodiscover.example.com</strong>.</li>
</ul>

<p>Some email clients will automatically check for the specific subdomains, either before or after checking DNS records for the subdomains. If your ability to make DNS records is limited in some ways and/or if your subdomains and their appropriate certificates are cheap, then you may want to go with option 2 or 3 above. <strong><em>Most small-operations will probably want to go with option 1, in which case you can skip straight to <a href="https://blog.softwareschmiede-herndon.de/serving-email-part-2/#steptwo">your DNS records</a>.</em></strong></p>

<p>Otherwise:</p>

<ul>
<li>Creating a <a href="https://blog.softwareschmiede-herndon.de/serving-email-part-2/#domainplesk">Subdomain in Plesk</a></li>
<li>Creating a <a href="https://blog.softwareschmiede-herndon.de/serving-email-part-2/#domaincpanel">Subodomain in cPanel</a></li>
<li>Creating a <a href="https://blog.softwareschmiede-herndon.de/serving-email-part-2/#domainnopanel">Subdomain without a panel</a></li>
<li>Creating a <a href="https://blog.softwareschmiede-herndon.de/serving-email-part-2/#domainwindows">Subdomain under Windows</a></li>
</ul>

<p><a id="domainplesk"></a></p>

<h5 id="creatingasubdomaininplesk">Creating a Subdomain in Plesk</h5>

<p>If you are using Plesk, you should create your subdomains in their interface. it will take care of creating the DNS entry linking the subdomain to the IP-address and creating the necessary entries in Apache.</p>

<p>In Plesk, in the "Websites &amp; Domains" section (the main section), there is a button near the top:</p>

<div style="float:left;margin-right:0.5em"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/plesk-subdomain.png" alt="Plesk Desktop with 'Add Subdomain' button circled" title="Click 'Add Subdomain'"></div>

<p>Press the "Add Subdomain" button, then fill in the subdomain and main domain. One can also change the sub-directory, and I usually do: the directory is usually created below the main domain anyway, so using the full domain name again: "softwareschmiede-herndon.de/mail.softwareschmiede-herndon.de" seems a bit of overkill to me. Then you click OK and it takes care of it.</p>

<p>You can then place the files you need below the directories you created for the respective subdomain(s).</p>

<div style="float:left;margin-right:0.5em"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/cpanel.png" alt="cPanel logo"></div>

<p><a id="domaincpanel"></a></p>

<h5 id="creatingasubdomainincpanel">Creating a Subdomain in cPanel</h5>

<p>The <a href="https://documentation.cpanel.net/display/ALD/Subdomains">documentation for creating a subdomain in cPanel is here</a>. It is analogous to Plesk - automatically creating the necessary DNS records, changing the Apache config file and creating the base directory of the new subdomain.</p>

<p>You then place the files you need below the directories you created for the respective subdomain(s).</p>

<div style="float:right;margin-left:0.5em"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/apache-feather.png" alt="Apache logo"></div>

<p><a id="domainnopanel"></a></p>

<h5 id="creatingasubdomainwithnopanelwithapache">Creating a Subdomain with no panel (with Apache)</h5>

<p>If you're not using a panel to control your subdomains, you may still want to "roll your own". You will need to make the entries in the DNS linking the subdomain to your IP-address, which you may want to do first.</p>

<p>Then you will need to add <strong>&lt;VirtualHost&gt;</strong> sections to your Apache configuration file. On my current version of Ubuntu that is "/etc/apache2/apache2.conf". You can find <a href="https://httpd.apache.org/docs/current/vhosts/examples.html">examples on the Apache website here</a>, <a href="https://httpd.apache.org/docs/current/vhosts/">documentation here</a>.</p>

<p><a id="domainwindows"></a></p>

<h5 id="creatingadomainunderwindows">Creating a domain under Windows</h5>

<p>In order to create a domain under Windows without a VPS panel, you will need Windows Server (2003, 2008, 2012) and Active Directory. When installing Active Directory you will also want to install the DNS Manager. Then you can start "dcpromo" from the command line or from the "run" command under Start. If no parameters are given, it will start a Wizard that will guide you through the process. It is also possible to <a href="https://technet.microsoft.com/en-us/library/cc732887.aspx">do everything from the command line</a>.</p>

<p>Once you have created the (sub-)domain, you still have to let IIS "know" about the domain: open the Internet Information Services (IIS) Manager, found in the "Administrative Tools" section of the Control Panel.</p>

<p>Open the tree below the server that should receive the subdomain (on the left of the screen). Right-click on the subsection "Sites". From the menu choose "Add Website...". Fill out the fields as needed and confirm.</p>

<p><a id="steptwo"></a></p>

<div style="float:left;margin-right:0.5em"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/telephone-book.png" alt="telephone book"></div>

<h3 id="yourdnsrecords">Your DNS Records.</h3>

<p>DNS is the <a href="https://en.wikipedia.org/wiki/Domain_Name_System">Domain Name System</a>. It is basically a distributed "telephone book", linking names to IP-Addresses and services. Your server is responsible for its own records, which get propagated to a higher level server (usually at your provider) and thence to the rest of the internet.</p>

<p><strong><em>If you are creating subdomains or changing other DNS records, please remember that it may take up to several days for DNS records to propagate so that others can see the new subdomains or other changes.</em></strong></p>

<p>Each DNS record has a short (1-3) letter Record Type that specifies what kind of info is in the record.</p>

<h4 id="basicdnsrecords">Basic DNS Records</h4>

<p>Below are the basic DNS records on pretty much all servers. If you are creating subdomain without a panel, you will need to create an A record for each subdomain, the other basic records should already be correct, but are included for completeness.</p>

<div style="float:right;margin-left:0.5em"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/address-1.png" alt="letter with arrow to address"></div>

<h6 id="arecordaddressrecord">A Record - Address Record</h6>

<p>The A Record is the most essential record: it maps a (sub)domain name to an IP-address. Here are some entries from my own DNS records:</p>

<table>  
<tr><td>Host</td><td>Record Type</td><td>Value</td></tr>  
<tr><td>softwareschmiede-herndon.de.</td><td>A</td><td>5.35.246.86</td></tr>  
<tr><td>blog.softwareschmiede-herndon.de.</td><td>A</td><td>5.35.246.86</td></tr>  
<tr><td>mail.softwareschmiede-herndon.de.</td><td>A</td><td>5.35.246.86</td></tr>  
</table>

<p>Note the trailing dot: that is not a mistake. That is actually part of a fully-qualified domain name. Most panels will automatically take care of the dot for you.</p>

<p>If you are creating subdomains without one of the panels that takes care of DNS for you, then you will need to make an A record for each of your subdomains. And don't forget the dot at the end.</p>

<div style="float:left;margin-right:0.5em"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/pointer.jpg" alt="Dog of breed Pointer"><center>German Shorthair Pointer</center></div>

<h6 id="ptrrecordpointerrecord">PTR Record - Pointer Record</h6>

<p>The PTR Record is a reverse lookup. Someone wants to know a domain name from the IP-Address. There's only one of these per Server. If you're sharing a server, you won't be able to change this. The PTR record from my server:</p>

<table>  
<tr><td>Host</td><td>Record Type</td><td>Value</td></tr>  
<tr><td>5.35.246.86 / 24</td><td>PTR</td><td>softwareschmiede-herndon.de.</td></tr>  
</table>

<h6 id="nsrecordnameserverrecord">NS Record - Name Server Record</h6>

<p>The NS Record delegates your server's DNS-Zone to the specified name servers. This is DNS Bookkeeping: don't touch these unless you know what you're doing. These are my records, which probably won't mean much to you, but are essential for DNS lookups of my domains to work correctly.</p>

<table>  
<tr><td>Host</td><td>Record Type</td><td>Value</td></tr>  
<tr><td>softwareschmiede-herndon.de.</td><td>NS</td><td>lvps5-35-246-86.dedicated.hosteurope.de.</td></tr>  
<tr><td>softwareschmiede-herndon.de.</td><td>NS</td><td>ns2.hans.hosteurope.de.</td></tr>  
</table>

<h6 id="cnamerecordcanonicalnamerecord">CNAME Record - Canonical Name Record</h6>

<p>The CNAME Record specifies an alias. It is optional, but most servers have one or more. If a CNAME record is found while looking up a name, then a retry will be done with the new name. An example from my server, aliasing "www." to the main domain:</p>

<table>  
<tr><td>Host</td><td>Record Type</td><td>Value</td></tr>  
<tr><td>www.softwareschmiede-herndon.de.</td><td>CNAME</td><td>softwareschmiede-herndon.de.</td></tr>  
</table>

<h6 id="txtrecordtextrecord">TXT Record - Text Record</h6>

<p>A Text Record is a generic record that can be and is used for many different things. One of the common uses is for site verification - proving to some entity that you have control of the site:</p>

<table>  
<tr><td>Host</td><td>Record Type</td><td>Value</td></tr>  
<tr><td>softwareschmiede-herndon.de.</td><td>TXT</td><td>google-site-verification=kL8kHnq_Vi7Jjn9vgNqvfVrvQzn7trr0NN9oKDGbD8E</td></tr>  
</table>

<p>Another common use is for an SPF Record, which is relevant for eMails - see the TXT/SPF section below.</p>

<h4 id="dnsrecordsrelevanttoemail">DNS Records relevant to eMail</h4>

<p>You will want to create the following DNS records for your eMail server:</p>

<div style="float:right;margin-left:0.5em"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/mailbox.jpeg" alt="Physical Mailbox"></div>

<h6 id="mxrecordmailexchangerecord">MX Record - Mail Exchange Record</h6>

<p>The MX Record specifies the name of the server running the Mail Transfer Agent(s) (MTAs). You will want one of these records, even if you have no separate mail server: many eMail clients will get this wrong if there is no entry.</p>

<p>For large operations there can be multiple mail servers for each domain and hence multiple MX records, but you will only want one per domain. The number in parentheses is a priority number, which is ignored when there is only one.</p>

<table>  
<tr><td>Host</td><td>Record Type</td><td>Value</td></tr>  
<tr><td>softwareschmiede-herndon.de.</td><td>MX(10)</td><td>softwareschmiede-herndon.de.</td></tr>  
</table>

<p>Note that I do not have a separate mail server. If I did, the mail server name would be on the right under Value.</p>

<div style="float:left;margin-right:0.5em"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/spf.jpeg" alt="Sun Protection Factor (SPF) logo" title="Sun Protection Factor (SPF) logo"></div>

<h6 id="spfrecordsenderpolicyframeworkrecord">SPF Record - Sender Policy Framework Record</h6>

<p>Support for the SPF Record was discontinued, but they often still exist. The TXT/SPF Record (below) is still used.</p>

<h6 id="txtspfrecordtextsenderpolicyframeworkrecord">TXT/SPF Record - Text / Sender Policy Framework Record</h6>

<p>SPF is an eMail validation system used to catch spoofers by verifying which servers are authorized to send emails from your domain.</p>

<p><a href="https://tools.ietf.org/html/rfc7208">It's complicated.</a> Your panel probably takes care of this for you. If it doesn't, you'll want to duplicate the record below, with your domain substituted on the left.  My TXT/SPF Record:</p>

<table>  
<tr><td>Host</td><td>Record Type</td><td>Value</td></tr>  
<tr><td>softwareschmiede-herndon.de.</td><td>TXT</td><td>v=spf1 +a +mx -all</td></tr>  
</table>

<div style="float:right;margin-left:0.5em"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/nestor.jpeg" alt="butler"></div>

<h6 id="srvrecordservicelocatorrecord">SRV Record - Service Locator Record</h6>

<p>These records have an unusual format and are used to locate specific services like SMTP and IMAP. The format is:</p>

<p>_(service)._(protocol).(domain) &lt;TTL&gt; &lt;class&gt; SRV &lt;priority&gt; &lt;weight&gt; &lt;port&gt; &lt;target&gt;</p>

<p>Note that the underscore is not a valid character for a server URL, so the names can only be used for locating services.</p>

<p>My SRV Records, specifying my SMTP server and IMAP server respectively:</p>

<table>  
<tr><td>Host</td><td>TTL</td><td>class</td><td>Record Type</td><td>priority</td><td>weight</td><td>port</td><td>Value</td></tr>  
<tr><td>_submission._tcp.softwareschmiede-herndon.de.</td><td>-/-</td><td>-/-</td><td>SRV</td><td>0</td><td>10</td><td>465</td><td>softwareschmiede-herndon.de.</td></tr>  
<tr><td>_imap._tcp.softwareschmiede-herndon.de.</td><td>-/-</td><td>-/-</td><td>SRV</td><td>0</td><td>10</td><td>143</td><td>softwareschmiede-herndon.de.</td></tr>  
</table>

<p>Now that you know which records you need, we'll cover how to view and edit your DNS Records. I cover four configurations:</p>

<ul>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-2/#dnsplesk">Plesk</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-2/#dnscpanel">cPanel</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-2/#dnsubuntu">Ubuntu</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-2/#dnsiis">Windows IIS</a></li>
</ul>

<p><a id="dnsplesk"></a></p>

<h6 id="dnsinplesk">DNS in Plesk</h6>

<div style="float:left;margin-right:0.5em"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/plesk-dns.png" alt="Plesk with DNS Settings circled"></div>

<p>Under Plesk, go to "Websites &amp; Domains" (home), scroll to the domain for which you wish to change the DNS records, then click on "DNS Settings" (circled in red in the image).</p>

<div style="float:left;margin-right:0.5em"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/plesk-dns-edit.png" alt="Plesk DNS Settings with Add Record circled and IMAP SRV record circled"></div>

<p>There you can add new records by clicking on "Add Record" or edit old records by clicking on the "Host" part of the record you want to change, like the IMAP SRV record circled in the image.</p>

<p>After you have made changes, an "Update" button will appear at the top. When you are done making changes, click on the "Update" button, and when that is done, click on the "Apply DNS Template" button.</p>

<p>Full documentation for DNS under Plesk is <a href="https://docs.plesk.com/en-US/onyx/administrator-guide/dns.59440/">here</a>.</p>

<p><a id="dnscpanel"></a></p>

<div style="float:right;margin-left:0.5em"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/cpanel.png" alt="cPanel logo"></div>

<h6 id="dnsincpanel">DNS in cPanel</h6>

<p>Documentation for changing DNS records in cPanel is <a href="https://documentation.cpanel.net/display/ALD/Edit+DNS+Zone">here</a>.</p>

<p><a id="dnsubuntu"></a></p>

<h6 id="dnsinubuntunopanel">DNS in Ubuntu (no panel)</h6>

<p>Under Ubuntu the DNS records are handled by a program called BIND (or BIND9). Full documentation can be found <a href="https://help.ubuntu.com/lts/serverguide/dns-configuration.html">here</a>. Below is a quick-start guide:</p>

<p>There should be a file "/etc/named.conf". If it isn't there, use "whereis named" to find it. Use "ls -l" to find where it is linked (if at all):</p>

<pre><code>me@myserver.com:~$ ls -l /etc/named.conf
lrwxrwxrwx 1 root root 34 Dec  6 10:36 /etc/named.conf -&gt; /var/named/run-root/etc/named.conf
</code></pre>

<p>Look at the contents of named.conf: if it says something like "THE FOLLOWING LINES WERE GENERATED BY PLESK", then do not edit it, but rather use the program which generated it to make changes: anything you do in such files will likely be overwritten.</p>

<p>The beginning of the file will be sections for options, key, and controls. In the options section there should be an entry for directory:</p>

<pre><code>options {
listen-on-v6 { any; };
    allow-recursion {
            localhost;
    };
    version "none";
    directory "/var"; // &lt;-----------------
    auth-nxdomain no;
    pid-file "/var/run/named/named.pid";
};
</code></pre>

<p>If named.conf was not linked, then that is the zone-file directory. If named.conf was linked, as in the example, then BIND will be running in a "chroot jail", and you must make that path relative to the chroot. In the example, "/var/named/run-root/var" is the zone-file directory.</p>

<p>The rest of named.conf will probably be the zones, which should look something like this:</p>

<pre><code>zone "softwareschmiede-herndon.de" {
    type master;
    file "softwareschmiede-herndon.de";
    allow-transfer {
        5.35.246.86;
        80.237.128.10;
        common-allow-transfer;
    };
};
</code></pre>

<p>The two IP-Addresses are the Name Servers in the NS records. There is some info about the relationship between the servers, and the rest of the information is found in the file specified, in this example "softwareschmiede-herndon.de", which is found in the zone-file directory.</p>

<p>The zone-file (softwareschmiede-herndon.de), should look something like this:</p>

<pre><code>$TTL    86400

@       IN      SOA     lvps5-35-246-86.dedicated.hosteurope.de. wdh.softwareschmiede-herndon.de. (
                    1481981362      ; Serial
                    10800   ; Refresh
                    3600    ; Retry
                    604800  ; Expire
                    10800 ) ; Minimum

softwareschmiede-herndon.de.             IN NS   lvps5-35-246-86.dedicated.hosteurope.de.
softwareschmiede-herndon.de.             IN NS   ns2.hans.hosteurope.de.
ipv4.softwareschmiede-herndon.de.                IN A    5.35.246.86
softwareschmiede-herndon.de.             IN A    5.35.246.86
blog.softwareschmiede-herndon.de.                IN A    5.35.246.86
ftp.softwareschmiede-herndon.de.                 IN CNAME        softwareschmiede-herndon.de.
www.softwareschmiede-herndon.de.                 IN CNAME        softwareschmiede-herndon.de.
softwareschmiede-herndon.de.             IN MX  10 softwareschmiede-herndon.de.
softwareschmiede-herndon.de.             IN TXT  "v=spf1 +a +mx -all"
_imap._tcp.softwareschmiede-herndon.de.          IN SRV 0 10 143 softwareschmiede-herndon.de.
_submission._tcp.softwareschmiede-herndon.de.            IN SRV 0 10 465 softwareschmiede-herndon.de.
</code></pre>

<p>The format of the different records is evident in the example. When done making changes, increase the number marked "; Serial" above - if it is not increased, the changes will not be propagated. Some recommend using the date to generate the number, "YYYYMMDD##", but it doesn't really matter as long as it increases.</p>

<p><a id="dnsiis"></a></p>

<h6 id="dnsundermicrosoftwindows">DNS under Microsoft Windows</h6>

<p>Managing DNS under Windows without a VPS panel is too complicated to cover here. <a href="https://technet.microsoft.com/en-us/library/cc730775.aspx">Here is an overview of DNS for Windows Server 2008</a>.</p>

<h3 id="inclosing">In Closing</h3>

<p>If you can't change your DNS records or have only limited ability to do so, don't sweat it: most client software does not access DNS. Even Thunderbird, when it is looking up an MX record, does not look it up directly, but rather uses HTTPS to ask a service to do the look up for it.</p>

<p>Thank you for reading my blog post!</p>

<p>Copyright © 2016 William David Herndon. All rights reserved.</p>

<p>This series:</p>

<ul>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-1/">Part 1: The Pieces of the Puzzle</a></li>
<li><strong>Part 2: Subdomains and DNS</strong> &lt;- You are here</li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-3/">Part 3: Encryption and SSL Certificates</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-4/">Part 4: The Email Server(s)</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-5/">Part 5: Autoconfiguration</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-6/">Part 6: Debugging Email Servers</a></li>
</ul>]]></content:encoded></item><item><title><![CDATA[Serving Email Part 1: The Pieces to the Puzzle]]></title><description><![CDATA[<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2017/02/email-puzzle2.jpeg" alt="Email Puzzle"></div>

<p>This was supposed to be a single blog post. But it has expanded until there is no way to do it in a single, reasonable sized post. This post is an introduction to the resources you will need to know for the rest of the series. You can skip the</p>]]></description><link>https://blog.softwareschmiede-herndon.de/serving-email-part-1/</link><guid isPermaLink="false">2f4472b3-4319-4a91-992e-cac4bb009dd1</guid><dc:creator><![CDATA[William David Herndon]]></dc:creator><pubDate>Fri, 02 Dec 2016 22:00:23 GMT</pubDate><content:encoded><![CDATA[<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2017/02/email-puzzle2.jpeg" alt="Email Puzzle"></div>

<p>This was supposed to be a single blog post. But it has expanded until there is no way to do it in a single, reasonable sized post. This post is an introduction to the resources you will need to know for the rest of the series. You can skip the parts of the introduction you're familiar with, without missing anything important.</p>

<p>This series:</p>

<ul>
<li><strong>Part 1: The Pieces of the Puzzle</strong> &lt;- You are here</li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-2/">Part 2: Subdomains and DNS</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-3/">Part 3: Encryption and SSL Certificates</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-4/">Part 4: The Email Server(s)</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-5/">Part 5: Autoconfiguration</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-6/">Part 6: Debugging Email Servers</a></li>
</ul>

<h3 id="thegoal">The Goal</h3>

<div style="float:right;margin-left:0.5emem;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/11/SimpleSetup-1.png" alt="Email client asking for login info"></div>  

<p>You have your own website or websites, and you want to provide your users with email. You want your user to enter their email address and their password into their favorite email-client application, and it should just work.</p>

<p>It should also be secure, so that it will continue to "just work" for your customers.</p>

<p>If you are providing the service yourself, you may or may not want to offer your user a choice of account types:  </p>

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/11/AccountType-1.png" alt="Email client asking account type (IMAP/POP32/Exchange)"></div>  

<div style="display:inline-block;width:100%;"></div>  

<p>If you're using an ISP that provides email, and it just works, congratulations! You can skip out on this blog post. <br>
Otherwise your goal is that the above should be the end of user setup. Anything else and your users will be calling you for support.  </p>

<div style="display:inline-block;width:100%;"></div>  

<h3 id="theproblem">The Problem</h3>

<p>So, the user chooses their account type, and instead of it just working, the user is presented with screens like these:  </p>

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/11/IncomingSettings-1.png" alt="Email client extended incoming server settings"></div>  

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/11/OutgoingSettings-1.png" alt="Email client extended outgoing server settings"></div>

<div style="display:inline-block;width:100%;"></div>

<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/11/ConnectionFail-2.png" alt="Email client; generic error"></div>

<p>If they get anything wrong, they'll get an error message they can't interpret (and perhaps you can't either).</p>

<div style="display:inline-block;width:100%;"></div>

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/11/BadCertificate.png" alt="Email client: invalid certificate"></div>  

<p>Or worse. They may get a scary screen like this.</p>

<div style="display:inline-block;width:100%;"></div>

<h3 id="thepiecesofthepuzzle">The Pieces of the Puzzle</h3>

<p>So, there are a lot of pieces to this puzzle. I have short sections on each linked below.</p>

<ul>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-1/#protocols">The account types / Email-protocols</a>: <a href="https://blog.softwareschmiede-herndon.de/serving-email-part-1/#POP">POP</a>, <a href="https://blog.softwareschmiede-herndon.de/serving-email-part-1/#IMAP">IMAP</a>, <a href="https://blog.softwareschmiede-herndon.de/serving-email-part-1/#SMTP">SMTP</a>, <a href="https://blog.softwareschmiede-herndon.de/serving-email-part-1/#ExchangeWebDAV">Exchange / WebDAV</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-1/#EmailServers">The email server programs (daemons)</a>: <a href="https://blog.softwareschmiede-herndon.de/serving-email-part-1/#sendmail">sendmail</a>, <a href="https://blog.softwareschmiede-herndon.de/serving-email-part-1/#Postfix">Postfix</a>, <a href="https://blog.softwareschmiede-herndon.de/serving-email-part-1/#Exim">Exim</a> and <a href="https://blog.softwareschmiede-herndon.de/serving-email-part-1/#ExchangeServer">Microsoft Exchange Server</a> cover 90% of the market.</li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-1/#EmailClients">The email clients</a>: iPhones, Microsoft Outlook, Mozilla Thunderbird, <a href="https://blog.softwareschmiede-herndon.de/serving-email-part-1/#WebMail">WebMail</a> and Android mobile phone email clients.</li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-1/#DNS">DNS - Domain Name System</a> - the system by which clients find your server(s) and some information about it/them.</li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-1/#autoconfig">Autoconfiguration</a> - different for different clients</li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-1/#SSL">SSL/TLS and Certificates</a> - so connections are secure and your client knows that it is really connecting to the correct server.</li>
</ul>

<p>Which pieces you will want to use depends on your and your user's requirements and limitations. Getting all these pieces to play nice together is a difficult dance, but I'm going to try and walk you through it here.</p>

<p><a id="protocols"></a>  </p>

<h3 id="theaccounttypeemailprotocols">The Account Type / Email-Protocols</h3>

<p><a id="POP"></a>  </p>

<h6 id="incomingprotocolahrefhttpsenwikipediaorgwikipost_office_protocoltarget_blankpoppostofficeprotocola">Incoming Protocol: <a href="https://en.wikipedia.org/wiki/Post_Office_Protocol" target="_blank">POP - Post Office Protocol</a></h6>

<p>Here the name is the program: the server acts like a post office, and <strong>when your client picks up your email, it is deleted from the server</strong>. This mode is sometimes called "download-and-delete" or "maildrop". Often called POP3, because version 3 is the last major version, the current formal documentation is <a href="https://tools.ietf.org/html/rfc1939" target="_blank">RFC 1939</a>). <br>
Historically, this was the only way to do things: you had multiple servers between sender and receiver, and servers were often offline, so each server on the way kept your email until it was picked up by the next station. Now servers usually talk directly to each other. <br>
This may still be a good protocol choice if you want to minimize the amount of space email takes up on the server, or if your users don't want copies of their email on the server. On the other hand, if your users want to access their email from their mobile, their tablet and their desktop without missing a beat, then they'll need the emails to stay on your server where they can access them. That's where the major alternative, IMAP, comes in. <br>
A modern POP3 server listens on <strong>port 110</strong> and may thence switch to encrypted protocol, or it may listen for encrypted traffic directly (POP3S) on <strong>port 995</strong>, or both.</p>

<p><a id="IMAP"></a>  </p>

<h6 id="incomingprotocolahrefhttpsenwikipediaorgwikiinternet_message_access_protocoltarget_blankimapinternetmessageaccessprotocola">Incoming Protocol: <a href="https://en.wikipedia.org/wiki/Internet_Message_Access_Protocol" target="_blank">IMAP - Internet Message Access Protocol</a></h6>

<p>This protocol allows a client to manipulate messages (move between folders, copy, delete) and retrieve messages stored on a server. <strong>Messages are only deleted on the server when explicitly commanded to do so</strong>, and the client normally only keeps a small cache of messages. The current version of this protocol, version 4, was formalized in 2003 with <a href="https://tools.ietf.org/html/rfc3501" target="_blank">RFC 3501</a>. <br>
Depending on space requirements, you may need to agree with your users on an archiving scheme, so that emails that they need access to remain online, while older emails are stored in an offline archive and deleted from the server. <br>
A modern IMAP server listens on <strong>port 143</strong> and may thence switch to encrypted protocol, or it may listen for encrypted traffic directly (IMAPS) on <strong>port 993</strong>, or both.</p>

<p><a id="SMTP"></a>  </p>

<h6 id="outgoingprotocolahrefhttpsenwikipediaorgwikisimple_mail_transfer_protocoltarget_blanksmtpsimplemailtransferprotocola">Outgoing Protocol: <a href="https://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol" target="_blank">SMTP - Simple Mail Transfer Protocol</a></h6>

<p>This protocol is for sending messages and is used by all major mail servers. The current version was formally defined in <a href="https://tools.ietf.org/html/rfc5321" target="_blank">RFC 5321</a>. <br>
Although SMTP servers listen on port 25, this is usually reserved for unencrypted traffic between servers. They listen for user email-clients using encrypted traffic directly (SMTPS) on <strong>port 587</strong> or <strong>port 465 (deprecated)</strong>, or both.</p>

<p><a id="ExchangeWebDAV"></a>  </p>

<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/11/Microsoft_Exchange_logo.png" alt="Microsoft Exchange Logo"></div>  

<h6 id="ahrefhttpsenwikipediaorgwikimicrosoft_exchange_servertarget_blankmicrosoftexchangeserveraahrefhttpsenwikipediaorgwikiwebdavtarget_blankwebdavwebdistributedauthoringandversioninga"><a href="https://en.wikipedia.org/wiki/Microsoft_Exchange_Server" target="_blank">Microsoft Exchange Server</a> / <a href="https://en.wikipedia.org/wiki/WebDAV" target="_blank">WebDAV - Web Distributed Authoring and Versioning</a></h6>

<p>This proprietary system from Microsoft works like the IMAP/SMTP combination: messages are kept on the server and it allows you to send messages. WebDAV is a generic method of manipulating data via <a href="https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol" target="_blank">HTTP</a>, that Microsoft extended for manipulating mail messages on Exchange Server. WebDAV support was discontinued in Exchange Server 2010, replaced by Exchange Web Services (EWS), a SOAP/XML based API. <br>
Since Microsoft Exchange Server supports POP3, IMAP and SMTP anyway, I'm going to leave out this proprietary nightmare that would expand this already too large article.</p>

<p><a id="EmailServers"></a>  </p>

<h3 id="theemailserver">The Email Server</h3>

<p>The big four Mail Server Softwares, often called Message Transfer Agents (MTA), are Exim (ca. 50% market share), Postfix (ca. 30%), sendmail (ca. 8%), and Microsoft Exchange Server (ca. 3%). All except the Exchange Server are Open Source. Depending on your setup, you may not have any choice in which MTA you use. Those that have a choice are usually using a <a href="https://en.wikipedia.org/wiki/Virtual_private_server" target="_blank">virtual private server (VPS)</a>, or a dedicated server. <br>
If you have a choice, any of the four will do - they all support POP3, IMAP and SMTP.</p>

<p><a id="sendmail"></a>  </p>

<div style="float:right;margin-left:0.5em"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/sendmail-logo.gif" alt="sendmail logo"></div>

<h5 id="ahrefhttpsenwikipediaorgwikisendmailtarget_blanksendmaila"><a href="https://en.wikipedia.org/wiki/Sendmail" target="_blank">sendmail</a></h5>

<p>The oldest of the three, this Open Source software was first released in 1983. It has great flexibility, but configuring it is daunting.</p>

<p><a id="Postfix"></a>  </p>

<div style="float:right;margin-left:0.5em"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/Postfix-logo.png" alt="Postfix logo"></div>

<h5 id="ahrefhttpsenwikipediaorgwikipostfix_softwaretarget_blankpostfixa"><a href="https://en.wikipedia.org/wiki/Postfix_(software)" target="_blank">Postfix</a></h5>

<p>Originally released in 1998 as a replacement for sendmail, Postfix is still under active development. It has integrated protection against spambots and malware. It is released under the <a href="https://en.wikipedia.org/wiki/IBM_Public_License" target="_blank">IBM Public License</a>.</p>

<p><a id="Exim"></a>  </p>

<div style="float:right;margin-left:0.5em"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/Exim-logo.png" alt="Exim logo"></div>

<h5 id="ahrefhttpsenwikipediaorgwikieximtarget_blankexima"><a href="https://en.wikipedia.org/wiki/Exim" target="_blank">Exim</a></h5>

<p>The default email program on Debian/Linux distributions, it has over 50% market share. It is often used together with <a href="https://en.wikipedia.org/wiki/CPanel" target="_blank">cPanel</a>, a major web-hosting control panel.</p>

<p><a id="ExchangeServer"></a>  </p>

<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/11/Microsoft_Exchange_logo.png" alt="MS Exchange logo"></div>

<h5 id="ahrefhttpsenwikipediaorgwikimicrosoft_exchange_servertarget_blankmicrosoftexchangeservera"><a href="https://en.wikipedia.org/wiki/Microsoft_Exchange_Server" target="_blank">Microsoft Exchange Server</a></h5>

<p>Microsoft Exchange Server is proprietary software. In addition to the standard protocols, it supports its own protocol, as mentioned above. It runs only on Windows Operating System, and supports a calendar and other functions as well as email.</p>

<p><a id="EmailClients"></a></p>

<h3 id="theemailclients">The Email Clients</h3>

<h5 id="thebigclients">The Big Clients</h5>

<p>You probably want to support these:</p>

<div style="display:inline-block;width:100%;"></div>  

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/apple-iphone-logo.png" alt="apple logo"></div>  

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/gmail-logo.png" alt="GMail logo"></div>  

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/outlook-logo.jpg" alt="Outlook logo"></div>  

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/thunderbird-logo.png" alt="Thunderbird logo"></div>  

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/Windows10Mail-logo.png" alt="Windows 10 Mail-Client logo"></div>  

<div style="display:inline-block;width:100%;"></div>

<ul>
<li>Apple iPhone/iPad - the largest by market share, no choice for those that own one</li>
<li>GMail - not just for Google Email accounts</li>
<li>Microsoft Outlook - still many people using Windows 7/8 desktop</li>
<li>Mozilla Thunderbird - for Linux users and picky Windows users</li>
<li>Windows 10 Mail - comes with Windows 10</li>
</ul>

<p><a id="WebMail"></a></p>

<h5 id="webmail">WebMail</h5>

<p>You probably also want to let your users access email via browser with a WebMail program: e.g. Horde, SquirrelMail, RoundCube.</p>

<div style="display:inline-block;width:100%;"></div>  

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/horde-webmail-logo.png" alt="Horde Webmail Logo"></div>  

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/squirrelmail-logo.png" alt="SquirrelMail Webmail Logo"></div>  

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/roundcube-logo.jpg" alt="Roundcube Webmail Logo"></div>  

<div style="display:inline-block;width:100%;"></div>

<h5 id="smallerclients">Smaller Clients</h5>

<p>You may or may not want to support these smaller clients (I use K-9 Mail myself):</p>

<div style="display:inline-block;width:100%;"></div>  

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/k-9-mail-logo.png" alt="K-9 Mail Logo"></div>  

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/maildroid-logo.png" alt="Maildroid Logo"></div>  

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/bluemail-logo.png" alt="BlueMail Logo"></div>  

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/ClawsMailLogo.png" alt="Claws Mail Logo"></div>  

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/the-bat-logo.png" alt="The Bat Mail Logo"></div>  

<div style="display:inline-block;width:100%;"></div>

<ul>
<li>Android clients: K-9 Mail, MailDroid, Blue Mail, et al.</li>
<li>Desktop clients: Claws Mail, TheBat, et al.</li>
</ul>

<h5 id="noworries">No Worries</h5>

<p>There are some popular email clients that have restrictions preventing their use with the mail servers we're talking about here. That is not always obvious: e.g. I installed Touchdown to test it, before discovering I couldn't use it. You won't need to worry about:</p>

<ul>
<li>Touchdown - only supports Microsoft Exchange Server</li>
<li>Boomerang - only GMail accounts</li>
<li>Yahoo! Mail - only Yahoo accounts</li>
<li>AOL Mail - only AOL accounts</li>
</ul>

<p><a id="DNS"></a>  </p>

<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/dns-logo.jpg" alt="DNS Globe"></div>

<h3 id="dnsahrefhttpsenwikipediaorgwikidomain_name_systemtarget_blankdomainnamesystema">DNS - <a href="https://en.wikipedia.org/wiki/Domain_Name_System" target="_blank">Domain Name System</a></h3>

<p>The Domain Name System has different types of records. In rough order of frequency of usage:</p>

<ul>
<li><strong>A</strong> - maps names to IP-Adresses</li>
<li><strong>NS</strong> - for authoritative name servers</li>
<li><strong>CNAME</strong> - for aliases</li>
<li><strong>TXT</strong> - miscellaneous text records:
<ul><li>Verification records: e.g. Google, Office 365</li>
<li>SPF - <a href="https://en.wikipedia.org/wiki/Sender_Policy_Framework" target="_blank">Sender Policy Framework</a> - should be TXT duplicate of SPF record.</li></ul></li>
<li><strong>MX</strong> - the <a href="https://en.wikipedia.org/wiki/MX_record" target="_blank">"Mail Transfer" record</a>, giving the hostname of the mail server</li>
<li><strong>SRV</strong> - The <a href="https://en.wikipedia.org/wiki/SRV_record" target="_blank">service record</a>, telling the hostname and port number of specified services</li>
<li><strong>SPF</strong> - <a href="https://en.wikipedia.org/wiki/Sender_Policy_Framework" target="_blank">Sender Policy Framework</a> gives info about your email policy to others. This may be a duplicate of an SPF record.</li>
</ul>

<p>Linux has several commands for looking up DNS records. The most common is <a href="https://linux.die.net/man/1/host" target="_blank">host</a>. Under Windows you use <a href="https://technet.microsoft.com/en-us/library/cc725991.aspx" target="_blank">NSLookup</a>.</p>

<p>In either case, you should use a lookup program to verify that your record changes are correct and are being propagated. Best is if you can check the records on your server itself first: propagation to other servers may take hours or even days.</p>

<p><a id="autoconfig"></a></p>

<h3 id="autoconfiguration">Autoconfiguration</h3>

<p>Several Email client writers have tried to mitigate the difficulties of configuring their clients by documenting methods of specifying to their client how they should be configured.</p>

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/outlook-logo.jpg" alt="Outlook Logo"></div>

<h5 id="outlookautoconfiguration">Outlook Autoconfiguration</h5>

<p>One can tell Outlook how to configure emails by placing an XML-file with the necessary information in a specific location on the main domain, or on an "autodiscover" subdomain. One can also place a redirect on the "autodiscover" subdomain to a secure server or make a SRV-record in DNS. The XML file can be static, or it can be generated dynamically at each request - the file request is done via POST with the username passed. <a href="https://technet.microsoft.com/en-us/library/cc511507.aspx" target="_blank">The details are here</a>.</p>

<div style="float:right;margin-left:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/thunderbird-logo.png" alt="Thunderbird Logo"></div>

<h5 id="mozillathunderbirdautoconfiguration">Mozilla Thunderbird Autoconfiguration</h5>

<p>Similar to Outlook, one can place an XML file in a specific location, but the location is different: either on the server specified in the DNS MX-record or in the "autoconfig" subdomain. Only a static file is expected, but it supports some variable names, like "%EMAILADDRESS%". <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Thunderbird/Autoconfiguration" target="_blank">The details are here</a>.</p>

<div style="float:left;margin-right:0.5em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/12/ssl-logo.png" alt="https:// in address bar"></div>

<p><a id="SSL"></a></p>

<h3 id="ahrefhttpsenwikipediaorgwikitransport_layer_securitytarget_blankssltlsaandahrefhttpsenwikipediaorgwikipublic_key_certificatetarget_blankcertificatesa"><a href="https://en.wikipedia.org/wiki/Transport_Layer_Security" target="_blank">SSL/TLS</a> and <a href="https://en.wikipedia.org/wiki/Public_key_certificate" target="_blank">Certificates</a></h3>

<p>The original email did not have any security, but now it is an absolute requirement: with so many spammers, email servers must properly authenticate everything over a secure connection.</p>

<p>Depending on how you configure your server(s), you may have many subdomains, e.g.: pop3.mydomain.com, imap.mydomain.com, smtp.mydomain.com, webmail.mydomain.com, autodiscover.mydomain.com, autoconfig.mydomain.com. If so, you will either need a wildcard certificate or separate certificates for each subdomain.</p>

<p>Copyright © 2016 William David Herndon. All rights reserved.</p>

<p>This series:</p>

<ul>
<li><strong>Part 1: The Pieces of the Puzzle</strong> &lt;- You are here</li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-2/">Part 2: Subdomains and DNS</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-3/">Part 3: Encryption and SSL Certificates</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-4/">Part 4: The Email Server(s)</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-5/">Part 5: Autoconfiguration</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/serving-email-part-6/">Part 6: Debugging Email Servers</a></li>
</ul>]]></content:encoded></item><item><title><![CDATA[Miscellaneous update]]></title><description><![CDATA[<h4 id="changestomyblogging">Changes to my blogging</h4>

<p>It's been a while. I've been busy and I set too high standards for my posts to keep up a weekly pace. So, I'm going to try and make shorter simpler posts more frequently.</p>

<p>Here are the highlights of what I've been busy with:</p>

<h5 id="installingandroidstudiohttpsdeveloperandroidcomstudioindexhtml">Installing <a href="https://developer.android.com/studio/index.html">Android</a></h5>]]></description><link>https://blog.softwareschmiede-herndon.de/miscellaneous-update/</link><guid isPermaLink="false">4ae7b1dc-a6e5-470a-8144-2bb4a3447cb0</guid><dc:creator><![CDATA[William David Herndon]]></dc:creator><pubDate>Thu, 24 Nov 2016 20:47:22 GMT</pubDate><content:encoded><![CDATA[<h4 id="changestomyblogging">Changes to my blogging</h4>

<p>It's been a while. I've been busy and I set too high standards for my posts to keep up a weekly pace. So, I'm going to try and make shorter simpler posts more frequently.</p>

<p>Here are the highlights of what I've been busy with:</p>

<h5 id="installingandroidstudiohttpsdeveloperandroidcomstudioindexhtml">Installing <a href="https://developer.android.com/studio/index.html">Android Studio</a></h5>

<div style="float:left;margin-right:1em;width:100px;"><a href="https://developer.android.com/studio/index.html"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/11/androidstudio.png"></a></div>  

<p>I installed Android Studio on a virtual machine as a start on my new series on Android development. It was very different than the first time I did it, and it took way more space than I was expecting. And then I got interrupted...</p>

<h5 id="dealingwithssltlscertificates">Dealing with SSL/TLS Certificates</h5>

<div style="float:right;margin-left:1em;"><a href="https://www.startssl.com/"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/11/sc-in_03.png"><br><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/11/sc-in_08.png"></a></div>  

<p>I have fallout from the impending removal of <a href="https://www.startssl.com/">StartCom/StartSSL</a>'s certificate from Firefox's and Chrome's list of trusted certificates. <a href="https://blog.mozilla.org/security/2016/10/24/distrusting-new-wosign-and-startcom-certificates/">Here is a Mozilla blogpost about it</a>.</p>

<p>They were the cheapest commercial source for trusted certificates, and I got certificates for my own and some websites I maintain, for a little over 100€ / year total. The next best commercial alternative would have cost me thousands of Euros for the same thing <em>and</em> been less flexible.</p>

<p>Basically, I agree with the reasons for decertification, but that left me (and thousands of others) with no viable commercial source. It disgusts me, that commercial sources require large amounts of money for little to no work. After verifying that you are who you say you are, it's basically a click of a button to create a certificate. Yet all the certificate providers (except StartCOM) charge large amounts of money for a certificate, and extra for every sub-domain of a domain you've already shown you own.</p>

<div style="float:left;margin-right:1em;"><a href="https://letsencrypt.org/"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/11/letsencrypt-logo-horizontal.svg"></a></div>

<p>Enter non-commercial <a href="https://letsencrypt.org/">Let's Encrypt!</a> The certificates they issue last only three months, but they're completely free. I found a <a href="https://devblog.plesk.com/2015/12/lets-encrypt-plesk/">plugin</a> for <a href="https://www.plesk.com/">Plesk</a> (the software I use to control my VPS) that made the transition relatively painless. Once set up, it is a lot easier to install a "Let's Encrypt" certificate than a regular certificate. I only had a few issues with websites using ProxyPass, but that's all fixed now.</p>

<p>The issue of SSL/TLS is pretty important, I'll probably do a whole blog post on it later.</p>

<h5 id="avirtualwritinggrouphttpsvirtualwritinggrouporg"><a href="https://virtualwritinggroup.org/">A Virtual Writing Group</a></h5>

<div style="float:right;margin-left:1em;"><a href="https://virtualwritinggroup.org/"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/11/quill_logo.gif"></a></div>  

<p>There were several reasons for this. A primary motivator is that I need experience with <a href="https://www.phpbb.com/">phpBB</a> for a paying project I'm working on. The requirement is for writing serialized documentation, where different people can write entries, but may not change other's entries, and when they change their own entries, those changes are documented. This is basically the same as threads in a bulletin board with login and edit logging, so that's what I will be installing for the project.</p>

<p>I've also been a hobby-writer for a long time. Years ago I was a member of a similar website, RateYourWriting.com, that is now defunct. I want a little of that flavor and a bit of the regular "writing group" flavor. I don't think a regular English-language writing group is really possible here in Marburg. Aside from the setting up phpBB I've learned about phpBB extensions and programming in <a href="http://php.net/">PHP</a> - the edit logging is also useful for the writing group and I created a word count extension. I will be releasing it to Open Source once I've got internationalization working correctly.</p>

<h5 id="ablogformyfatheronmultiplesclerosishttpswwwmultiplesclerosisblogorg"><a href="https://www.multiple-sclerosis-blog.org/">A blog for my father on Multiple Sclerosis</a></h5>

<div style="float:left;margin-right:1em;"><a href="https://www.multiple-sclerosis-blog.org/"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/11/cropped-Herndon_Robert.jpg"></a></div>  

<p>I created a blog for my father and have spent a bit of time helping him with it. <a href="https://wordpress.org/">WordPress</a> is soooo much easier than <a href="https://ghost.org/">ghost</a>. <br>
<br><br><br><br><br></p>

<h5 id="writingawebappfromscratch">Writing a WebApp from scratch</h5>

<p>There's been a feeler for a project that would start next year, and would involve writing a WebApp. I'm pretty sure I can sell this WebApp to others as well, so I'm getting a head start on it. And if it doesn't work out, at least I'll have gotten some more practice in PHP.</p>

<h5 id="installingubuntulinuxhttpswwwubuntucom">Installing <a href="https://www.ubuntu.com/">Ubuntu Linux</a></h5>

<div style="float:right;margin-left:1em;"><a href="https://www.ubuntu.com/"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/11/ubuntu.png"></a></div>  

<p>I installed Ubuntu on an old laptop that had XP, that didn't have enough space for the latest Windows XP update. The laptop also has a problem with the DVD drive - there's a loose connection, but if I hold the drive in a particular way, it will work. So I spent a few hours holding a DVD drive so it would boot and install from the boot DVD. I'm a bit surprised that Ubuntu no longer supports boot/install CDs - supporting older, resource starved devices used to be one of the big reasons for using Linux.</p>

<h5 id="bluetoothhttpswwwbluetoothcom"><a href="https://www.bluetooth.com/">Bluetooth</a></h5>

<div style="float:left;margin-right:1em;"><a href="https://www.bluetooth.com/"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/11/bluetooth.png"></a></div>

<p>First I wanted to listen to podcasts on my car radio. My car radio supports bluetooth and my smart phone supports bluetooth. After some fiddling, I got it to work.</p>

<p>Then I got a cheap bluetooth headset. Getting that to work with my smart phone was a little bit fiddly, too, but not too much trouble.</p>

<p>Trying to get bluetooth to work properly on my Windows 7 64-Bit was an utter failure. Apparently the standard bluetooth driver for my bluetooth dongle under Windows 64-bit is missing support for a lot of devices, so they recommend installing Windows 7 32-Bit. Grrrr. I may revisit this.</p>

<p><strong><em>Happy Thanksgiving! And boycott Black Friday! Spend the time with family and friends.</em></strong></p>

<p>Copyright © 2016 William David Herndon. All rights reserved.</p>]]></content:encoded></item><item><title><![CDATA[The Softwaresmith's Tools]]></title><description><![CDATA[<div style="float:left; margin-right:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/toolbox.jpeg"></div>

<p>In programming, as in most professions, the tools make the master of the craft. You have to know which tool to use when, and you have to be able to use them well.</p>

<p>My goals in this article are: (1) to act as an introduction to the tools of the</p>]]></description><link>https://blog.softwareschmiede-herndon.de/the-softwaresmiths-tools/</link><guid isPermaLink="false">624aa41b-31e8-4221-9523-7b34fc57f256</guid><dc:creator><![CDATA[William David Herndon]]></dc:creator><pubDate>Sun, 25 Sep 2016 11:53:43 GMT</pubDate><content:encoded><![CDATA[<div style="float:left; margin-right:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/toolbox.jpeg"></div>

<p>In programming, as in most professions, the tools make the master of the craft. You have to know which tool to use when, and you have to be able to use them well.</p>

<p>My goals in this article are: (1) to act as an introduction to the tools of the trade for those looking to try programming (2) to give some tips to those who are already programming and (3) as a reference for future posts - you should be seeing a lot of these tools in my future posts.</p>

<p>Since this entire post is about resources (tools are resources), there will be no "resources" at the bottom of the post; instead there will be an index to quickly find the section you want.</p>

<p>Without further ado, I humbly present what I consider to be the most important tools for the software smith:</p>

<div style="float:right;margin-left:1em;"><a href="https://commons.wikimedia.org/wiki/File:BrainLobesLabelled.jpg"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/BrainLobesLabelled-1.jpg"></a></div>  

<p><a name="thebrain"></a>  </p>

<h4 id="yourownbrain">Your Own Brain</h4>

<p>You really need to treat your brain like the tool it is: you have to keep it sharp and treat yourself right:</p>

<ul>
<li>Take frequent short breaks: 10-15 min per hour is a good rule of thumb.<a href="https://blog.softwareschmiede-herndon.de/the-softwaresmiths-tools/#footbreaks"><sup>1</sup></a></li>
<li>Make interruption-free time for complex tasks.<a href="https://blog.softwareschmiede-herndon.de/the-softwaresmiths-tools/#footinterrupt"><sup>2</sup></a></li>
<li>Get enough sleep (I'm afraid I often fail at this one). The problem for me is, the best interruption-free time is late at night...</li>
<li>Eat well - your brain consumes a lot of energy and the supply needs to be consistent. If you're eating lots of sugar, your blood sugar will be bouncing like a ball and your cognitive abilities will, too.</li>
<li>Exercise - this improves circulation and gives you a nice shot of dopamines, which helps you concentrate better.</li>
<li>Learn new, interesting stuff - "exercising" your brain helps keep it sharp through less interesting tasks.</li>
</ul>

<p><a name="searchengine"></a>  </p>

<h4 id="asearchenginegoodgooglefu">A Search Engine / Good "Google-Fu"</h4>

<p>Most people don't think of this as a programming tool, but, after the brain, it is the most important tool we have these days. When I was learning to program, search engines did not exist. Nowadays, a good search engine is completely indispensable. Here are a few basic scenarios where I need it:</p>

<p><em>There should be a picture of me applying GoogleFu to a problem here.</em></p>

<ul>
<li>Something has broken, and I need more information on how to fix it: has anyone had this problem before? If they solved it, how did they do that? Did they discover a work-around? What does this obscure error message really mean? Before search engines, you would be writing emails and waiting days for responses, or if it was really urgent, paying for expensive long-distance phone calls.</li>
<li>I need the name and/or parameters of some function in some language or library I'm less familiar with. Way back when, you could keep all the references on your shelf. Now, with new languages and platforms coming out several times a year, you would need a whole house just for the books, and a budget to match.</li>
<li>I'm trying to learn some new language or platform, and the guide I'm reading starts referencing technology x and paradigm y that I've never heard of before.</li>
</ul>

<p>The simplest search sometimes work, but as often as not, you'll need to think of 10 different ways to search for the same thing before you hit gold. Good Google-Fu is important.</p>

<div style="float:left;margin-right:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/Google.png"></div>  

<p><a href="https://www.google.com/">Google</a> is still the best, in my opinion, but has actually been going down in utility for me as they've been tuning it more towards my preferences, e.g. "no, I really don't want the Java version of this function, that's why I typed "Python". In quotes. And you're <em>still</em> ignoring it and giving me pages where the word 'Python' isn't present!"</p>

<div style="float:right;margin-left:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/DuckDuckGo.png"></div>  

<p>For most of my daily needs, I use <a href="https://duckduckgo.com/">DuckDuckGo</a>: I'm not entirely comfortable with the way Google sometimes seems to know more about me than I do. When I'm really not finding anything at DuckDuckGo, I go back to Google.</p>

<p><a name="touchtyping"></a>  </p>

<h4 id="touchtyping">Touch Typing</h4>

<p>Technically this is more a skill than a tool, but I'm still including it: it's really important.</p>

<p><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/KermitTyping.gif" alt="KermitTyping"></p>

<p>When I was 14, I decided to learn to touch type. It took about a month, filling at least two pages every day. I was lucky: I was at grandma's and got to practice on her electric typewriter, rather than on my mother's manual. In the 40 years since then, it has paid me back at least 1000-fold. That is not hyperbole, it is understatement.</p>

<p>In programming, more than in most other professions, you need to be "in the zone" to work well. To me, having to look down from the screen to hunt-and-peck just doesn't bear thinking about.</p>

<p>If you don't have one, consider getting yourself a decent keyboard. A laptop keyboard may do in a pinch, but really, you need something better. My main development computer is a laptop, but I have a separate keyboard for it.</p>

<p><a name="texteditor"></a>  </p>

<h4 id="apowerfultexteditor">A (Powerful) Text Editor</h4>

<p>I could fill a long post on text editors alone: this section was taking over half of this post and expanding, before I decided to cut it drastically.</p>

<p>It is fairly likely that at some point you're going to be bopping around in remote shells, installing stuff and fixing problems. When you do, you will need an editor that:</p>

<ul>
<li>can do <em>everything</em> from the keyboard.</li>
<li>supports advanced functions like <a href="https://en.wikipedia.org/wiki/Macro_(computer_science)#Keyboard_and_mouse_macros">keyboard macros</a></li>
<li>supports multiple windows and buffers, with copy/paste between them.</li>
</ul>

<p>There are two major text editors that fit this criteria:  <a href="https://www.gnu.org/software/emacs/">Emacs</a> and <a href="http://www.vim.org/">Vim</a>.</p>

<p><a href="http://xkcd.com/378/"><img src="https://imgs.xkcd.com/comics/real_programmers.png"></a></p>

<div style="float:left;margin-right:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/Emacs.png"></div>

<p>The original Emacs was written in 1976 by <a href="https://en.wikipedia.org/wiki/Richard_Stallman">Richard M. Stallman</a> (yes, <em>that</em> guy) and <a href="https://en.wikipedia.org/wiki/Guy_L._Steele_Jr.">Guy L. Steele, Jr.</a> (I learned Lisp from Guy at <a href="https://en.wikipedia.org/wiki/Carnegie_Mellon_University">C-MU</a>).</p>

<div style="float:right;margin-left:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/Vim.png"></div>

<p>Vim is an Open Source clone of <a href="https://en.wikipedia.org/wiki/Vi">vi</a>, a text editor written to be part of the <a href="https://en.wikipedia.org/wiki/POSIX">POSIX</a> specification. Vi was also created in the late 70s.</p>

<p>You should know one of them well enough that you can do buffer-switching and other advanced commands without having to pause to look it up. You should, at a minimum, know how to exit your less preferred editor.</p>

<p>These days, if you know neither, you should probably give the preference to Vim, because some flavor of Vim or vi is on nearly all Linux installations (due to POSIX spec), while this is not true of Emacs. Emacs is my own preferred editor.</p>

<p><a name="operatingsystem"></a>  </p>

<h4 id="operatingsystemshellandshellscripting">Operating System, Shell, and Shell-Scripting</h4>

<p>Over the years I've run into a fair few people who were of the opinion that shells are passé, that all you need is the GUI of your operating system and a good IDE, and you never need to touch those clunky old shell's with their impossible to remember commands again.</p>

<div style="float:left;margin-right:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/tux-1.jpg"></div>

<p>If you want to be an average programmer and never touch the bleeding edge again, I'd agree with that. Otherwise, <a href="https://blog.softwareschmiede-herndon.de/the-oddysey-to-the-land-of-blogging/">Exhibit A: setting up this blog</a> would not have been possible without extensive use of a Linux shell (<a href="https://www.gnu.org/software/bash/">bash</a>). When the init-script for ghost didn't work for my system, <a href="https://www.softwareschmiede-herndon.de/ghost">I rolled my own</a>. Not a serious problem when you understand the scripting language and have decent Google-Fu.</p>

<div style="float:right;margin-left:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/Windows7Logo.png"></div>

<p>"But I work under Windows!" So do I. Windows 7 is still the primary OS on my development computer. I work with a shell open at all times. I have several dozen cmd shell scripts for Windows that I wrote myself to make my life easier. Maybe I should upload the most useful of them and make a post about it. If you would like that, comment below and let me know.</p>

<div><a href="http://xkcd.com/1319/"><img src="https://imgs.xkcd.com/comics/automation.png"></a></div>

<p>As a developer, your most common choices for operating systems are: Windows, Linux, and MacOS (OSX). I will not attempt to get into the OS wars here. Suffice to say, your choice will be heavily influenced by your target audience and your budget.</p>

<p>Miscellaneous: there are multiple *nix shells, bash being the most common. It can sometimes be a problem getting a script to work in all shells being used. MacOS is based on Unix, so if you're familiar with Linux' bash, the MacOS shell isn't too hard.</p>

<p><a name="secureshell"></a>  </p>

<h4 id="asecureremoteshell">A Secure Remote Shell</h4>

<div style="float:left;margin-right:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/putty-1.jpg"></div>  

<div style="float:right;margin-left:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/RemoteDesktopConnection.png"></div>

<p>If you're doing anything with <a href="https://en.wikipedia.org/wiki/Virtual_private_server">VPS</a>, or even just with a server in your local network, then the need for remote access is pretty obvious. For *nix to *nix you'll want to use <a href="http://www.openssh.com/">OpenSSH</a> - the ssh command and sshd daemon. For Windows client to Linux server, I use <a href="http://www.putty.org/">putty</a>. For Windows to Windows, <a href="https://technet.microsoft.com/en-us/magazine/ff404238.aspx">Remote Desktop Connection</a> is my choice. I've never really needed Linux to Windows, but if I do, I'll probably just use OpenSSH for client and server, with the sshd on the Windows side running under <a href="https://cygwin.com/">CygWin</a>.</p>

<p><a name="browsers"></a>  </p>

<h4 id="browsers">Browsers</h4>

<p>Browsers have morphed into platforms in their own right. The following are the top browsers in rough order of market share:</p>

<table>  
<tr>  
<td><b>Name</b></td>  
<td><b>Logo</b></td>  
<td><b>Platform(s)</b></td>  
<td><b>Notes</b></td>  
</tr>  
<tr>  
<td><a href="https://www.google.com/chrome/browser/index.html">Chrome</a></td>  
<td><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/chrome.png"></td>  
<td>on all popular platforms</td>  
</tr><tr>  
<td><a href="https://www.mozilla.org/firefox/new/">Firefox</a></td>  
<td><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/firefox.png"></td>  
<td>on all popular platforms</td>  
</tr><tr>  
<td>  
<a href="http://microsoft.com/ie">Internet Explorer</a>  
</td>  
<td><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/internetexplorer.png"></td>  
<td>Microsoft Windows only.</td>  
</tr><tr>  
<td><a href="https://www.apple.com/safari/">Safari</a></td>  
<td><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/safari.png"></td>  
<td>iOS/macOS only.</td>  
</tr><tr>  
<td><a href="http://www.opera.com/">Opera</a></td>  
<td><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/opera.png"></td>  
<td>on all popular platforms</td>  
</tr>  
</table>  

<p>Currently, I try to make sure that all my HTML/CSS/DOM is correctly interpreted by Chrome, Firefox and IE, which covers over 90% of my target audience. When I switch to Linux as my primary platform, I will likely drop IE in favor of Opera.</p>

<p>Here are some other browsers which may be of interest:</p>

<div style="float:right;margin-left:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/MsEdge.png"></div>

<ul>
<li><a href="http://www.microsoft.com/windows/microsoft-edge">Microsoft Edge</a>- web browser that comes with Windows 10. Windows only. Interestingly, as of this writing, <a href="https://play.google.com/store/search?q=edge%20browser">there are a number of non-Microsoft browsers in the Play Store that have the word "edge" in their title.</a></li>
<li><a href="http://lynx.invisible-island.net/">Lynx</a> - text-only browser.</li>
</ul>

<p><a name="email"></a>  </p>

<h4 id="emailclient">Email Client</h4>

<p>As a programmer, you need email, but you probably don't need much by way of extras, so this section is short. Most OSes come with an email client, and many mail providers have a webmail interface. They are generally not complicated.</p>

<div style="float:left;margin-right:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/outlook.jpg"></div>

<p>The company I worked for had me using <a href="https://products.office.com/en-US/outlook/email-and-calendar-software-microsoft-outlook">Outlook</a><a href="https://blog.softwareschmiede-herndon.de/the-softwaresmiths-tools/#footoutlook"><sup>3</sup></a> with <a href="https://products.office.com/en-us/exchange/email">Microsoft Exchange Server</a> for many years, while I used the webmail interface of <a href="http://www.aol.com/">AOL</a> and a more local mail service for private email. That was acceptable.</p>

<div style="float:right;margin-left:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/Thunderbird.png"></div>

<p>Now I've switched to accessing all of my email addresses using <a href="https://www.mozilla.org/en-US/thunderbird/">Thunderbird</a>. I like this better.</p>

<div><a href="http://theoatmeal.com/comics/email_address"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/OatmealEmail.jpg"></a></div>  

<p>(I have both my own domain <em>and</em> an AOL address. What does that say about me?)</p>

<p><a name="filecopy"></a>  </p>

<h4 id="securefilecopy">(Secure) File Copy</h4>

<p>My primary tools for transferring files are:</p>

<div style="float:right;margin-left:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/filezilla.png"></div>

<ul>
<li><a href="https://filezilla-project.org/">FileZilla</a> - A graphical "ftp solution". I use this mostly to update websites.</li>
<li><a href="http://linux.die.net/man/1/scp">scp</a> - Secure CoPy, a basic *nix tool. Under Windows I will sometimes open CygWin shell just to use scp to copy a file to/from a folder not reachable by ftp. I should probably look into a native SCP for Windows - I use it often enough.</li>
<li><a href="https://curl.haxx.se/">curl</a> - a data transfer program, supporting ftp(s), http(s), and an insane number of other formats.</li>
<li>Default <strong>ftp</strong> client - both Linux and Windows have a default command line ftp client.</li>
</ul>

<p><a name="versioncontrol"></a>  </p>

<h4 id="versioncontrol">Version Control</h4>

<p>I've been using some type of version control since ca. 1990, long before it became de rigueur - it has saved my butt innumerable times. Even when it wasn't saving my butt, it allowed me to proceed more quickly when making far reaching changes: a simple click or command for backup and after a short pause, I can proceed.</p>

<div style="float:left;margin-right:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/sourcesafe.jpg"></div>

<p>Under Visual Studio I originally used <a href="https://blog.softwareschmiede-herndon.de/the-softwaresmiths-tools/">Visual SourceSafe (VSS)</a>. There were numerous problems with it, especially through remote access (Darn it, Microsoft! Who doesn't use version control remotely?!). But it was still better than no version control. Later I used <a href="https://blog.softwareschmiede-herndon.de/the-softwaresmiths-tools/">Team Foundation</a> with Visual Studio. It did its job well.</p>

<div style="float:right;margin-left:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/subversion.png"></div>

<p>For side projects I used to use <a href="https://blog.softwareschmiede-herndon.de/the-softwaresmiths-tools/">Concurrent Versions System (cvs)</a>, then <a href="https://blog.softwareschmiede-herndon.de/the-softwaresmiths-tools/">Subversion (svn)</a>. I was happy with both.</p>

<div style="float:left;margin-right:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/git.png"></div>

<p>Now I use <a href="https://blog.softwareschmiede-herndon.de/the-softwaresmiths-tools/">git</a> for everything, it works well on the command line and is integrated into most of the IDEs I use.</p>

<div><a href="http://xkcd.com/1597/"><img src="https://imgs.xkcd.com/comics/git.png"></a></div>

<p><a name="filediff"></a>  </p>

<h4 id="filedifference">File Difference</h4>

<p>I find it necessary to look at the difference between files in three cases: (1) I am about to commit my changes, and I want to check that the changes are clean (no debug output, comments cleaned up, etc.), (2) to merge conflicting versions and (3) to review someone else's changes. </p>

<p>Under Windows I still use <a href="https://en.wikipedia.org/wiki/WinDiff">windiff</a>, which came with the Microsoft Windows SDK, but is no longer supported. I'm going to miss it when it stops working.</p>

<p>Under Linux or when I'm restricted to text-only, I use the standard Linux utility <a href="https://en.wikipedia.org/wiki/Diff_utility">diff</a>.</p>

<p><a name="textsearch"></a>  </p>

<h4 id="textsearch">Text Search</h4>

<p>Under DOS and then later Windows I used the <a href="https://en.wikipedia.org/wiki/Norton_Utilities">Norton Utilities</a> program ts for text-search. After moving to 32-bit, I actually wrote my own replacement - I found it overblown to pay for a program I could write inside of an hour.</p>

<p>Under Linux I use <a href="https://en.wikipedia.org/wiki/Grep">grep</a>, of course</p>

<p><a name="virtualization"></a>  </p>

<h4 id="virtualizationemulationsoftware">Virtualization / Emulation Software</h4>

<div style="float:right;margin-left:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/VirtualBox.png"></div>

<p>As a developer for commercial programs, the programs usually need(ed) to run on multiple versions of Windows (or other OS). Way back when, we had to have separate machines for each operating system. Now I use <del>Innotek</del> <del>Sun</del> <a href="https://www.virtualbox.org/">Oracle VirtualBox</a>. I have Windows in four flavors, Linux in two flavors and even Android (technically also Linux) in three flavors, all on my server. I don't use the server itself for anything else.</p>

<div style="float:left;margin-right:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/cygwin-1.png"></div>

<p>When I need a Unix-like environment under Windows, where you can use *nix tools and scripts, I use <a href="https://cygwin.com/">CygWin</a>.</p>

<p><a name="ide"></a>  </p>

<h4 id="integrateddevelopmentenvironmentide">Integrated Development Environment (IDE)</h4>

<p>IDEs generally try to be the be-all, end-all environment that you never have to leave, with integrated text-editing, compilation, debugging and other tools. The IDE of your choice usually depends on your developer platform and target platform.</p>

<div style="float:right;margin-left:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/eclipse.png"></div>

<ul>
<li>The most versatile Open Source IDE is <a href="http://www.eclipse.org/">Eclipse</a>. You can configure it to target almost any platform, including Windows, but...</li>
</ul>

<div style="float:right;margin-left:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/VisualStudio.jpg"></div>

<ul>
<li>If your target is Microsoft Windows, then you'll likely be using <a href="https://www.visualstudio.com/">Microsoft Visual Studio</a>. It's actually pretty decent for other targets, too.</li>
</ul>

<div style="float:right;margin-left:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/AndroidStudio.png"></div>

<ul>
<li>If you're programming for Android, you'll most likely be using <a href="https://developer.android.com/studio/index.html">Android Studio</a></li>
</ul>

<div style="float:right;margin-left:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/Emacs.png"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/Vim.png"></div>

<ul>
<li><a href="http://emacs-ide.tuxfamily.org/">Emacs</a> and <a href="http://www.vim.org/scripts/script.php?script_id=4599">Vim</a> - yes, both of these text editors can be used as an IDE. If you're in a text-only remote shell, this can be important.</li>
</ul>

<div style="float:right;margin-left:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/gdb.png"></div>

<ul>
<li><a href="http://sourceware.org/gdb/">GDB</a> - not really, but: if while debugging you type Ctrl-X "A", it will enter <a href="https://www.sourceware.org/gdb/onlinedocs/gdb/TUI.html#TUI">"TUI Mode"</a>, which will allow windowed debugging as if in an IDE, with Emacs-like commands.</li>
</ul>

<p>I've used all of the above, and am actually pretty happy with all of them.</p>

<p><a name="compiler"></a>  </p>

<h4 id="compilerinterpreter">Compiler/Interpreter</h4>

<div style="float:left;margin-right:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/gcc.png"></div>

<p>Not going to say much here. There's too many, and the choice is often made for you, depending on what you want to do. I used to make short programs, like calculating the prime numbers under a thousand, in <a href="https://en.wikipedia.org/wiki/GW-BASIC">gwbasic</a>, but that has stopped working. Now I usually do things like that in C/C++ using <a href="https://en.wikipedia.org/wiki/GNU_Compiler_Collection">gcc</a>.  </p>

<h4 id="index">Index</h4>

<ul>
<li><a href="https://blog.softwareschmiede-herndon.de/the-softwaresmiths-tools/#thebrain">The Brain</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/the-softwaresmiths-tools/#searchengine">Search Engine</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/the-softwaresmiths-tools/#touchtyping">Touch Typing</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/the-softwaresmiths-tools/#texteditor">Powerful Text Editor</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/the-softwaresmiths-tools/#operatingsystem">OS / Shell Scripting</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/the-softwaresmiths-tools/#secureshell">Secure Remote Shell</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/the-softwaresmiths-tools/#browsers">Browsers</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/the-softwaresmiths-tools/#email">Email Client</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/the-softwaresmiths-tools/#filecopy">File Copy</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/the-softwaresmiths-tools/#versioncontrol">Version Control</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/the-softwaresmiths-tools/#filediff">File Difference</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/the-softwaresmiths-tools/#textsearch">Text Search</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/the-softwaresmiths-tools/#virtualization">Virtualization Software</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/the-softwaresmiths-tools/#ide">Integrated Development Environment</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/the-softwaresmiths-tools/#compiler">Compiler/Interpreter</a></li>
</ul>

<h4 id="footnotes">Footnotes</h4>

<p><a name="footbreaks">1</a> <a href="http://www.theatlantic.com/business/archive/2014/09/science-tells-you-how-many-minutes-should-you-take-a-break-for-work-17/380369/">Article from <em>The Atlantic</em>, 2014 "A Formula for Perfect Productivity: Work for 52 Minutes, Break for 17"</a> <br>
<a name="footinterrupt">2</a> <a href="http://heeris.id.au/2013/this-is-why-you-shouldnt-interrupt-a-programmer/">This is why you shouldn't interrupt a programmer - The Slightly Disgruntled Scientist</a> <br>
<a name="footoutlook">3</a> Outlook full version, not to be confused with Outlook Express.</p>

<p>Copyright © 2016 William David Herndon. All rights reserved.</p>]]></content:encoded></item><item><title><![CDATA[Responsive Web Design: An Interview with Matthias Labsch]]></title><description><![CDATA[<p>I've been seeing Web-Comics do a lot of "guest strips" for each other, and I usually like them. That gave me the idea, that I'd like to do a similar type of cooperation with developers. I've known Matthias for a few years, and so I talked to him about it.</p>]]></description><link>https://blog.softwareschmiede-herndon.de/responsive-web-design-an-interview-with-matthias-labsch/</link><guid isPermaLink="false">f9a34d6e-bb0f-4fa3-911d-b4be6ccc00d8</guid><dc:creator><![CDATA[William David Herndon]]></dc:creator><pubDate>Sun, 11 Sep 2016 15:58:45 GMT</pubDate><content:encoded><![CDATA[<p>I've been seeing Web-Comics do a lot of "guest strips" for each other, and I usually like them. That gave me the idea, that I'd like to do a similar type of cooperation with developers. I've known Matthias for a few years, and so I talked to him about it. He doesn't have a lot of time, so we came up with the idea of an interview: maximum information for minimum time on his part. Responsive Web Design is a hot topic and relevant to both blogging software (covered) and Apps (I want to cover). So, I interview, I slap on some pictures and references. Voila!</p>

<p><strong>Tell me a little about yourself, what you do and where you work.</strong></p>

<div style="float:right;margin-left:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/MatthiasLabsch.jpg"></div>  

<p>So, my name is Matthias Labsch, I am a 34 year old front-end developer living in Freiburg, Germany. Currently I am working for a small marketing agency where I am responsible for front-end development using HTML 5, CSS 3 and AJAX on a WordPress basis. My main focus is Responsive Web Design and Accessibility.</p>

<p><strong>Is there a special reason for the focus on accessibility? Your target customer?</strong></p>

<p>During my work in several companies, it crossed my mind that most of the techniques I used for valid HTML pages and Responsive Web Design (RWD) are also a step closer to accessible websites. To name an example:</p>

<div style="float:left;margin-right:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/NumericInput.png"></div>

<p>If you're using a more specific &lt;input type="number" /&gt; instead of a simple &lt;input type="text" /&gt; (which also accepts numbers), you will greatly enhance the possibility of screen readers to tell the user what kind of information they are requested to enter. As a byproduct, mobile devices will use a customized keyboard (e. g. only numbers) to assist the user.</p>

<p>My own handicap<a target="_self" href="https://blog.softwareschmiede-herndon.de/responsive-web-design-an-interview-with-matthias-labsch/#handicap"><sup>*</sup></a> is just another reason to dive deeper into accessibility, as I am not dependent on special devices to use my computer or the internet. But while I am able to get my information from the internet very easily, I know many other people with disabilities who depend on assistive devices and techniques.</p>

<p><strong>So, your target customer is not the reason - it's just plain good design to be accessible?</strong></p>

<p>Exactly! My opinion is: if I can create an accessible website with a small effort, why shouldn't I? Most techniques for RWD are one step in this direction, so I am eager to go the next step as well. But there's still a lot to learn &#x1f60a;</p>

<p><strong>So, getting to the main theme:
How would you define "Responsive Web Design"?</strong></p>

<p>RWD is a collection of many techniques to enable a website to adapt to different viewports without changing its source code. The most important approaches are (in my humble opinion) Mobile First, Progressive Enhancement and a good content structure. On top of that developers have a wide range of techniques like fluid grids, responsive images and so on.</p>

<p><strong>What are the basic principles of RWD?</strong></p>

<p>Let's take the three approaches I mentioned before.</p>

<div style="float:right;margin-left:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/MobileFirst.png"></div>  

<p><em>Mobile First</em> is the concept where you develop your website and content so that mobile devices are favoured above desktop computers. This will force both the developer and the content engineer to emphasize the most important content first and create the source code accordingly.</p>

<p>This leads to the second approach, <em>Progressive Enhancement</em>. With Progressive Enhancement, you will enhance your content with more information and your website with more features, e. g. on your mobile device you will only see the websites header, the selected article and a footer. On a tablet, an additional sidebar will be visible and on a desktop computer you will see a fancy slider above the content. This way, your websites performance will be increased because you don't have to hide bandwidth-intensive features like the slider on mobile devices.</p>

<div style="float:left;margin-right:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/Frameworks.png"></div>  

<p>To achieve this, there are many good techniques and architectures. Many frameworks like <a href="http://twitterbootstrap.org/">Twitter Bootstrap</a> or <a href="http://foundation.zurb.com/">Foundation</a> offer a wide range of features while architectures like <a href="http://itcss.io/">ITCSS (Inverted Triangle architecture for CSS)</a>, <a href="http://oocss.org/">OOCSS (Object Oriented CSS)</a> or <a href="https://en.bem.info/">BEM (Block, Element, Modifier)</a> will help you to organize your CSS.</p>

<p><strong>"Graceful Degradation" is a decades old concept that applies to other engineering fields, too: when resources are limited, fall back to less resource intensive alternatives and/or leave things out. Is there a real practical difference between this and "Progressive Enhancement"? Or is it just a difference in where you start?</strong></p>

<div style="float:right;margin-left:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/GracefulDegradation.gif"></div>  

<p>Both principles are legitimate and depend on your customer: if my customer wants to have a desktop-only website and decides later on that a mobile version is a must-have now, I would use Graceful Degradation - but with a huge cramp in my stomach. Experience shows at some point <strong><em>every</em></strong> customer wants to have a mobile version of their website. The reasons are manifold: bad Google ranking, user feedback, a change of mind and so on.</p>

<p>So for me, my preferred approach would be Progressive Enhancement. And as I said earlier: the code will be more performant. Just imagine that you can build up your CSS in a way that is cumulative, meaning the styles for the mobile viewport are loaded first, after that only changes for the next viewports are loaded because they enhance the code before. I do not want to condemn Graceful Degradation, but it's not my favoured approach.</p>

<p><strong>So, you're saying there really is a practical difference: that (usually) large chunks of the website are loaded before being discarded in the graceful degradation approach?<br>
Is that a fair paraphrasing?</strong></p>

<p>Of course! Normally, you will have one CSS file (independent of whether you're using a CSS precompiler or not), so with Graceful Degradation you will find the source for e. g. the slider near the top of the file - which is loaded by a mobile device, but not executed. The mobile device now has to crawl its way down to the breakpoint responsible for its viewport and "forget" the loaded code.</p>

<p>Way better: load the code for the mobile viewport first and then ignore the following code because it is code for another viewport.</p>

<p><strong>So, tell me a little about some of these terms you've mentioned. What about "responsive images"?</strong></p>

<div style="float:left;margin-right:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/ResponsiveImages.png"></div>  

<p>Regarding images, one major problem of RWD is: how to deal with images? It is possible to scale images, of course, but this is not the best solution in terms of performance.</p>

<p>One solution could be srcset, where you define multiple sources of an image within the srcset attribute in relation to a given viewport to display images of different quality in the viewport. A step further away is picturefill, where you are using the &lt;picture&gt; element to display different images within the changing viewports. This enhances the possibilities of srcset with the option of "art direction": you can use other images with their own srcset to e. g. display just one prominent tree (in mobile viewport) while you display the whole forest on desktop.</p>

<p>Regarding responsive images: if you want to have further information, this is a good article (German): <a href="https://blog.kulturbanause.de/2014/09/responsive-images-srcset-sizes-adaptive/">"Responsive Images" at the blog "Kulturbanause"</a>. <a href="https://translate.google.com/translate?sl=de&amp;tl=en&amp;js=y&amp;prev=_t&amp;hl=en&amp;ie=UTF-8&amp;u=https%3A%2F%2Fblog.kulturbanause.de%2F2014%2F09%2Fresponsive-images-srcset-sizes-adaptive%2F&amp;edit-text=&amp;act=url">Google translation of same.</a></p>

<p><strong>And "fluid grids"? Is that anything like CSS3 flexible box?</strong></p>

<div style="float:right;margin-left:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/GridLayout.png"></div>  

<p>Here is a link to some examples: <a href="http://getbootstrap.com/examples/grid/">Fluid Grid examples from Twitter Bootstrap</a></p>

<p>It's the most beautiful way to distribute your columns, because you can say it doesn't make sense to display a 25% width column on a mobile viewport, so I will use my breakpoints to say that on a mobile viewport, every column is 100% width and my information is stacked on each other. Then I can distribute my columns in the way I want to. This is a slightly advanced usage of fluid grids, but mainly fluid grids means you have a percentage value for your columns and thus you're able to have this very fluid design as you can see here.</p>

<p><strong>One of the major uses of columns is to get things next to each other horizontally. This kind of stacking one over the other doesn't allow the user to move horizontally in a mobile viewport as he would on a desktop. Like with a table, where you want to be able to look at adjacent elements both horizontally and vertically. How yould you do that?</strong></p>

<div style="float:left;margin-right:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/ColoredTable.png"></div>  

<p>There are several solutions. I cannot explain them in detail, because I have to look it up. But there's a project called <a href="https://bradfrost.github.io/this-is-responsive/patterns.html">Responsive Patterns</a> library, and they have different solutions for that problem. One solution would be that you use colors so that you can tell which row you are in when scrolling. Or you can make use of "data tables", a JavaScript library which allows you to sort your table and filter your table and so forth. In some cases you might want to display your table as a pie chart or other chart in general.</p>

<p><strong>&lt;picture&gt; is HTML5, and picturefill, if I'm rightly informed, is even more cutting edge. Do you run into problems with browser support?</strong></p>

<p>&lt;picture&gt; is not supported by old IE browsers, picturefill is a JavaScript polyfill library to enhance these browsers with the new element. If you need further information which browsers are supporting the &lt;picture&gt; element, have a look at <a href="http://www.caniuse.com/">"Can I Use"</a></p>

<p>So if you're looking for "picture" you will see that IE Edge will support &lt;picture&gt;, but none of the older versions of IE. picturefill.js will enable &lt;picture&gt; support down to IE 8 as far as I know ...</p>

<p><strong>It looks like people stuck with an old Android Browser are also out of luck.<br>
Is that an issue for you or your customers?</strong></p>

<div style="float:right;margin-left:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/DeathOfIE6.png"></div>  

<p>Not really because most of our customers agreed on our recommendation to support the two latest versions of each browser, if the market share is significant.</p>

<p>A good source for responsive workarounds: <a href="https://bradfrost.github.io/this-is-responsive/patterns.html">Responsive Patterns</a></p>

<p><strong>What is "Adaptive Web Design" and how is it different than "Responsive"?</strong></p>

<p>Uh, that's a tricky question because most techniques used for responsive design are also used for adaptive design &#x1f604; I would say that adaptive design just distinguishes between viewports and loads a design just for that specific viewport while responsive design tries to fit in the marginal differences between the devices. As an example: adaptive design will provide a 320 px wide design for all mobile devices while responsive design is able to cope with slight width differences between Android and iPhone versions.</p>

<div style="float:left;margin-right:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/lazy-road-demotivational-poster.png"></div>  

<p>Or simplified: adaptive design is a lazy version of responsive design because it just shows one design for a bunch of device viewports &#x1f604;</p>

<p><strong>When should I not care about Responsive Web Design?</strong></p>

<p>When it is clear for you and your customer that they will not have a mobile version of their website, e. g. when the website will run in an intranet exclusively.</p>

<p>Another reason could be the costs for a mobile version.</p>

<p><strong>You were talking about accessibility earlier - do you support blind users who might be using a text-only browser, such as lynx?<br>
Conversely, do you have any recommendation for a blind user?</strong></p>

<div style="float:right;margin-left:1em;"><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/BlindWithTablet.png"></div>  

<p>To answer your first question: I would hide certain areas of my content with display: none and mark it with ARIA labels so that the screen reader will ignore it.</p>

<p>Unfortunately, I never used a screen reader for testing, so I cannot give any recommendations. But I think I will due to the blindness of my aunt and a friend of mine.</p>

<p><strong>A lot of interactive services are now in both Web and App form, such as facebook and memrise. Do you have any comments on this trend?<br>
(I suspect they do this, because they find RWD too hard)</strong></p>

<p>The more I am using Facebook and YouTube on my smartphone, the more I like the responsive browser versions - simply because I can use an ad blocker there to get rid off these bloody adverts &#x1f604;</p>

<p><strong>&#x1f60a;<br>Most web sites these days are based on some CMS framework:
WordPress, Joomla, Drupal, et al.<br>Do some of them support Responsive Web Design better than others?<br>What should I look for in a CMS?</strong></p>

<p>I am unfortunately not familiar with Drupal or Joomla, but the latest update of WordPress introduced built-in support for responsive images (via srcset). </p>

<p>Another important thing should be that the CMS is able to use themes (which can be responsive then) and that it should be possible to minimize and concat source files for CSS and JS. This is not directly related to RWD, but is a sideshow regarding performance (which is a must-have when we are talking about RWD).</p>

<p><strong>Okay. Conversely, any advice for experienced programmers looking to do things themselves?<br>
What further articles, books, or other resources do you recommend?<br>Any particular authors/bloggers?</strong></p>

<p>Okay, if you want to start as an experienced developer you should get familiar with the basic principles of Mobile First, Progressive Enhancement and Content Choreography. Next, try to study common principles (fluid grid, responsive images, forms) by looking at a CSS framework like Twitter Bootstrap and then looking up the principles used there by reading the articles of some very awesome front-end evangelists, e. g. <a href="http://bradfrost.com/blog/">Brad Frost</a>, <a href="http://www.lukew.com/">Luke Wroblewski</a>, <a href="http://ethanmarcotte.com/">Ethan Marcotte</a> or <a href="https://stuffandnonsense.co.uk/podcast">Andy Clarke</a>. While reading their articles, you will automatically stumble over more interesting topics which will help to improve your (responsive) web design: <a href="http://atomicdesign.bradfrost.com/">Atomic Design</a>, <a href="https://bradfrost.github.io/this-is-responsive/patterns.html">Responsive Design Pattern</a> and so on.</p>

<p>For general information and inspiration, please have a look at <a href="https://www.smashingmagazine.com/">Smashing Magazine</a> - it's the largest and most well-known magazine about web development. And they are based in Freiburg, too! &#x1f60a; And last but not least, ask me or have a look at my website, <a href="http://devonwheels.net/">Dev On Wheels</a> &#x1f609;</p>

<p><strong>Thank you very much! &#x1f60a;</strong></p>

<p>You're welcome! That was fun! &#x1f60a;</p>

<h3 id="lessonsimgsrccontentimages201608lessonspng">Lessons <img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/lessons.png"></h3>

<ul>
<li>Interviews are fun!</li>
<li>There's always more to learn.</li>
</ul>

<h3 id="resourcesimgsrccontentimages201608toolboxjpeg">Resources <img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/toolbox.jpeg"></h3>

<ul>
<li><a href="http://twitterbootstrap.org/">Twitter Bootstrap (home)</a><br>
<a href="http://getbootstrap.com/">Bootstrap Resources</a><br><a href="http://getbootstrap.com/examples/grid/">Fluid Grid Examples</a>  </li>
<li><a href="http://foundation.zurb.com/">Zurb Foundation</a></li>
<li><a href="http://www.creativebloq.com/web-design/manage-large-scale-web-projects-new-css-architecture-itcss-41514731">ITCSS (Inverted Triangle architecture for CSS) - Explanatory article at Creative Bloq</a><br><a href="http://itcss.io/">itcss.io - which leads to the ITCSS twitter feed</a><br>The ITCSS Primer article (at Net Magazine or elsewhere) appears to be missing.</li>
<li><a href="http://oocss.org/">OOCSS (Object Oriented CSS)</a></li>
<li><a href="https://en.bem.info/">BEM (Block, Element, Modifier)</a></li>
<li><a href="https://blog.kulturbanause.de/">Blog "Kulturbanause" (German language)</a><br>
<a href="https://blog.kulturbanause.de/2014/09/responsive-images-srcset-sizes-adaptive/">Article "Responsive Images"</a> / <a href="https://translate.google.com/translate?sl=de&amp;tl=en&amp;js=y&amp;prev=_t&amp;hl=en&amp;ie=UTF-8&amp;u=https%3A%2F%2Fblog.kulturbanause.de%2F2014%2F09%2Fresponsive-images-srcset-sizes-adaptive%2F&amp;edit-text=&amp;act=url">Google translation</a>  </li>
<li><a href="https://bradfrost.github.io/this-is-responsive/patterns.html">Responsive Patterns</a></li>
<li><a href="http://www.caniuse.com/">"Can I use"</a> - enter a feature and see which browser versions support the feature and what percentage of users are covered.</li>
<li><a href="http://bradfrost.com/blog/">Brad Frost's blog</a></li>
<li><a href="http://www.lukew.com/">Luke Wroblewski's website</a></li>
<li><a href="http://ethanmarcotte.com/">Ethan Marcotte's website</a></li>
<li><a href="https://stuffandnonsense.co.uk/podcast">Andy Clarke's Podcast, "Unfinished Business"</a></li>
<li><a href="https://www.smashingmagazine.com/">Smashing Magazine</a></li>
<li><a href="http://devonwheels.net/">Matthias Labsch's website "Dev On Wheels"</a></li>
</ul>

<h3 id="footnotesimgsrccontentimages201608monty_python_footpng">Footnotes <img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/Monty_python_foot.png"></h3>

<p><a id="handicap"><sup>*</sup></a>Matthias has a rare form of muscular dystrophy</p>

<p>Copyright © 2016 William David Herndon. All rights reserved.</p>]]></content:encoded></item><item><title><![CDATA[Monetization Difficulties (Updated 6-Sep-2016)]]></title><description><![CDATA[<p>Already read before the update? <a href="https://blog.softwareschmiede-herndon.de/monetization-difficulties/#update1">Jump to the update</a> <br>
<strong><a href="https://en.wikipedia.org/wiki/TL;DR">tl;dr:</a></strong> Google AdSense should be working properly soon.</p>

<p>With all the ads I've been seeing for and by Google Adsense everywhere, I thought it would be simple to sign up. Maybe not the big money-earner, but it should be simple,</p>]]></description><link>https://blog.softwareschmiede-herndon.de/monetization-difficulties/</link><guid isPermaLink="false">0c739c20-d6ae-46e5-9e10-7d33354ba8bb</guid><dc:creator><![CDATA[William David Herndon]]></dc:creator><pubDate>Fri, 26 Aug 2016 22:53:45 GMT</pubDate><content:encoded><![CDATA[<p>Already read before the update? <a href="https://blog.softwareschmiede-herndon.de/monetization-difficulties/#update1">Jump to the update</a> <br>
<strong><a href="https://en.wikipedia.org/wiki/TL;DR">tl;dr:</a></strong> Google AdSense should be working properly soon.</p>

<p>With all the ads I've been seeing for and by Google Adsense everywhere, I thought it would be simple to sign up. Maybe not the big money-earner, but it should be simple, right?</p>

<p>Ha.</p>

<h4 id="findingsense">Finding Sense</h4>

<p>Before this blog even existed, I thought I'd go ahead and register for it. The first problem was even getting to Adsense: I had seen ads for it, but when I went to my Google business account, it wasn't in the menu. Nowhere was there a link. Seriously? I need to google it? I didn't even remember the name - Google Ad-something. <em>sigh</em></p>

<p><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/sherlock.png" alt="Sherlock"></p>

<p><a href="https://www.google.com/adsense/">Google AdSense is here.</a></p>

<h4 id="doesitmakesenseforyourwebsite">Does it make sense for your website?</h4>

<p>One needs a Google business account with all that entails, but I already had that<a href="https://blog.softwareschmiede-herndon.de/monetization-difficulties/#note1"><sup>*</sup></a>. I was already advertising my business with Google AdWords.</p>

<p>After creating an AdSense account (or whatever you call linking up your account with AdSense), you enter "Your website". I put in the website "<a href="http://www.softwareschmiede-herndon.de">http://www.softwareschmiede-herndon.de</a>", which is pretty much the same now as it was then. (<del>Which reminds me, I should add a link to this blog in latest news!</del> done)</p>

<p>I got a message, telling me that the website wasn't really suitable for AdSense, that the details would be in an email. I didn't think to look more seriously at the message, it would all be in the email, right?</p>

<p>I never got an email.</p>

<p><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/charlie-brown-mailbox.gif" alt="Empty Postbox"></p>

<p>I check my spam folder every day, too. Not just when I'm expecting an email.</p>

<p>I figured my website really wasn't very suitable - it's mainly an advertisement for my business, who's going to want to see someone else's ads there as well? Plus it didn't have a privacy policy yet - it didn't use cookies, there was no registration, why would it need a privacy policy? So, I decided to wait until I had started this blog and made a privacy policy, and then try again.</p>

<h4 id="nonsense">Nonsense!</h4>

<p>So, I started this blog, I have an occasional reader. It has the right kind of content, I think. I go back to "<a href="https://www.google.com/adsense">https://www.google.com/adsense</a>". It is still telling me to refer to the email:</p>

<p><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/Adsense1.png" alt="AdSense1"></p>

<p>But now I have a new Website! With Privacy Policy! It even has the popup about cookies! So, I enter the website you are now reading and press [Save and Continue].</p>

<p>At first, I think the click doesn't take. My mouse is sometimes buggy that way. Then I notice the little message.</p>

<p><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/Adsense2-1.png" alt="AdSense2"></p>

<p>"Cannot connect to the server"? Which server? Mine or one of theirs?</p>

<p>I double- and triple-check my own server. I use a proxy to reach it from the US - no trouble. I try different browsers: no problem. Maybe they're having trouble with the certificate for some reason, even though no else does. Nope: same message for vanilla http.</p>

<p>Maybe it really was their server. I try again an hour later - same problem. A day later. Same.</p>

<p>It can't be their server, not over more than 24 hours. It's not the reachability my server. This message is flat out lying to me.</p>

<p>When all else fails, <a href="https://en.wikipedia.org/wiki/RTFM">RTFM</a> - I click on the help link.</p>

<p><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/Adsense3.png" alt="Adsense3"></p>

<p>Clicking on those two helpful links to google/adsense? You got it: takes me straight back to the original unhelpful page.</p>

<h4 id="salvation">Salvation?</h4>

<p>I search for others who have had this problem. I find one! Someone who never got their email either. The (Google) Forum says "hey, go to this help location for AdSense, there you can enter your problem. It'll ask for your transaction number from the email, which you don't have, so enter blah-blah instead. You'll get a chat, you can explain the problem, they're very friendly, and you'll be good to go.</p>

<p>There was a reply: "I tried it. It worked. Thanks!" Salvation is at hand!</p>

<p><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/200-1-.gif" alt="Dancing"></p>

<p>I click on the link. It redirects:</p>

<p><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/Adsense1.png" alt="AdSense1"></p>

<p><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/facepalm-1.jpg" alt="facepalm"></p>

<p>At this point, you can tell I really don't like bothering people and asking for help. Classic male behavior.</p>

<p>More than a week has gone by - I've been busy.</p>

<p>Sometimes, it helps to have a fresh take.</p>

<p>Two things have occurred to me:</p>

<ul>
<li><p>I haven't registered the blog with <a href="https://www.google.com/webmasters/tools">Google Webmaster Tools</a>, the way I have with all my other websites.</p></li>
<li><p>What was that stuff off to the right on the help page?</p></li>
</ul>

<p><del>Wish me luck!</del> See the update below.</p>

<h4 id="whatnosnappytitle">What, No Snappy Title?</h4>

<p>Apparently there are no synonyms for "monetize" and "monetization" - all the top websites claim to have synonyms, but "coinage" and "validation" just don't cut it. And "monetisation"? Really freethesaurus.com?</p>

<h3 id="aidupdate1update6sep2016a"><a id="#update1">Update 6-Sep-2016</a></h3>

<p><strong><a href="https://en.wikipedia.org/wiki/TL;DR">tl;dr:</a></strong> AdSense would only accept the main site, not the blog subdomain, and I needed a privacy policy on the main site.</p>

<p>That stuff off to the right on the help page that I thought might help:</p>

<ul>
<li><strong>Common application problems</strong>:
<ul><li>enable cookies (already checked)</li>
<li>enable SSL 2.0 (already checked)</li>
<li>clear cache (already tried)</li>
<li>check the email message (not received)</li>
<li>check spam folder (duh!)</li>
<li>verify correct email entered (already checked)</li>
<li>what if I entered the wrong email (it was correct)</li>
<li>what if the name doesn't fit (really?)</li></ul></li>
</ul>

<p><i>&rarr; Did I maybe read this and forget it? This is obvious stuff.</i></p>  

<ul>
<li><em>Cancel my application</em>:
<ul><li>If you haven't been accepted, then there's nothing to cancel.</li></ul></li>
</ul>

<p><i>&rarr; Okay. Not very helpful to me.</i></p>

<p>So that still leaves us with that first page: the website content. Maybe, just maybe, it is rejecting the blog out of hand as a sub-domain, and www.softwareschmiede-herndon.de due to lack of privacy policy and/or missing cookie warning.</p>

<p>Adding the cookie-warning turned out to be more of a pain than I thought (scripts working across frames are a bitch), so I ended up reverting to a working version, and just adding a privacy policy. I tried submitting the blog again, which of course failed. Then I tried www.softwareschmiede-herndon.de again.</p>

<p>Hooray! We're a step further!</p>

<p><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/adsense-review.png" alt="adsense-review"></p>

<p>Sunday night, I get the email. It's in German for some reason, but "Welcome to AdSense"!</p>

<p><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/adsense-accept.png" alt="adsense-accept"></p>

<p>It tells me that the first ads will be blank, that I need to put the first ads on the main site, and warns that clicking on the ads myself is a violation of their terms.</p>

<p>So, I placed the first one at the bottom of the start page at <a href="https://www.softwareschmiede-herndon.de/">https://www.softwareschmiede-herndon.de/</a></p>

<p>On Monday I get another email, back to English:</p>

<p><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/09/adsense-accept2.png" alt="adsense-accept2"></p>

<p>Hooray!</p>

<p>The link leads me back to the page where I got the code that is currently appearing as a blank, so I'm leaving it for the moment. If it doesn't start working soon, I'll try regenerating the ad code.</p>

<p>I've added the ad code to the blog; currently at the very bottom of every page.</p>

<h3 id="lessonsimgsrccontentimages201608lessonspng">Lessons <img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/lessons.png"></h3>

<ul>
<li><p><a href="https://en.wikipedia.org/wiki/RTFM">Read The Friggin' Manual</a></p></li>
<li><p>Painful as it sometimes is, Read <em>the entire</em> Friggin Manual.</p></li>
<li><p>Sometimes I miss things that have been staring me in the face: "take a step back" from the problem.</p></li>
</ul>

<p><b>Update:</b></p>

<ul>
<li>Perseverance pays.</li>
</ul>

<h3 id="resourcesimgsrccontentimages201608toolboxjpeg">Resources <img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/toolbox.jpeg"></h3>

<ul>
<li><a href="https://blog.softwareschmiede-herndon.de/monetization-difficulties/business.google.com">Google "My Business"</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/monetization-difficulties/www.google.com/adsense">Google AdSense</a></li>
<li><a href="https://www.google.com/webmasters/tools">Google Webmaster Tools</a> - this is free and has been very helpful.</li>
</ul>

<h3 id="footnotesimgsrccontentimages201608monty_python_footpng">Footnotes <img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/Monty_python_foot.png"></h3>

<p><a name="note1">*</a> You must register with Google as a business to be found in Google Maps or place ads with Google ("Google AdWords"). It was pretty straightforward. Here in Germany you must have a "Gewerbeschein" (license to do business). You will also need: a picture and a logo, a physical location where you receive mail, "opening hours", and a bank account for electronic transfer (a regular bank account will do). They verify the physical address by sending you a postcard with a code on it, and they verify the account by transferring one cent to the account with a code in the remarks. I like it: reasonably secure without being overly onerous.</p>

<p>Copyright © 2016 William David Herndon. All rights reserved.</p>]]></content:encoded></item><item><title><![CDATA[Welcoming Comments]]></title><description><![CDATA[<h3 id="surprise">Surprise!</h3>

<p>I was really pretty shocked once Ghost was up and running that it didn't already have comments from the get-go. I mean, what good is a blog without comments? </p>

<h3 id="whatnow">What now?</h3>

<p>I went to the Ghost website and found <a href="https://www.ghostforbeginners.com/how-to-enable-comments-on-a-ghost-blog/">this page</a> on integrating comments. It mentions that some themes</p>]]></description><link>https://blog.softwareschmiede-herndon.de/welcoming-comments/</link><guid isPermaLink="false">925a39ed-e573-4326-9186-af15637716b6</guid><dc:creator><![CDATA[William David Herndon]]></dc:creator><pubDate>Fri, 12 Aug 2016 09:42:36 GMT</pubDate><content:encoded><![CDATA[<h3 id="surprise">Surprise!</h3>

<p>I was really pretty shocked once Ghost was up and running that it didn't already have comments from the get-go. I mean, what good is a blog without comments? </p>

<h3 id="whatnow">What now?</h3>

<p>I went to the Ghost website and found <a href="https://www.ghostforbeginners.com/how-to-enable-comments-on-a-ghost-blog/">this page</a> on integrating comments. It mentions that some themes come with comments. I checked that out: the themes that have comments, usually add one of those listed, so I still have that decision.</p>

<p>I love tables. Here's one now:</p>

<table>  
<tr>  
<td><b>Comment System</b></td>  
<td><b>Thoughts</b></td>  
</tr><tr>  
<td>Disqus</td>  
<td>Requires you to register with Disqus. Comes with an advertising system. On the one side, I need ad revenue. On the other, I don't want to be locked in to one particular advertiser. And I don't like that they've got the user data regardless.</td>  
</tr><tr>  
<td>Facebook</td>  
<td>Facebook?!?!<br>  
- users must register at FB - unacceptable<br>
- FB data collection practices - unacceptable<br></td>
</tr><tr>  
<td>NodeBB</td>  
<td>A bulletin board system? It uses mongodb<a href="https://blog.softwareschmiede-herndon.de/welcoming-comments/#mongodb"><sup>*</sup></a>, a big negative. Still the most acceptable so far.</td>  
</tr><tr>  
<td>Livefyre</td>  
<td>Requires you to register with them - they host the comments. No.</td>  
</tr>  
</table>

<p>So, I go with NodeBB.</p>

<h3 id="preliminaries">Preliminaries</h3>

<p>I go to <a href="https://nodebb.org/">NodeBB</a> and find the <a href="https://docs.nodebb.org/en/latest/installing/os/ubuntu.html">guide for installing under Ubuntu</a>. I have all the prerequisites, except:</p>

<h3 id="mongo">Mongo!</h3>

<p>Every time I think of MongoDB, I can't help thinking of Mongo from <a href="http://www.imdb.com/title/tt0071230/">Blazing Saddles</a>:</p>

<p><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/mongo.gif" alt="mongo"></p>

<p><small>(The stunt horse was not harmed - note how the rider tugs on the reigns just before the "punch")</small></p>

<p>Looking at NodeBB's guide for <a href="https://docs.nodebb.org/en/latest/configuring/databases/mongo.html">installing MongoDB</a>, I notice it doesn't match-up with the other info: it mentions Redis as the default, where ghost doesn't even mention Redis as a possibility, and "Note: NPM is installed along with node.js, so there is no need to install it separately" (hah!). So, I just search for the package:</p>

<p><code>$ apt-cache search mongodb</code></p>

<p>Reveals a butt-load of packages, so I go ahead and</p>

<p><code>$ sudo apt-get install mongodb</code></p>

<p>I check the list: nothing being uninstalled. Among those being installed: <code>mongodb-clients</code>, <code>mongodb-dev</code> and <code>mongodb-server</code> - it looks good. Confirm, and after a few minutes, it's done installing.</p>

<h3 id="backtothemaincourse">Back to the main course</h3>

<p>Like with ghost, I made a user (<code>nodebb</code>) and a directory. Then I go ahead and git clone nodebb:</p>

<p><code>$ cd /var/www/ghost/nodebb</code><br>
<code>$ sudo su nodebb</code><br>
<code>$ git clone https://github.com/NodeBB/NodeBB.git nodebb</code> <a href="https://blog.softwareschmiede-herndon.de/welcoming-comments/#nover"><sup>**</sup></a></p>

<p>This, of course, puts nodebb in the directory <code>/var/www/ghost/nodebb/nodebb</code>, not the intended <code>/var/www/ghost/nodebb</code>. <br>
<img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/facepalm-1.jpg" alt="facepalm">
This isn't the first time I've done that. Maybe I should turn this into a script in <code>/usr/local/bin</code> or something:</p>

<p><small>Note: I need to go <code>su</code> briefly to do this.</small></p>

<p><code>$ cd ..</code><br>
<code>$ mv nodebb temp</code><br>
<code>$ cd temp</code><br>
<code>$ mv nodebb ..</code><br>
<code>$ cd ..</code><br>
<code>$ rmdir temp</code><br></p>

<p>Proceeding with installation per the nodebb guide:</p>

<p><code>$ cd nodebb</code><br>
<code>$ npm install --production</code><br></p>

<p>That seems to work, again leaving a tree that scrolled everything else off-screen. What's next?</p>

<p><code>$ ./nodebb setup</code> As in the guide? <strong><em>No!</em></strong></p>

<p>I tried that: that way leads to pain and suffering (unclear questions, failure to connect to MongoDB). Instead, jump ahead and just start it.</p>

<p><code>$ ./nodebb start</code></p>

<p>It starts in the background - I have a prompt again. So, this script works like an <code>/etc/init.d</code> script. I'll have to copy it there and set it up so that it starts on bootup - later.</p>

<p>Now, since it is only available locally (localhost above), I use <a href="http://lynx.invisible-island.net/">lynx</a>, which works in a shell:</p>

<p><code>$ lynx localhost:4567</code></p>

<p>I confirm the cookie it wants to give me, then get a nice page. &nbsp;<img style="display: inline; left: 0;" src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/smiley.jpg"></p>

<p>Then per the ghost instructions, I try to login. Selecting the the [login] link doesn't seem to do anything. I scroll down.</p>

<p><code>Your browser does not seem to support JavaScript. ...</code></p>

<p><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/watchmen-smiley.png" alt="watchmen-smiley"></p>

<p>Of course. Logins usually need JavaScript. Back to plesk. Setup a new subdomain <code>nodebb.softwareschmiede-herndon.de</code>. Redirect the new subdomain to localhost:4567 using ProxyPass (see <a href="https://blog.softwareschmiede-herndon.de/the-oddysey-to-the-land-of-blogging/">My Oddysey to Blogging-Land</a>).</p>

<p>Then, opening a regular browser to nodebb.softwareschmiede-herndon.de, I am greeted by this glorious sight:</p>

<p><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/nodebb-installer-welcome.png" alt="nodebb-installer-welcome"></p>

<p><small>Note: I reconstructed the process in VirtualBox, which is why it says localhost:4567 instead of nodebb.softwareschmiede-herndon.de</small></p>

<p>For administrator, choose the username you want your users to see when you post - changing it later can cause you problems (yes, that's experience talking).</p>

<p>Choose a strong password right from the get-go: if you don't, <strong><em>it will fail without warning you</em></strong>: it won't create your admin account, while otherwise completing installation. You will be locked out.</p>

<p>If you do manage to lock yourself out, remove the <code>config.json</code> in the nodebb folder and try again - that worked for me.</p>

<p>Of course, change the database to MongoDB.</p>

<p>Then click "Install NodeBB". On the following page click "Launch NodeBB". Then login: you should land on the admin page.</p>

<p>Finally with setup done, I now install the "comments widget" as per the ghost instructions (<a href="https://www.ghostforbeginners.com/how-to-enable-comments-on-a-ghost-blog/#nodebb">this page</a> again):</p>

<p><code>$ npm install nodebb-plugin-blog-comments</code></p>

<p>The instructions say to "Click on the Reload button at the bottom of the main Admin page". It's called the "Dashboard" now and restart button is: <br>
<img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/nodebb-dashboard.png" alt="nodebb-dashboard"></p>

<p><strong>Activating the plugin</strong>:</p>

<ul>
<li>"open up Extended -> Plugins and activate <code>nodebb-plugin-blog-comments</code>". It's "EXTEND" now, but fine. I click on Activate for nodebb-plugin-blog-comments.</li>
<li>then I also activate <code>nodebb-plugin-dbsearch</code> - I want comments to be searchable.</li>
<li>Return to the Dashboard</li>
<li>Click [RESTART]</li>
<li>Refresh your browser (usually F5) - <em>Do not skip this step</em>: there is no auto-refresh when you click [RESTART], and the menu you need for the next step will not be there.</li>
</ul>

<p><strong>Configuring the plugin</strong>:</p>

<ul>
<li>"Go to Installed Plugins -> Blog Comments".</li>
<li>I fill in the page and click</li>
</ul>

<p><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/nodebb-save.png" alt="nodebb-save"></p>

<p>The promised button with the word "Save" on it in their picture has morphed into this badly drawn image of a media that kids these days have never actually seen. The inner blue circle needs to be centered, it's the center of rotation for the disk inside! And there's no mouseover text - no hint! I have blind friends for whom this kind of thing matters! Sorry, I digress.</p>

<ul>
<li>Go back to the Dashboard and</li>
<li>click [RESTART] again.</li>
</ul>

<p><strong>Inserting the comments into ghost</strong> - as per the instructions:</p>

<ul>
<li>I find the file <code>post.hbs</code> - <code>/var/www/ghost/content/themes/casper/post.hbs</code></li>
<li>I open <code>post.hbs</code> in a text editor</li>
<li>find the location of <code>{{content}}</code></li>
<li><p>Copy and paste the following text after that line:
<code> <br>
        &lt;a id="nodebb-comments"&gt;&lt;/a&gt;
        &lt;script type="text/javascript"&gt;
            var nbb = {};
            nbb.url = 'http://nodebb-forum.com'; // EDIT THIS
&nbsp;
            (function() {
            nbb.articleID = '{{../post.id}}'; nbb.title = '{{../post.title}}';
            nbb.tags = [{{#../post.tags}}"{{name}}",{{/../post.tags}}];
            nbb.script = document.createElement('script'); nbb.script.type = 'text/javascript'; nbb.script.async = true;
            nbb.script.src = nbb.url + '/plugins/nodebb-plugin-blog-comments/lib/ghost.js';
            (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(nbb.script);
            })();
        &lt;/script&gt;
        &lt;script id="nbb-markdown" type="text/markdown"&gt;{{{../post.markdown}}}&lt;/script&gt;
</code></p></li>
<li><p>Edit the line with <code>EDIT THIS</code>, in my case, changing <code>nodebb-forum.com</code> to <code>nodebb.softwareschmiede-herndon.de</code>. <br>Note: I first tried to be smart and hide nodebb, using localhost:4567. Of course it doesn't work - this script is executing in the client machine. Yay sleep deprivation!</p></li>
<li>I restart ghost:<br>
<code>$ sudo /etc/init.d/ghost restart</code></li>
</ul>

<p>I go to my first blog article at the bottom, note that it says "Read only". Oh, but there's this nice button: [PUBLISH THIS ARTICLE TO NODEBB]. I press it, and voila: I can comment!</p>

<p><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/200-1-.gif" alt="Dancing"></p>

<p>I'm not done yet.</p>

<p>As a good programmer, I test it from the users perspective: I register a new user and make a comment. Hooray!</p>

<p>Two days later, a friend skypes me with a comment. I tell him to go ahead and post it. He says he can't yet - apparently there's a one hour waiting period after registration. He thinks. It's not really clear to him.</p>

<p>I'm not sure why it worked straight away with my test user. Maybe some cookie from my admin login was still active?</p>

<p>In any case, I'm not happy with my users having to wait an hour by default:</p>

<ul>
<li>I go to <code>nodebb.softwareschmiede-herndon.de</code></li>
<li>I click on the Admin icon
<img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/nodebb-admin-gears.png" alt="nodebb-admin-gears"></li>
<li>I select the menu <strong>Settings&rarr;User</strong></li>
<li>I activate Email registration.</li>
<li>I click the funky save icon.</li>
<li>I change Account Lockout Duration to 1 minute.</li>
<li>While I'm at it, I go to <strong>Settings&rarr;Email</strong> and set that up, too.</li>
</ul>

<p>I'm eventually going to have to take spam counter measures - some sort of challenge against bots. But for now, I'm done.</p>

<p><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/exhausted-at-the-finish.jpeg" alt="exhausted at the finish"></p>

<h3 id="lessonsimgsrccontentimages201608lessonspng">Lessons <img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/lessons.png"></h3>

<ul>
<li>Being bleeding edge is exhausting.</li>
<li>Sleep is good - coffee can only do so much.</li>
<li>When testing, use a different browser without your cookies. Better yet, a different machine. Still better, if possible, have someone else try it - you might have developed error avoidance habits.</li>
<li>Having a spare Ubuntu in a <a href="https://www.virtualbox.org/">VirtualBox</a> is very useful when trying to reconstruct what you did from incomplete notes.</li>
</ul>

<h3 id="resourcesimgsrccontentimages201608toolboxjpeg">Resources <img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/toolbox.jpeg"></h3>

<ul>
<li><a href="https://www.ghostforbeginners.com/how-to-enable-comments-on-a-ghost-blog/">How to enable comments on a Ghost blog</a></li>
<li><a href="https://nodebb.org/">NodeBB</a> / <a href="https://docs.nodebb.org/en/latest/installing/os/ubuntu.html">Guide for installing NodeBB under Ubuntu</a>.</li>
<li><a href="http://lynx.invisible-island.net/">Lynx - the text-only browser</a></li>
<li><a href="https://www.mongodb.com/">MongoDB.com</a> - warning: it is a flashy commercial site. All the mongodb.org sites now redirect to their mongodb.com equivalents. *sigh*</li>
<li><del>Innotek's</del> <del>Sun's</del> <a href="https://www.virtualbox.org/">Oracle's VirtualBox</a></li>
</ul>

<p><a name="mongodb"><sup>*</sup></a> <a href="http://www.sarahmei.com/blog/2013/11/11/why-you-should-never-use-mongodb/">Why you should never use mongodb</a>, by <a href="http://www.sarahmei.com/blog/">Sarah Mei</a>, a contributor to <a href="https://diasporafoundation.org/">Diaspora</a>. Diaspora was founded as a more privacy rights aware alternative to Facebook, but got off to a bad start and has yet to take off.</p>

<p><a name="nover"><sup>**</sup></a> I skipped the <code>-b v1.x.x</code> recommended in the git command: I'd have to look up the most recent versions, decide which is stable enough, which might involve looking into individual bugs, etc. Nah, I want this done. We're already living dangerously getting a bleeding edge BB, we'll just get the bleeding edge version.</p>

<p>Copyright © 2016 William David Herndon. All rights reserved.</p>]]></content:encoded></item><item><title><![CDATA[Virtualization crashes into Business Reality]]></title><description><![CDATA[<p>This story starts with me trying to figure out whether I have the latest Parallels<sup>&reg;</sup> "Power Panel", and if so, to complain to <a href="http://www.parallels.com/">Parallels</a><sup>&reg;</sup>, and if not, to complain to my hoster, <a href="https://www.hosteurope.de/">HostEurope</a> (I'm pretty happy with HostEurope - quite professional).</p>

<p>So, of course I login to my</p>]]></description><link>https://blog.softwareschmiede-herndon.de/virtualization-crashes-into-business-reality/</link><guid isPermaLink="false">35235c79-9c7e-4dea-84ce-09f152386554</guid><dc:creator><![CDATA[William David Herndon]]></dc:creator><pubDate>Fri, 05 Aug 2016 22:09:03 GMT</pubDate><content:encoded><![CDATA[<p>This story starts with me trying to figure out whether I have the latest Parallels<sup>&reg;</sup> "Power Panel", and if so, to complain to <a href="http://www.parallels.com/">Parallels</a><sup>&reg;</sup>, and if not, to complain to my hoster, <a href="https://www.hosteurope.de/">HostEurope</a> (I'm pretty happy with HostEurope - quite professional).</p>

<p>So, of course I login to my "Parallels<sup>&reg;</sup> Power Panel": <br>
<img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/powerpanel.png" alt="Power Panel"></p>

<p>You can ignore the red warning triangle clearly visible at the top: I complained to my hoster years ago: they told me it meant nothing, but if it bothers me, I should contact Parallels<sup>&reg;</sup>. I found it difficult back then to do, and so quickly gave up over so trivial a matter.</p>

<p>Taking most of a day to reinstall something that should take minutes warrants a larger time investment this time around. They really should fix this.</p>

<p>If you have sharp eyes, you can see in the upper right hand corner, that the copyright extends to 2012. Probably good enough to complain to my hoster, but I want to know more precisely. It should be a simple matter, right?</p>

<p>The menus turn up nothing. The controls in the menus turn up nothing. <a href="https://duckduckgo.com/">Duckduckgo</a>-ing<a href="https://blog.softwareschmiede-herndon.de/virtualization-crashes-into-business-reality/#duckduckgo">*</a> turns up nothing.</p>

<p>Well, I <em>think</em> I finally found it: click on "Status Changes" or "Resource Alerts", and then look at the hint message area under "Log Out". Do not move the mouse over a menu though, otherwise the version, "04.01.00.00.47", will be replaced with a helpful hint for the menu.</p>

<p>What kind of software producer doesn't want you to know the version? They usually <strong><em>love</em></strong> to tell you to just update to the latest version to fix all your problems.</p>

<p><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/columbo-scratches-head.gif" alt="Scratching head"></p>

<p>Whatever, now armed with the version number, I'm off to try and find out what the latest version is, so I can ask for it.</p>

<p>Except Parallels<sup>&reg;</sup> "Power Panel" doesn't seem to exist as a product anymore. Not on their website anyway. All I found was some documentation that looks older than what I already have.</p>

<p>I guess that it got spun off or something - an existing company wouldn't just abandon a successful product, would they?</p>

<p>I go back to my hoster: they seem to use a lot of terms interchangeably, that aren't entirely clear to me. The buzz words are "Virtuozzo", "Odin", "VZPP" (= "Virtuozzo Power Panel"), and, of course, Parallels<sup>&reg;</sup>. All of the documentation I can find just assumes you already know about them.</p>

<p>So, let's be a little more systematic:</p>

<table>  
<tr><td>website</td><td>notes</td></tr>  
<tr><td><a href="http://parallels.com/">http://parallels.com/</a></td><td>Active website. Info on Power Panel, but only old info.</td></tr>  
<tr><td><a href="http://www.odin.com/">http://www.odin.com/</a></td><td>Latest news is from January - old. No PP info, but some Plesk info</td></tr>  
<tr><td><a href="https://virtuozzo.com.com/">https://virtuozzo.com.com/</a></td><td>Some references to "Power Panel", but nothing obviously what I want. News is recent. Wait...</td></tr>  
</table>

<p>Back up. What was the title of that news article?</p>

<p><a href="http://www.thewhir.com/web-hosting-news/after-parallels-spin-out-virtuozzo-refocuses-on-partners-and-technology">"After Parallels Spin Out, Virtuozzo Refocuses on Partners and Technology"</a>.</p>

<p>"Virtualization platform provider Virtuozzo spun off as a standalone company from Parallels about six months ago as Odin was acquired by Ingram Micro."</p>

<p>Mergers, spinoffs, and acquisitions. This is not conducive to smooth transitions. But it looks like I've found my answer: the current equivalent of Parallels<sup>&reg;</sup> (Power Panel) is Virtuozzo Containers&trade; (whatever they call their panel now). With the renaming, it is highly unlikely that there is a direct compatible upgrade path. Crap.</p>

<p>So, I've just spent a good many hours finding out that there is no one to complain to: the original manufacturer doesn't exist anymore, and the hoster doesn't upgrade because they can't.</p>

<p><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/thoughtfulmal.gif" alt="Thoughtful Mal"></p>

<p><strong>Take all of this with a grain of salt: I haven't actually contacted anyone to confirm. To do that properly would probably take more hours, perhaps days, seeing as how all parties concerned seem to be obfuscating the truth. And I'm not willing to invest that much at this time.</strong></p>

<p><a name="duckduckgo">*</a>Yeah, <a href="https://blog.softwareschmiede-herndon.de/virtualization-crashes-into-business-reality/duckduckgo.com">DuckDuckGo</a> is my default instead of Google. I'm not comfortable with Google knowing more about me than I do. I still use Google when DuckDuckGo doesn't give me the results I need.</p>

<h3 id="lessonsimgsrccontentimages201608lessonspng">Lessons <img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/lessons.png"></h3>

<ul>
<li>This is one of the reasons I prefer Open Source: sometimes software doesn't fit in the business plan, and suddenly you're stuck with orphaned software that you cannot fix yourself.</li>
</ul>

<h3 id="resourcesahrefnoprofitsupsupaimgsrccontentimages201608toolboxjpeg">Resources<a href="https://blog.softwareschmiede-herndon.de/virtualization-crashes-into-business-reality/#noprofit"><sup>**</sup></a> <img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/toolbox.jpeg"></h3>

<ul>
<li><a href="https://www.hosteurope.de/">HostEurope</a> - a decent hoster in Germany.</li>
<li><a href="https://www.strato.de/">Strato</a> - another decent hoster in Germany, for parity.</li>
<li><a href="https://www.plesk.com/">Plesk</a> - WebAdmin tool that works well with Power Panel</li>
<li><a href="http://www.parallels.com/">Parallels</a> - Original Power Panel maker.</li>
<li><a href="http://www.odin.com/">Odin</a> - Original maker of Plesk? Now belongs to Ingram Micro.</li>
<li><a href="https://virtuozzo.com/">Virtuozzo</a> - Maker of current Virtuozzo Containers&trade;.</li>
<li><a href="https://www.docker.com/">Docker</a> - Maker of a competing "containerization" software.</li>
</ul>

<p><sup><a name="noprofit">**</a></sup>Though <del>most</del> all of these resources are for profit businesses, I have received no money for this article or their mention. If I were them, I wouldn't give me money for this either: this article is not exactly what I'd call an endorsement.</p>

<h3 id="relatedblogposts">Related blog posts</h3>

<ul>
<li><a href="https://blog.softwareschmiede-herndon.de/the-oddysey-to-the-land-of-blogging/">My Odyssey to Blogging-Land</a></li>
<li>How to: Setting up a VPS (not yet written)</li>
</ul>

<p>Copyright &copy; 2016 William David Herndon. All rights reserved.</p>]]></content:encoded></item><item><title><![CDATA[My Oddysey to Blogging-Land]]></title><description><![CDATA[<p>Despite my best attempts to make this shorter and simpler, this is extremely technical. You may want to skip on down to "Lessons" at some point.  </p>

<h3 id="whichbloggingsoftwareshouldiuse">Which blogging software should I use?</h3>

<p>After deciding to create a blog, the next question is <em>how</em>. I could go to <a href="https://www.blogger.com/">blogger</a> or some</p>]]></description><link>https://blog.softwareschmiede-herndon.de/the-oddysey-to-the-land-of-blogging/</link><guid isPermaLink="false">ece9403a-d47c-4eb1-9504-183d7be76bd1</guid><category><![CDATA[ghost]]></category><category><![CDATA[blogging]]></category><category><![CDATA[installing]]></category><dc:creator><![CDATA[William David Herndon]]></dc:creator><pubDate>Thu, 04 Aug 2016 22:02:12 GMT</pubDate><content:encoded><![CDATA[<p>Despite my best attempts to make this shorter and simpler, this is extremely technical. You may want to skip on down to "Lessons" at some point.  </p>

<h3 id="whichbloggingsoftwareshouldiuse">Which blogging software should I use?</h3>

<p>After deciding to create a blog, the next question is <em>how</em>. I could go to <a href="https://www.blogger.com/">blogger</a> or some other hoster, which I've done before, but that's no <strong><em>fun!</em></strong> <br>
So, if I'm doing this myself, the next question is, which blog software / <a href="https://en.wikipedia.org/wiki/Content_management">Content Management System</a> to use? A little bit of searching and winnowing, and I came up with this list:  </p>

<table>  
<tr><td>Name</td>  
<td>Logo</td>  
<td>Language</td>  
<td>License</td>  
<td>Familiarity</td></tr>  
<tr><td><a href="https://wordpress.com/">WordPress</a></td>  
<td><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/wordpress.png" width="20"></td>  
<td><a href="http://php.net/">PHP</a></td>  
<td><a href="https://opensource.org/licenses/gpl-license">GPLv2</a></td>  
<td>very</td></tr>  
<tr><td><a href="https://www.joomla.org/">Joomla</a></td>  
<td><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/joomla.png" width="20"></td>  
<td><a href="http://php.net/">PHP</a></td>  
<td><a href="https://opensource.org/licenses/gpl-license">GPL</a></td>  
<td>some</td></tr>  
<tr><td><a href="https://www.drupal.org/">Drupal</a></td>  
<td><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/drupal.png" width="20"></td>  
<td><a href="http://php.net/">PHP</a></td>  
<td><a href="https://opensource.org/licenses/gpl-license">GPLv2</a></td>  
<td>some</td></tr>  
<tr><td><a href="https://typo3.org/">TYPO3</a></td>  
<td><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/typo3.png" width="50"></td>  
<td><a href="http://php.net/">PHP</a> / <a href="http://www.ecma-international.org/publications/standards/Ecma-262.htm">JavaScript</a>*</td>  
<td><a href="https://opensource.org/licenses/gpl-license">GPL</a></td>  
<td>none</td></tr>  
<tr><td><a href="https://ghost.org/">Ghost</a></td>  
<td><img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/ghost.png" width="50"></td>  
<td><a href="https://nodejs.org/en/">node.js</a></td>  
<td><a href="https://opensource.org/licenses/MIT">MIT</a></td>  
<td>none</td></tr>  
</table>  

<p>* Note that JavaScript is now officially called <a href="http://www.ecma-international.org/publications/standards/Ecma-262.htm">ECMA</a>.</p>

<p>node.js is a shiny new <del>language</del> platform from <del>Google</del> Linux Foundation (sorry! Somehow got it confused with Google's JavaScript based <a href="https://golang.org/">Go</a>) that people either swear by or at. It is written in JavaScript. Which is itself written in C/C++. They're piling the layers on really deep these days.</p>

<p>Apparently I like tearing my hair out. Also, I need shiny content for this blog. I choose Ghost.</p>

<h3 id="installingghostbloggingsoftware">Installing ghost blogging software</h3>

<p>A "short" synopsis:</p>

<ul>
<li>Go to <a href="https://ghost.org/">ghost.org</a></li>
<li>Find <a href="http://support.ghost.org/installing-ghost-linux/">installation instructions for Linux</a></li>
<li>Use <a href="http://www.putty.org/">putty</a> to connect to my Linux <a href="https://en.wikipedia.org/wiki/Virtual_private_server">VPS</a>.</li>
<li>Installing node.js:
<ul><li>Try <code>sudo apt-get install node</code> - notice it's the wrong package before confirming.</li>
<li>Search for the right package (I could write a lot about dealing with apt/dpkg)</li>
<li><code>sudo apt-get install nodejs</code></li></ul></li>
<li>Make the user "ghost", the directory "/var/www/ghost", chown it, cd to it, <a href="https://curl.haxx.se/docs/manpage.html">curl</a> the <a href="https://ghost.org/zip/ghost-latest.zip">zip file</a> and unzip it.</li>
<li><code>npm start --production</code> &rarr; <code>npm: command not found.</code></li>
<li>Installing npm:
<ul><li>Look up npm: "package manager for node.js", sounds harmless.</li>
<li><code>sudo apt-get install npm</code> and confirm.</li>
<li><strong><em>Wait!!!</em></strong> It's uninstalling <a href="https://www.plesk.com/">plesk</a>?!?! The VPS management software my host provides?! <img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/nuke1.gif"></li>
<li>I try to cancel, but it's having none of it. Before it scrolls beyond range, I manage to copy the list of the packages it's uninstalling.</li>
<li>I verify that plesk is not working, though my websites are working.</li>
<li>I spend the rest of the day and evening into the wee hours of the next morning recovering plesk enough to be usable. It's still not completely recovered, but good enough for now. I need to write to npm maintainers about this conflict, and I need to <del>write a long letter to <a href="http://www.parallels.com/">Parallels</a> about the (un)usability of their "Power Panel" (which I used to recover)</del> spend a few useless hours finding out that there is no one to report to, then write a <a href="https://blog.softwareschmiede-herndon.de/virtualization-crashes-into-business-reality">blog post</a> about it.</li>
<li>I still have the problem of installing npm without uninstalling plesk. Some searching finds me <a href="http://gnetos.de/2015/06/15/install-nodejs-and-npm-with-plesk/">Tobi's Software Development Blog</a>.
<ul><li>Method 1 simply does not work: it still wants to uninstall plesk.</li>
<li>Method 2: <code>curl https://www.npmjs.com/install.sh | sh</code> requires privileges, and is executing a script, sight unseen...</li>
<li>So, I download the script, examine it, it looks okay, I execute it. &rarr; <code>npm cannot be installed without Node.js</code></li>
<li>But, node.js <em>is</em> installed. After some script debugging, I realize it is looking for "node", whereas the program is nodejs.</li>
<li>I replace "node" with "nodejs".</li>
<li>The script generates some sort of tree that scrolls off the top of the terminal, followed by "It worked." That is bad form, but okay.</li></ul></li></ul></li>
<li>I go to <code>/var/www/ghost</code> and execute <code>npm install --production</code>, as per instructions. &rarr; <code>node: no such file or directory.</code>
<ul><li>The node / nodejs problem is apparently everywhere. I add a link to fix it:
<ul><li><code>cd /usr/bin</code></li>
<li><code>sudo ln -s nodejs node</code></li></ul></li></ul></li>
<li>Again I go to <code>/var/www/ghost</code> and execute <code>npm install --production</code>. This time a tree scrolls off the screen with no final message - it appears to have worked.</li>
<li>First time start up:
<ul><li>I execute <code>npm start --production</code> &rarr; it appears to be running. In the foreground, as expected.</li>
<li>Neither www.softwareschmiede-herndon.de:2368, nor 5.35.246.86:2368 is working from my home browser.</li>
<li>I check if the firewall might be blocking it: it turns out the firewall is down since the npm fiasco (above). I put off fixing that (good choice: a five hour excursion, as it turned out).</li>
<li>Since this might be an access problem, I open another putty session and use <a href="http://linux.die.net/man/1/lynx">lynx</a> to localhost:2368. &rarr; At first an error page (hey, something is running!), but a simple refresh and: success! <img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/200-1-.gif"></li>
<li>A little searching shows that the problem accessing from the browser is that the listening port is set to 127.0.0.1: I change it to 0.0.0.0 &rarr; I can access it at www.softwareschmiede-herndon.de:2368</li>
<li>I create my admin user.</li>
<li>I reconsider the setup: a more typical setup would actually redirect from blog.softwareschmiede-herndon.de to localhost:2368, so that search engines can find it. Using the port 2368 directly <em>should</em> be discouraged or impossible.</li></ul></li>
<li>Setting up the redirect for <a href="http://blog.softwareschmiede-herndon.de/">http://blog.softwareschmiede-herndon.de/</a>
<ul><li>I create the plesk subdomain</li>
<li>After much searching, I find that the "Hosting type" "forwarding" seems to do what I want.</li>
<li>After much testing, I find forwarding does <strong>not</strong> do what I want: either it tells the browser a new address or it inserts it all in a frame, both of which are really bad for search engines.</li>
<li>I have a minor quest through the depths of nginx, which was not installed and when installed, made all my other websites unavailable. Uninstalled again.</li>
<li><a href="https://www.apache.org/">Apache</a> really should have options for this, so why are all the solutions pointing elsewhere? I look specifically for an Apache solution, and find one. With a little more work, I get it to work in plesk:
<ul><li>Create a normal subdomain</li>
<li>Go to the "Apache &amp; nginx Settings" for the subdomain.</li>
<li>Under additional directives for HTTP (and HTTPS) enter:</li>
<li><code>RewriteEngine On</code></li>
<li><code>ProxyPass / http://localhost:2368/</code></li>
<li><code>ProxyPassReverse / http://localhost:2368/</code></li></ul></li></ul></li>
<li>I set ghost up as a service:
<ul><li>I create a script in <code>/etc/init.d</code> to start ghost as a service.</li>
<li>I create a conf file, <code>/etc/init/ghost.conf</code></li></ul></li>
<li>So, finally working, I make an Introduction post.</li>
<li>I want to test commenting... but <strong><em>there's no comments!</em></strong>
<ul><li>How I got comments working is planned as another post.</li></ul></li>
</ul>

<h3 id="lessonsimgsrccontentimages201608lessonspng">Lessons <img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/lessons.png"></h3>

<ul>
<li>Never assume that anything that <em>should</em> be short and simple actually <em>is</em>. But you already new that.</li>
<li><strong><em>Always</em></strong>, no matter how innocuous the install, review the output of apt-get <em>carefully</em> before confirming.</li>
<li>Script debugging, <code>bash -x</code>, is your friend.</li>
<li>When developing your own package:
<ul><li>Look out for name conflicts before they become trouble.</li>
<li>Regularly test installing on various systems, to be sure things aren't broke for beginners.</li></ul></li>
<li>I need to report problems, so that they get fixed and others aren't bit by them.</li>
</ul>

<h3 id="resourcesimgsrccontentimages201608toolboxjpeg">Resources <img src="https://blog.softwareschmiede-herndon.de/content/images/2016/08/toolbox.jpeg"></h3>

<ul>
<li><a href="https://ghost.org/">ghost.org</a> / <a href="http://support.ghost.org/installing-ghost-linux/">Installation instructions for Linux</a></li>
<li><a href="https://ghost.org/zip/ghost-latest.zip">Latest ghost zip</a></li>
<li><a href="http://gnetos.de/">Tobi's software development blog</a> / <a href="http://gnetos.de/2015/06/15/install-nodejs-and-npm-with-plesk/">Install nodejs and npm with plesk</a></li>
<li><a href="http://www.softwareschmiede-herndon.de/ghost">/etc/init.d/ghost</a></li>
</ul>

<h3 id="relatedblogposts">Related blog posts</h3>

<ul>
<li><a href="https://blog.softwareschmiede-herndon.de/virtualization-crashes-into-business-reality">Virtualization Crashes into Business Reality</a></li>
<li><a href="https://blog.softwareschmiede-herndon.de/welcoming-comments/">Welcoming Comments</a> - Installing NodeBB comments on ghost</li>
<li>Monetizing my blog (not yet done, much less written)</li>
</ul>

<p>Copyright &copy; 2016 William David Herndon. All rights reserved.</p>]]></content:encoded></item></channel></rss>