Following from the Mail server overview, we can start creating our mail server by preparing the Slice and setting the hostname and RDNS.
The series assume you have followed the base setup articles for your Slice and that you are using Ubuntu Hardy.
If you have not followed the setup articles, packages may be missing.
Using another distro will mean it is very unlikely the articles will work as intended.
Hostname and RDNS basics
Once the base setup has been completed we need to set the hostname and RDNS for our Ubuntu Hardy Slice.
The hostname is simply what the Slice calls itself. Although more relevant to single domain setups, it is still important to set the hostname correctly.
The RDNS helps identify the Slice as legitimate and reduce the chances of our emails being classed as spam by the more eager spam filters that exist.
In this series we will be using two example domains:
Both these domains exist and will have the various DNS records (MX, SPF, etc) set according to the articles.
The thing to note in the setup is the 'master' domain is demoslice.com - this is the domain we will use when setting the hostname and the RDNS.
Where confusion can arise is when we start using more than one domain. That is, when we start sending email from testslice.com.
Remember we are setting up postfix to handle multiple domains. The headers in the email will be set to the correct domain.
What is important to understand is that each domain will have its own DNS records. As such, both domains will have the MX records pointing to 'mail.demoslice.com' and have SPF records set to the relevant details.
As long as the details in the DNS records are correct, the email will not be classed as spam. It doesn't matter that mail from testslice.com is being sent via mail.demoslice.com. The reason it doesn't matter is that we will have defined that mail is to sent from that location in the DNS records for testslice.com.
It can be a difficult concept to understand but look at it this way - when you post a physical letter you do so from a genuine and legitimate post box. As long as the post box is both genuine and legitimate, then it will arrive at its destination without issue. The same principle applies here: as long as the email is sent from a legitimate server (which is defined in the DNS records) then you will have no issues.
Set the DNS
As we've discussed, then, set up basic DNS records for your mail server host names. You can make the changes through the SliceManager. If you need some help doing so you can browse through this article on DNS.
Setting the hostname
Check the current hostname of your Slice with:
In my case, the test Slice was built with the name 'slice1'. As such the resulting hostname is:
Let's change that by configuring two files:
sudo nano /etc/hostname
Replace the hostname with your mail server hostname. In this case, I will replace 'slice1' with 'mail.demoslice.com'.
sudo nano /etc/hosts
Again, replace your current Slice name with your desired hostname.
having replaced my current Slice name (slice1) with my desired hostname (mail.demoslice.com) we need to do a quick reboot of the Slice:
Once the Slice has rebooted, log back in and check the hostname:
In my case, it now shows:
If you get an error along the lines of "name or service not found", that means the system is having trouble getting the fully qualified domain name for your system from DNS. Double-check the records you created in DNS for the mail servers.
Now we need to set the RDNS for the Slice. This is a very important step in the creation of our mail server. Many mail servers will check the RDNS matches the expected details. If the RDNS does not match then the mail can be classed as spam.
For example, when we set the DNS records for testslice.com we will defined the MX records to point to mail.demoslice.com. If the RDNS of that IP does not match then the mail is likely to be rejected.
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 of the Slice into the 'dig' command.
Note that 'dig' is not installed on a base Ubuntu Hardy Slice:
sudo aptitude install dnsutils
Once installed you can check the RDNS:
dig -x 18.104.22.168
In this case, the output includes the correct answer:
dig -x 22.214.171.124 ... ... ;; QUESTION SECTION: ;126.96.36.199.in-addr.arpa. IN PTR ;; ANSWER SECTION: 188.8.131.52.in-addr.arpa. 3477 IN PTR mail.demoslice.com.
Preparing the Slice is a vital step in any setup but is doubly important when it comes to installing a mail server.
The next article will llok at creating a vmail user and mailboxes.