How To Install And Configure Qmail In OpenSUSE 42.1

The title says it all. Right? Today, we will know how we can install and configure Qmail (a mailing agent) on our OpenSUSE 42.1 Linux distribution so that our server act like a mail server. Mail server based on Linux platform is the best choice due to many reasons like security, maintenance, less troubleshooting etc etc.

Let’s start then.

What is Qmail?

Qmail is one of the best mail transfer agent (MTA) in Linux driven platforms. In December 1995, Qmail was written by Daniel J. Bernstein. It gets it’s popularity due to security. It is the first security-aware mail transport agent. After Qmail, few other MTAs have been published with the same feature. Qmail is based on modular architecture where each major function is separated from the other major functions.

Performance wise, Qmail is significantly faster than Sendmail (Another famous MTA ) specially when used for bulk mail tasks such as large mailing list servers. Qmail is much simpler to configure and deploy rather than other MTAs.

You can download and install Qmail for almost all popular Linux distribution like Redhat, Debian, Cent OS, Ubuntu etc etc.

Why OpenSUSE?

OpenSUSE is a very famous Linux distribution. It is widely used by System Admins now a days and too good for software development purposes. Many enterprise grade application production environment runs on OpemSUSE. You can install this on your Laptop and enjoy the beauty of OpenSUSE. Beyond the distribution, the openSUSE Project provides a web portal for community involvement. It is built for software developers and system administrators, also has a user-friendly desktop, and feature-rich server environment. Also, It has both KDE & GNOME Desktop environment.

Installing Qmail

Before installing Qmail on to your server, we have to check our checklists so that we can make sure our that our server works perfectly. Checklists are as follows

Purchasing your domain from a domain register like Godaddy, Namecheap or from others.

Setting up host name / server name properly. Something like mail.yourdomain.com. This is good practice to do.

You must have a public / real IP address set yo your NIC / LAN card set statically / manually.

Name server entry in your DNS Server for resolving your mail server host name (mail.yourdomain.com). This is for resolving your host name against your Public / Real IP address. I will not cover this over here.

Implementing DomainKeys Identified Mail (DKIM) system so that mail send from your mail server is not treated as spam or junk mail by others. Though, I will not cover this over here. You need to Google for that in order to implement it. Its not that hard though.

Make sure you don’t have any other MTA installed on your system except Qmail. If you found other MTA, then you must remove / uninstall those.

Make sure your firewall / iptables is not blocking 25 & 110 port.

Setting Host name

To set your server host name like mail.yourdomain.com, open a terminal and issue the following command.

sudo vim /etc/hostname

Here, I am using vim as a editor. You can use your own favorite editor. Type the host name like mail.yourdomain.com and save & exit from the file.

Then, issue the following command.

sudo vim /etc/hosts

And then just type it like the below image.

Note: You can see that I am using 192.168.1.13 for my IP address. But here, you need to use your own public / real IP address instead of using mine. Please make sure of it. After doing this, you may need to reboot your system so that the changes made by you can take place.

Stay up to date

Before starting, make sure all the packages / software that you have on your system is up to date. This is a good practice to stay up to date. To do so, issue the below command on your terminal.

sudo zypper update

It may take a while depending on the internet speed of yours. After successful update, you must reboot your system as well.

Remove / Uninstall other MTA

To remove or uninstall other MTA on your system, let’s search is first and then uninstall it from the system. To do so, issue the following on a terminal

sudo zypper search sendmail

sudo zypper search postfix

Now, if you found something from the above command, then you need to remove it from your system. Let’s revome it by doiing the followings

sudo zypper remove sendmail

sudo zypper remove postfix

Now, download the latest source of Qmail from here. As this is the source file of Qmail in tar archive file format, we need to extract the contents of it and need to compile it to install.

Or

You can open a terminal and issue the following command to install it directly. But we need to add the repository first for his. Let’s add the Qmail repository.

Now, open the file located /etc/spamdyke/spamdyke.conf with any file editor and put # or commented out line 4 & 44.

Now, restart Qmail. If everything goes well and if you don’t encounter any error, then we are done with it.

Testing Qmail

Let’s testing Qmail whether it is really working or not. Open a terminal and issue the below command.

sudo telnet localhost 25

If it is succesfull then you will see something like below image.

As you can see that, it is 220 and with a welcome message indicating that its listening to port 25 and your server is ready to send mail.

I didn’t cover many other things which are related to mail server like spam-filtering, web mail etc etc as I want to stay with the basics without diving deep onto it . But I hope that you will enjoy this and it will help you a lot.

POPULAR CATEGORY

Unixmen provide Linux Howtos, Tutorials, Tips & Tricks ,Opensource News. It cover most popular distros like Ubuntu, LinuxMint, Fedora, Centos. It is your Gate to the the world of Linux/Unix and Opensource in General.