E-mail for most userslooks like a regular website with a user-friendly interface, where you can comfortably type text, attach pictures and send messages to friends. However, in fact, everything is much more complicated. For data transfer, mail servers on Linux are used. They are engaged in processing, delivery and routing of messages. This article will discuss the most popular mail servers on Linux, as well as ways to configure some of them.
Using the mail server on Linux, you can quicklyand it is convenient to deploy your own mechanism for receiving and sending messages. There are a lot of ready-made solutions on the web that can only be installed and slightly "finished". Among them, of course, there are also more complex in the configuration of systems, the configuration of which will be shown later in the example of Postfix.
SendMail can be called a pioneer amongmail servers on Linux. The first version was released in 1983. Since then, SendMail has mastered many stations and nodes. Actively used to this day. Fast and optimized server, but does not meet modern security requirements and is quite difficult to configure.
Originally developed for internal needsIBM Research Center. Many functions and features are borrowed from SendMail. However, it is much faster, safer, and setting takes less time and effort. Can be used as a mail server on Linux, MacOS, Solaris.
This server is in fact the largesta set of scripts and configuration files. With their help, you can quickly raise the mail server on Linux with the Web-interface and without. It supports SMTP, POP3 and IMAP protocols. Installation procedure in general will not take more than 10 minutes, depending on the skill of the administrator.
While configuring a Linux mail serveriRedMail will automatically install tools to combat viruses and spam. In addition, they can be added to the mechanisms of password protection, various analyzers, and so on. An excellent version of the finished Linux mail server.
Combines several well-known protocols andtechnologies for the implementation of the transmission of e-mail messages. The system integrates the ability to create channels between nodes of the same network, for example, to organize a common mail resource for different branches of the company. The system has a very flexible configuration mechanism. It is implemented through the redefinition of variables, of which there are about 200 in the server. At the same time, several threads of IndiMail work can be created in parallel.
A Linux mail server written in C ++.There is a built-in API for managing and creating scripts. It has a lot of functions and possibilities out of the box. Several known versions of the DBMS are supported. If you want or reconfiguration, you can quickly move from one to another. Server interfaces are divided by rights to their specific zones - users, domain administrators and servers.
Probably the easiest and most convenient readya Linux-based mail server. In it, almost all the instructions and settings are executed in a special graphical interface. This mail server is based on Linux Ubuntu. Adding features or features is done by installing new modules. With its help, you can organize both a separate mail server, and a certain router or mediation node between the main highways.
Free, powerful and feature-rich zipserver. Can use both through its own web interface, and through any email client. Is able to collect mail from external mailboxes, to automatically respond to messages, filter them, and also conveniently import in CSV format.
For configuration and administration, there is its own web interface. For lovers of the classical model of control - it is possible to set commands through the console.
The server supports a large number ofOperating systems, including those from the Windows line. The process of interaction is very well documented and explained by numerous examples on the developer's site.
Cross-platform server, capable of working withe-mail and voice messages. It is possible to connect to it using e-mail clients or a centralized web interface. There is an implementation of differentiating the access rights of one account for several people. Plug-ins can help in the integration of various anti-virus systems and solutions.
After reviewing the mail servers on Linux, you should consider setting up one of them in more detail.
For example, you can show how to install and configure Postfix on Ubuntu. It is assumed that the hardware already has this operating system and updated to the latest version.
The first thing to do is download the server itself. It is available in Ubuntu repositories, so you need to type in the terminal:
During the installation, the system asks you to specify theA new password for the database user under the root account. Then it must be repeated for confirmation. Then he can ask what type of installation is of interest. Then the system mail name, in which you can specify - some.server.ru.
Now you need to create a database for the server. You can do this with the command:
mysqladmin -u root -p create mail.
It is here that you will need the password previously specified for the database.
Now you can enter the MySQL shell using the command:
mysql -u root. The system again asks for the password to be entered.
Next is a set of commands that will help create a new user with privileges:
You will also need tables in the main database, you can create them in the following way:
Now the mysql console is no longer needed and you can exit it.
First, you need to show the server howto access the database, how to search for the necessary values there. For this, several files will be created. They can be located in the / etc / postfix directory. Here are their names:
They should contain the following content, among which the query string for each file will be unique:
user = the name of the admin specified when the table was created;
password =
dbname = the name of the database created;
query = query, its own for each file;
hosts = 127.0.01.
Variable query for files:
These files will contain a password for entering the database, so you need to somehow limit them. For example, set the right, it's restrictive.
Now it's time to add some more settings to Postfix. It is worth noting that in the lines listed below, you need to replace some.server.ru with a real domain.
First, you need to create your own certification authority, which will confirm the reliability of all certificates.
A repository for files is created:
mkdir ~ / CA_new
And the configuration file. It contains the following code:
A short explanation to it:
Then the key itself is created:
sudo openssl genrsa -des3 -out ca.key 4096
The system will prompt you for a password for this key, which in no case should be forgotten.
Now you need an open version of the key:
openssl req -new -x509 -nodes -sha1 -days 3650 -key ca.key -out ca.crt -config ca.conf
Here you will need to enter the previously created password for the private key.
Now the certificate:
openssl pkcs12 -export -in ca.cer -inkey ca.key -out ca.pfx
Next, you need to create a directory where all the generated keys will be stored. Each server has its own folder.
mkdir SERV
mkdir SERV / some.domain.com
And it creates its own configuration:
nano SERV / some.domain.com/s openssl.conf
Inside it should be the settings shown below. They are similar to those that have already been created.
To generate the keys, use the command:
sudo openssl genrsa -passout pass: 1234 -des3 -out SERV / some.server.ru / server.key.1 2048
This line uses the password 1234. It is needed for a while.
Now the password from the team is removed:
openssl rsa -passin pass: 1234 -in SERV / some.server.ru / server.key.1 -out SERV / some.server.ru/server.key
Now you need to sign the key:
openssl req -config SERV/com.erver.ru/openssl.conf -new -key SERV/com.erver.ru/server.key -out SERV/com.erver.ru/server.csr
And delete the temporary: rm -f SERV / some.server.ru/server.key.1
With the help of the manipulationsA mail server that can simply receive and send messages. In addition to the main ones, there are additional modules that can be installed to expand the functionality. This will create a full-fledged mail server on Linux for the enterprise.
The following modules can be used to extend the capabilities of the mail server, for example, "Antispam" or a distribution service.
As you can see from the article, installation and configurationa full-fledged mail server manually is a long and difficult task. However, this approach will allow to understand in general how the system works and to know its vulnerable and strong places. In case of problems, the trained administrator can quickly localize and fix the problem. It will be especially relevant for large companies whose work is completely dependent on the promptness of receiving and sending messages to customers or partners. For smaller networks, the "out of the box" solution is also quite suitable, which can be quickly deployed using a user-friendly interface.
However, in the event of a server failure, you will have to dig deeply and understand the system device. An article on the example of Postfix mail servershowed the basic methods and methods of customization for primary work. Together with a large number of modules, plug-ins and add-ons, this will create a powerful and reliable tool for sending and receiving messages.