<feedxmlns="http://www.w3.org/2005/Atom"><title>Sysadmining. All day. Every day.</title><linkhref="https://captainark.net/"rel="alternate"></link><linkhref="https://captainark.net/rss.xml"rel="self"></link><id>https://captainark.net/</id><updated>2016-02-02T00:00:00+01:00</updated><entry><title>My tmux configuration</title><linkhref="https://captainark.net/my-tmux-configuration.html"rel="alternate"></link><updated>2016-02-02T00:00:00+01:00</updated><author><name>Antoine Joubert</name></author><id>tag:captainark.net,2016-02-02:my-tmux-configuration.html</id><summarytype="html"><p><a href="https://tmux.github.io/">tmux</a> is a terminal mutiplexer. It lets you have multiples shells running in a single terminal emulator window and it keeps those shells running in the background should you need to close your terminal emulator.</p>
<p>I've played around with the configuration quite a bit to find settings that suit my needs. Here's what it ended up looking like :</p>
<p>This screenshot was done on Mac OS X, using the Terminal app and this <a href="https://github.com/tomislav/osx-terminal.app-colors-solarized">Solarized theme</a>.</p>
<p>I figured I'd share my tmux configuration here !</p>
<h2>Installing tmux</h2>
<p>tmux is available on Debian. I suggest using the <a href="https://packages.debian.org/jessie-backports/tmux">jessie backports</a> version :</p>
<p>I used screen before tmux, so I configured the prefix key on C-a instead of C-b. tmux has the advantage of being <em>much</em> simpler to configure than screen.</p>
<p>If you want to use this configuration, simply copy the following in ~/.tmux.conf. This file is read by default when tmux starts.</p>
<p>If you simply want to try it out, copy it in a file somewhere else and have tmux load with the -f parameter (<code>tmux -f ~/tmux-test.conf</code>).</p>
<div class="highlight"><pre># use utf8
set -g utf8
set-option -g status-utf8 on
set-window-option -g utf8 on
# do not wait on esc key
set-option -g escape-time 0
# completely disable automatic rename
set-window-option -g automatic-rename off
# basic settings
set -g default-terminal &quot;screen-256color&quot;
<p>The second one changes the tmux window name whenever I ssh to a remote host, and switches the window name back to the name of my computer when I logout from the host.</p>
<p>That's all ! As always, please do leave a comment if you've found something useful in this article !</p></summary></entry><entry><title>Debian updates with Ansible</title><linkhref="https://captainark.net/debian-updates-with-ansible.html"rel="alternate"></link><updated>2016-01-31T00:00:00+01:00</updated><author><name>Antoine Joubert</name></author><id>tag:captainark.net,2016-01-31:debian-updates-with-ansible.html</id><summarytype="html"><p>I've recently bought a <a href="http://www8.hp.com/us/en/products/proliant-servers/product-detail.html?oid=5379860">HP Proliant Microserver Gen8</a> to play around with LXC and try new stuff.</p>
<p>From the 4 Debian machines I had to keep up-to-date, I now have 7, so it became quite time-consumming to manually SSH to each of them whenever an update became available.</p>
<p>I ended up looking at <a href="http://www.ansible.com/">Ansible</a> to speed up the process and, within an hour, I had a working playbook that updates the debian packages, pip packages and git repos installed on all of my servers with a single command.</p>
<p>I figured I'd share the playbook I use to update the Debian packages !</p>
<h2>The playbook</h2>
<p>I modified <a href="https://gist.github.com/maethor/380676f6b1cec8cc7439">this gist</a> to only use apt-get instead of both apt-get and aptitude.</p>
<span class="p p-Indicator">-</span><span class="l l-Scalar l-Scalar-Plain">name</span><span class="p p-Indicator">:</span><span class="l l-Scalar l-Scalar-Plain">check what the new version is</span>
<span class="p p-Indicator">-</span><span class="l l-Scalar l-Scalar-Plain">name</span><span class="p p-Indicator">:</span><span class="l l-Scalar l-Scalar-Plain">notify distribution version upgrade</span>
<span class="l l-Scalar l-Scalar-Plain">debug</span><span class="p p-Indicator">:</span><span class="l l-Scalar l-Scalar-Plain">msg=&quot;Debian has been upgraded from {{ ansible_lsb.release }} to {{ new_release.stdout }}&quot;</span>
<span class="p p-Indicator">-</span><span class="l l-Scalar l-Scalar-Plain">name</span><span class="p p-Indicator">:</span><span class="l l-Scalar l-Scalar-Plain">install the debian-goodies package if it is missing</span>
<p>That's all ! Please leave a comment if you've found this playbook helpful !</p></summary></entry><entry><title>Private Git Repo</title><linkhref="https://captainark.net/private-git-repo.html"rel="alternate"></link><updated>2016-01-31T00:00:00+01:00</updated><author><name>Antoine Joubert</name></author><id>tag:captainark.net,2016-01-31:private-git-repo.html</id><summarytype="html"><p>I've decided to migrate this blog to <a href="http://blog.getpelican.com/">Pelican</a>. I've been playing around with it over the week-end, and it turns out to be way easier to manage than <a href="https://jekyllrb.com/">Jekyll</a>. Themes are much easier to install and configure, so it ends up looking better as well !</p>
<p>Since I'm basically recreating this blog from scratch, I've decided to delete the old git repo that was hosting it and to create a new one.</p>
<p>Setting up your own private git repo is pretty easy to achieve and is already well-documented on the <a href="https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server">Git</a> website.</p>
<p>Every time I want to create a new repo, I've had time to forget how to do it and I end up looking for that page, so I figured I'd write a few lines on the subject.</p>
<p>In this tutorial, I'll configure a git repo on a distant server running Debian 8 (Jessie). This repo will be remotely accessible using SSH. Two users will be able to connect to it : me and the www-data user on my webserver.</p>
<h2>SSH Keys</h2>
<p>If you don't have one already, you'll need a ssh-key to connect to the git repo.</p>
<p>On your computer, in a shell, as your usual user :</p>
<p>For security reasons, configuring a passphrase is recommended. On Mac OS X and most desktop environnements on Linux, you can store this passphrase for the duration of your session using the <code>ssh-add</code> command, so you won't have to type it every time you want to connect to a host.</p>
<p>On the server, we also have to create a ssh-key for the user that is running our webserver (you'll need to have sudo installed) :</p>
<p>This will create a system user (UID &lt; 1000) with a /home/git home directory. If you want to host your git repos somewhere else on your filesystem, you should add a <code>-d /home/directory/for/git</code> in the previous command.</p>
<p>This user will use the git-shell shell. This limits remote connection to that user to git commands (like the rssh shell can limit remote connection to a user to scp or rsync commands).</p>
<p>We have to configure our system to allow the use of this shell :</p>
<p>You can now copy/paste the content of the two <code>$HOME/.ssh/id_rsa.pub</code> files we've created earlier using the <code>ssh-keygen</code> command in <code>/home/git/.ssh/authorized_keys</code>.</p>
<p>The last thing we have to do is to create our first git repo. In this example, my project will be called 'captainarkdotnet' as it will be hosting this blog :</p>
<p>The last command should give you the following output :</p>
<div class="highlight"><pre>Initialized empty Git repository in /home/git/captainarkdotnet.git/.git/
</pre></div>
<p>We're done with the server configuration. Let's now actually push stuff to our repo !</p>
<h3>Initial push</h3>
<p>The files for my blog are store in the ~/Documents/projects/captainarkdotnet on my computer. Before doing anything else, we first have to make sure that we currently are in that folder :</p>
<p>Please note that you'll need to edit <strong>git.captainark.net</strong> to the FQDN or IP of your git server, and <strong>captainarkdotnet.git</strong> to the name of the git project on your server.</p>
<p>If everything went well, the last command should give you the following output :</p>
<p>That's it, we've now pushed our first commit to our server !</p>
<h2>First pull</h2>
<p>Alright, time to pull the files we've just pushed on our webserver. I personally store my web content in <code>/var/www</code> ; if you don't, you'll have to adjust the path accordingly :</p>
<p>SSH will ask you to type 'yes' since it's the first time the www-data user connects to the server. If everything goes well, you should have the following output :</p>
<div class="highlight"><pre>Cloning into <span class="s1">&#39;captainarkdotnet&#39;</span>...
<p>That's it ! We now have a working private git repo ! I won't go into details into the git commands in this tutorial, but here's a quick overwiew of the ones I use the most :</p>
<ul>
<li><code>git add .</code> recursively adds all files from the directory to the repo ;</li>
<li><code>git commit -a -m 'This is a comment'</code> commits the current state of your local repo with the 'This is a comment' comment ;</li>
<li><code>git push</code> pushes your commits to the distant repo ;</li>
<li><code>git pull</code> pulls the latest version of the distant repo locally ;</li>
<li><code>git branch -av</code> shows all available branches for the repo ;</li>
<li><code>git checkout -b testing remotes/origin/testing</code> create a local 'testing' branch based on the remote 'remotes/origin/testing' branch ;</li>
<li>once a branch has been copied locally, you can switch to it with the <code>git checkout {branch}</code> command.</li>
</ul>
<p>For more information on git a command, use <code>man git-{command}</code> !</p>
<p>If you've found this tutorial in any way helpful, please feel free to leave a comment !</p></summary></entry><entry><title>Flexget init script</title><linkhref="https://captainark.net/flexget-init-script.html"rel="alternate"></link><updated>2015-05-05T00:00:00+02:00</updated><author><name>Antoine Joubert</name></author><id>tag:captainark.net,2015-05-05:flexget-init-script.html</id><summarytype="html"><p>I've been using <a href="http://flexget.com/">Flexget</a> for the past two years or so as a download automator.</p>
<p>Since I wrote an <a href="http://flexget.com/wiki/Daemon/Startup#InsservscriptDebiancompatible">init script</a> for it a while back, and it is compatible with Debian Jessie / systemd, I figured I'd share it here.</p>
<h2>The script</h2>
<p>All of the following should be done as the root user.</p>
<p>First, create a /etc/default/flexget file with the following content :</p>
<div class="highlight"><pre><span class="c1"># Configuration file for /etc/init.d/flexget</span>
<span class="c1"># User to run flexget as.</span>
<span class="c1"># Daemon will not start if left empty.</span>
<p>Please note that the FGUSER variable needs to be defined for the daemon to start. It can be set to your current user, or you can run flexget as its own user.</p>
<p>You can create a flexget user with the following command :</p>
log_action_msg <span class="s2">&quot;</span><span class="nv">$DE</span><span class="s2">SC: FGUSER not set in /etc/default/</span>$<span class="s2">NAME. Exiting.&quot;</span>
<span class="nb">exit</span> 2
<span class="k">fi</span>
<span class="c1"># Function to verify if flexget is already running</span>
log_action_msg <span class="s2">&quot;</span><span class="nv">$DE</span><span class="s2">SC: Not currently running. Aborting.&quot;</span>
log_action_msg <span class="s2">&quot;</span><span class="nv">$DE</span><span class="s2">SC: Currently running with PID </span><span class="k">$(</span>cat $PIDFILE<span class="k">)</span><span class="s2">.&quot;</span>
<span class="k">else</span>
log_action_msg <span class="s2">&quot;</span><span class="nv">$DE</span><span class="s2">SC: Not currently running.&quot;</span>
<span class="k">fi</span>
<span class="nb">exit</span> $RETVAL
<span class="o">}</span>
<span class="k">case</span><span class="s2">&quot;</span><span class="nv">$1</span><span class="s2">&quot;</span> in
<p>That's all ! If you are using this script, please let me know in the comment section below !</p></summary></entry><entry><title>Setting up a mail server</title><linkhref="https://captainark.net/setting-up-a-mail-server.html"rel="alternate"></link><updated>2015-04-24T00:00:00+02:00</updated><author><name>Antoine Joubert</name></author><id>tag:captainark.net,2015-04-24:setting-up-a-mail-server.html</id><summarytype="html"><p>In this first tutorial, I'll explain how I've configured my mail server using the following :</p>
<ul>
<li>A server running Linux Debian (jessie) ;</li>
<li>Postfix ;</li>
<li>Postfix-policyd-spf-python ;</li>
<li>Dovecot ;</li>
<li>Spamassassin ;</li>
<li>OpenDKIM ;</li>
<li>OpenDMARC ;</li>
<li>Monit ;</li>
<li>Rainloop.</li>
</ul>
<p>I'm assuming you have some basic knowledge of Linux and DNS configuration.</p>
<p>You can host this server at home, but you might have issues with your ISP not allowing outbound traffic on TCP port 25, and your emails might be considered to be spam by other providers if your IP is dynamic and/or you can't configure a reverse DNS record on it.</p>
<p>The cheapest VMs from <a href="https://www.digitalocean.com/?refcode=1cd69e4c3389">DigitalOcean</a> or <a href="http://www.vultr.com/?ref=6804947">Vultr</a> are powerful enough to have this configuration running smoothly.</p>
<p>We'll also need a SSL certificate for this configuration. You can create an auto-signed one or get a free valid one from <a href="http://www.startssl.com/">StartSSL</a>. For the purpose of this tutorial, I'll consider you've chosen the latter.</p>
<p>You'll also need a domain name. I've chosen <a href="http://www.namecheap.com/?aff=85990">Namecheap</a> as a registrar. I won't go into details on how to configure it, but you'll need at the very least a A record on your server's IP as well as a MX record pointing to it.</p>
<p>I use the captainark.net domain as an example throughout this tutorial. You'll have to use your actual domain for your configuration to work !</p>
<p><em>Note: links in this section are sponsored.</em></p>
<h2>Initial configuration</h2>
<h3>Installing the required packages</h3>
<p>First thing first, we need to install the packages we'll need for this configuration :</p>
<p>During its installation, Postfix will prompt you with configuration questions. Choose "Internet Site", and when asked about your System mail name, provide it with your server's FQDN (it should be the output of the <code>hostname -f</code> command on your server).</p>
<p>You'll also have to set-up a password for the MySQL root user.</p>
<h3>Additional configuration</h3>
<p>The PTR records on your server's IPv4 and/or IPv6 should match your server's FQDN (a <code>dig -x</code> on your server's IP should match a <code>hostname -f</code> on your server).</p>
<p>You'll have to open the following TCP ports on your server for this configuration to work : 25, 465, 587 and 993.</p>
<p>If you don't want to have to remember the root user MySQL password, you can create a .my.cnf file in your current user home directory containing the following lines :</p>
<p>I also like to change the default MySQL shell to see what database I'm using at any given time. Since I use bash, I achieve this the following way :</p>
<p>You'll have to logout from the current shell for the modification to be taken into account (if you're using SSH, log out and back into your server).</p>
<p>You should now be able to log into MySQL without specifying a password, and it should look like this :</p>
<div class="highlight"><pre>:~$ mysql mysql
<h2>Configuring the MySQL database</h2>
<h3>Initial configuration</h3>
<p>We now need to configure the MySQL database Postfix and Dovecot will be using. In this tutorial, we'll be calling it "mail", but you can name it whatever you want.</p>
<p>First, in a mysql shell, let's create the MySQL database :</p>
<p>Now, we are going to create the user that Postfix and Dovecot will be using to access the database. We will only be granting this user select permission :</p>
<p>Now, all messages sent to alias@captainark.net will be forwarded to example@captainark.net.</p>
<p>Use the same syntax to create additional domains, users and aliases. If you have more than one domains configured, be sure to associate your users and aliases with the correct domain_id.</p>
<h2>Configuring Postfix</h2>
<p>Next, we are going to configure <a href="http://www.postfix.org/">Postfix</a>.</p>
<h3>Configuration backup</h3>
<p>First, let's backup the original configuration files :</p>
<p>Purists will probably want to store their certificates in /etc/ssl/private. If you choose to do so, you'll have to adapt the path of those files for the remainder of this tutorial.</p>
<p>If you've decided to create a certificate with StartSSL, you'll end up with two files, a .crt and a .key. I'll name those files server.crt and server-with-passphrase.key. Put both these files in the folder we've just created.</p>
<p>Now, let's remove the passphrase from the key :</p>
<p>That's it for Postfix, for now ; Dovecot is next !</p>
<h2>Configuring Dovecot</h2>
<h3>Dovecot global configuration</h3>
<p>By default, on Debian, <a href="http://www.dovecot.org/">Dovecot</a> uses multiple configuration files in /etc/dovecot/conf.d. I found it annoying to maintain, and I ended up only using the /etc/doveconf.conf file.</p>
<p>As always, let's start by backing up the original configuration file :</p>
<p>Dovecot will use the same SSL certificate as Postfix.</p>
<p>Using this configuration, your virtual users' emails will be stored in /var/mail/$domain/$user/ and will be owned by the vmail user.</p>
<p>For this to work, we have to create the domain folder :</p>
<p>Dovecot will create the virtual users' folders automatically.</p>
<h3>Dovecot access to the MySQL database</h3>
<p>We now need to allow Dovecot to connect to the mail database we have populated earlier. To do so, we are going to create a /etc/dovecot/sql.conf file with the following content :</p>
<div class="highlight"><pre>driver = mysql
password_query = SELECT email as user, password FROM virtual_users WHERE email=&#39;%u&#39;;
</pre></div>
<p>You'll have to change the password to the one you have defined earlier. Since this file contains a password, let's make sure it's not world-readable :</p>
<p>The last thing we need to configure here is sieve. The idea is to have all messages flagged as spam automatically moved to the mailbox Junk folder.</p>
<p>To do so, let's first create the required folders :</p>
<p>If you want to have sieve rules for a specific user, simply create $user@$domain.sieve file in the users folder (example@captainark.net in my case).</p>
<p>All .sieve files in the before folder will be used for all your virtual users, before their individual configuration ; the .sieve files in the after folder will be used, well, you guessed it, after.</p>
<p>Let's create a filter.sieve file in the /var/mail/sieve/before folder with the following content :</p>
<li>Password: the password you chose for your virtual user ;</li>
<li>IMAP: your server's FQDN, port 993 (SSL/TLS with normal password) ;</li>
<li>SMTP: your server's FQDN, port 465 (SSL/TLS with normal password).</li>
</ul>
<h2>Configuring SpamAssassin</h2>
<h3>The alternatives</h3>
<p>Next thing we have to do is to configure the actual anti-spam. I tried a few, but I ended up sticking with <a href="http://spamassassin.apache.org/">SpamAssassin</a>. Here's why :</p>
<ul>
<li><a href="http://dspam.nuclearelephant.com/">DSPAM</a> is <a href="http://sourceforge.net/p/dspam/mailman/message/32585111/">no longer maintained</a> and <a href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=754810">has been removed from Debian Jessie</a> ;</li>
<li><a href="https://rspamd.com/">Rspamd</a> is interesting, has been <a href="https://packages.debian.org/source/jessie/rspamd">integrated in Debian Jessie</a>, but is poorly documented at this time ;</li>
<li><a href="http://bogofilter.sourceforge.net/">Bogofilter</a> does not seem to have the greatest server integration.</li>
</ul>
<h3>The actual configuration</h3>
<p>SpamAssassin's configuration is pretty straightforward. First, let's edit the /etc/default/spamassassin file :</p>
<div class="highlight"><pre>ENABLED=1
[...]
CRON=1
</pre></div>
<p>Before the cron runs for the first time, we have to manually update SpamAssassin's ruleset :</p>
<div class="highlight"><pre>sa-learn
</pre></div>
<p>Next, as usual, let's back up the original configuration file :</p>
<p>Next, to have Postfix send incoming emails through SpamAssassin, we have to edit the /etc/postfix/master.cf file. At the very beginning, we have to add a line under the smtp definition :</p>
<div class="highlight"><pre>smtp inet n - - - - smtpd
-o content_filter=spamassassin
</pre></div>
<p>At the very end of the same file, we have to add the following lines :</p>
<div class="highlight"><pre>spamassassin unix - n n - - pipe
<p>That's all for SpamAssassin ! To check if it is working, send yourself an email from another provider. You should see the following headers in it :</p>
<div class="highlight"><pre>X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
myserver.captainark.net
X-Spam-Level:
</pre></div>
<h2>Configuring SPF</h2>
<h3>Allowing your server to send emails for your domain</h3>
<p><a href="http://www.openspf.org/">SPF</a> (Sender Policy Framework) is a mechanism that confirms that your server's IP is allowed to send emails for your domain. Technically, it is a TXT DNS record which looks something like this :</p>
<div class="highlight"><pre>captainark.net IN TXT &quot;v=spf1 mx ~all&quot;
</pre></div>
<p>This DNS record lets other mail servers know that hosts that have a MX record for my domain are also allowed to send emails for it.</p>
<p>For more information on SPF syntax, you can consult the <a href="http://www.openspf.org/SPF_Record_Syntax">official documentation</a>.</p>
<p>Without a properly configured SPF record, other mail servers might flag your emails as spam or outright drop them.</p>
<h3>Checking SPF record for inbound mail</h3>
<p>Now that we have set up our own SPF record, let's configure Postfix to check that other mail servers communicating with us have done the same.</p>
<p>First, let's add the two following lines at the end of /etc/postfix-policyd-spf-python/policyd-spf.conf :</p>
<div class="highlight"><pre>Header_Type = AR
<p>Then, let's edit the /etc/postfix/master.cf file and add the following lines at the end :</p>
<div class="highlight"><pre>policy-spf unix - n n - - spawn
user=nobody argv=/usr/bin/policyd-spf
</pre></div>
<p>Let's now edit the /etc/postfix/main.cf. In the "smtpd_recipient_restrictions" section, add the "check_policy_service" line as seen below :</p>
<p><a href="http://www.dkim.org/">DKIM</a> (DomainKeys Identified Mail) is a mechanism that validates a domain name identity for an email through cryptographic authentication.</p>
<p>While not mandatory, setting up DKIM improves the odds of emails sent from your server not being flagged as spam by other providers.</p>
<p>With this configuration, OpenDKIM will also check the key for inbound emails.</p>
<h3>Software side</h3>
<p>First, let's backup the original configuration file and create a folder for the configuration files :</p>
<p>For DKIM to work, you have to configure a DNS TXT record in your zone. This record was automatically generated by OpenDKIM in the mail.txt file mentioned earlier :</p>
<div class="highlight"><pre>mail._domainkey IN TXT &quot;v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCkJq0CW3tl2XHZ1CN5XdbqRDU7KfXOJ70nlwI09bHmDU63/Yz3J5rl863S0t2ncVHfIudZANj0OaiJe5HRR7WCsjuNIhQFfPFGIWLNClpxqdQVQURI38sAGeyn7Ed/Cor1AiWABzFWzel0kvXILw8K/NTzxaAPeSa9ttwQEgSmowIDAQAB&quot; ; ----- DKIM key mail for captainark.net
</pre></div>
<p>All you have to do is to copy and paste this record in your DNS zone file.</p>
<p>To make sure that OpenDKIM is working, you can send an empty email to <a href="mailto:check-auth@verifier.port25.com">check-auth@verifier.port25.com</a>. You should receive a response with the following content :</p>
<p>It lets the owner of a domain name indicate that his email is protected by SPF and/or DKIM and what other providers should do with emails that do not pass those checks.</p>
<h3>Software side</h3>
<p>Once again, let's backup the original configuration file :</p>
<p>This tells other providers to not reject or quarantine emails should a SPF or DKIM check fail, but to send a daily report of those checks to postmaster@captainark.net.</p>
<p>For more information on the DMARC syntax, here is an <a href="https://support.google.com/a/answer/2466563?hl=en">article from Google</a>.</p>
<h2>Configuring Monit</h2>
<p><a href="http://mmonit.com/monit/">Monit</a> is a daemon that makes sure that other daemons are running. If they crash, it restarts them automatically. Is is not directly related to a mail server per say, but it's pretty easy to set up.</p>
<p>First, as always, let's backup the original configuration file :</p>
<p>Now, the <code>monit summary</code> command should have the following output :</p>
<div class="highlight"><pre>The Monit daemon 5.4 uptime: 3d 0h 41m
Process &#39;postfix&#39; Running
Process &#39;dovecot&#39; Running
Process &#39;spamassassin&#39; Running
Process &#39;opendkim&#39; Running
Process &#39;opendmarc&#39; Running
</pre></div>
<h2>Configuring Rainloop</h2>
<p><a href="http://www.rainloop.net/">Rainloop</a> is a web-based email client. I won't go into details on how to configure it in this tutorial ; here's a link to the <a href="http://www.rainloop.net/docs/installation/">official documentation</a>.</p>
<p>You'll need a web server with PHP 5.3+ to run Rainloop. You do not have to run Rainloop on the same host as your mail server. No database is required.</p>
<h2>Conclusion</h2>
<p>We now have a mail server that should be running pretty smoothly. It could still be improved by setting up things such as greylisting or virus detection.</p>
<p>If you have found this tutorial useful, if you've found an error in it or if you have any question, please feel free to leave a comment below or to contact me on <a href="https://twitter.com/captainark">Twitter</a>.</p>
<h2>References</h2>
<p>Here are the tutorials I used to set up my own mail server :</p>
<ul>
<li><a href="http://sealedabstract.com/code/nsa-proof-your-e-mail-in-2-hours/">A complete tutorial on setting up a mail server</a></li>
<li><a href="https://www.digitalocean.com/community/tutorials/how-to-configure-a-mail-server-using-postfix-dovecot-mysql-and-spamassasin">A third tutorial from DigitalOcean</a></li>
<li><a href="https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-dkim-with-postfix-on-debian-wheezy">A tutorial on setting up OpenDKIM</a></li>
<li><a href="https://guillaume.vaillant.me/?p=481">A tutorial on setting up OpenDMARC</a> (in french)</li>