Beginning a series of articles on many aspects of email (sending, receiving, configuring, etc), we need to start with the very basics by preparing the Slice.
This article looks at the hostname and reverse DNS (RDNS) settings on the Slice.
The only assumptions made for these email articles are:
1: You are running Ubuntu Hardy (The instructions may work on other distros but it has not been tested and is not guaranteed)
Beyond that, I hope to show everything that is needed from the very basics upwards.
The first thing to look at is the Slice hostname.
This is simply the 'name' of the Slice and is used in the headers of the email (the headers can be thought of as the address and sender label on the email).
There are a couple of ways of setting the host name.
When you build a new Slice or rebuild a Slice, you are given the opportunity to set the Slice name - this can be a FQDN (Fully Qualified Domain Name). This name is then used to set the hostname when the Slice is built.
This can be a quick and easy way of setting the hostname.
However, you do not have restrict your Slice name to match that of the hostname.
On the demo account I have a Slice named 'slice1'. As such, the hostname of the Slice was initially set as 'slice1'.
I don't want to rebuild the Slice and I am happy with the Slicemanager name of 'slice1'. As such, let's look at changing the hostname from the command line:
Setting the hostname via the command line involves the very simple adjustment of a couple of files.
We can start by checking what the current hostname is:
On my Slice, the output is:
Well, that makes sense. When I built the Slice I named it 'slice1' in the Slicemanager. As such, the hostname was set to 'slice1'.
For these basic articles I am going to use the domain 'mail.demoslice.com' - I am setting up a mail server so that makes sense.
I need to change the hostname to match the domain:
sudo nano /etc/hostname
Replace the current hostname (slice1) with the one you need (in this case mail.demoslice.com).
The second file to edit is:
sudo nano /etc/hosts
The default looks like this on my Slice:
127.0.0.1 localhost localhost.localdomain 127.0.0.1 slice1
Following on from what we are doing, replace 'slice1' with 'mail.demoslice.com'.
Of course, replace mail.demoslice.com with your domain.
Conduct a quick reboot:
and check the hostname:
The output is now:
The second main aspect we need to look at when preparing the Slice is the Reverse DNS (RDNS).
One of the main reasons for email being marked as spam and causing IP addresses to be blocklisted is a mismatch between the sending domain and the RDNS of the Slice.
We can check the RDNS of the Slice from the Slicemanager.
Log into the Slicemanager
Once done, click the DNS tab and then the 'Reverse DNS' link.
On the demo account, one of the Slices has this record as the default:
All we need to do is change the default entry to match our main domain:
Check the RDNS
The RDNS may take a while to propagate and you really need to wait until it has done so before you can fully configure and test any mail setup.
To check the RDNS, you need to input the IP address if the Slice into the 'dig' command.
Note that 'dig' is not installed on a base Ubuntu Hardy Slice:
sudo aptitude install dnsutils
(Many thanks for the comments that noted dig is not installed by default - I use my workstation to conduct dig commands and didn't think that others may use the Slice for that!)
So, to check the RDNS:
dig -x 184.108.40.206
In this case, the output includes the correct answer:
dig -x 220.127.116.11 ... ... ;; QUESTION SECTION: ;18.104.22.168.in-addr.arpa. IN PTR ;; ANSWER SECTION: 22.214.171.124.in-addr.arpa. 3477 IN PTR mail.demoslice.com.
Preparing the Slice is a vital step in any mail setup - even if 'only' sending mail from your application to an administrator, it is very important to get the basics right.
As the articles progress you will start to see where this preparation comes into play when sending and receiving emails.