So my server's hostname is
microdude, you might also get it as
microdude.localdomain. You'll want to convert it into an FQDN (Fully Qualified Domain Name). That means I need to change my
sudo vi /etc/hostname
sudo vi /etc/hosts
The output of hosts:
127.0.1.1 microdude.localdomain microdude
Would now be:
127.0.1.1 microdude.favoritemedium.com microdude
Reboot and check that the hostname has been changed to
After that, you're supposed to set up RDNS (Reverse Domain Name System), this helps avoid your mails falling prey to the all-powerful spam filter. You can check on this RDNS with
digwhich can be installed from this package:
sudo apt-get install dnsutils
This is optional, though if your mails start going into the spam folder, you'd best revisit this in the links provided.
Now to install the actual mail agent onto the server with a one-liner operation:
sudo tasksel install mail-server
The process stops at two points for user input. The first is to pick the postfix configuration for the server, select the default
Internet site. The second is to set the main domain name, this should be already be filled with
microdude.favoritemedium.comand all you need to do is accept.
Once finished, the postfix daemon should be running now. You need to know about two files, the main configuration file and the mail log. You don't need to mess around with the config file, since that should be set up correctly. The mail log is useful to check on whether mails have been sent or other information. Their locations:
Now you'll want to test whether mails can be sent out. An email can be typed out in the terminal using the
Subject: Do not panic, this is a test
Panic panic panic panic panic
Check the email account you sent the mail to and you should see that it is present.
Congratulations, you can now spam to your heart's content =^_^=.