Modes of operation of mail servers

image

When installing Postfix on Debian-based distributions, a pseudo-graphic interface is launched with a set of templates for installation. These templates are aimed at different modes of operation of the mail server, which depend on whether the mail server will accept mail, forward it and various variations of these two modes. But these are just templates that are easy to change after installing the server. Although I use Postfix on Debian as an example, these modes are universal for all mail servers.

Video


Previous < How email works
Next> About ports and encryption in mail servers

The “No configuration”



option The first option in the list is No configuration — if you select this, the mail server will not create the main configuration file, which is convenient when we have our own ready-made config file .

If you want to restart the installation script, you need the command:

sudo dpkg-reconfigure postfix

Option “Internet Site” The





second mode - Internet Site - is a template for a standard mail server that will receive mail and send it directly, without intermediaries. Let's go through the configuration options.



First, we need to specify the name of the mail - that is, the domain for the mail addresses that is indicated after the dog. By default, postfix uses users on the system as users of the mail server. Thus, if you have a user user in the system, then he will be able to receive and send mail to user@example.org



For security reasons, it is not recommended to use the root account to work with mail, so we are asked to indicate the user to whom all mail arriving at the addresses of postmaster, root and other system users will be forwarded. Often, various applications in the system, such as the cron task scheduler, send information to these addresses.



Further, the installer asks us to specify the domains to which our mail server will receive mail. Here, in addition to our main domain address, there are also localhost entries and various hostname variations. This is mainly needed for various internal services that send notifications. Also, as an option, some services send certain notifications to the full address of your mail server, let's say that your mail server has been listed in spam lists, for example, to postmaster@mail.example.org.



Now the question is about synchronous updates. This question relates more to loaded mail services and speaks of the following. If we enable synchronous updates, the mail server will make sure the message is written to disk every time a message is sent and received. This reduces the performance of the mail server, but if the server suddenly shuts down when receiving or sending mail, there will be no lost messages. But if we use a journaling file system, such as ext3 or ext4, then our system is not afraid of a sudden shutdown.



This is due to the fact that in a journaled file system all changes in the file system are pre-recorded in a special journal, which applies these changes, and then deletes them from the journal.





If the server suddenly turned off at the time of recording, then when you turn it on, the file system checks the log, sees incomplete changes and writes them to disk. Therefore, if you use a journaling file system, feel free to click No.



Now we are offered to specify those networks for which postfix will act as a relay host. In this role, the mail server not only accepts mail to its domain, but can also forward messages to other mail servers. Suppose you can send a message to Gmail by specifying not smtp.gmail.com but mail.examle.org as the outgoing mail server, then your mail server will take care of delivering your message to smtp.gmail.com. We will talk about this in more detail later, when we will discuss other templates. In the meantime, if you do not plan to use your server as a host relay, you can leave only the localhost in the field.



Everything is simple here - the default maximum size of the user's mailbox, in bytes. If it is 0, no limit.



Then something more interesting -custom aliases . In general, aliases in mail servers are used so that one user can receive mail at several addresses, without creating separate users, mailboxes, etc. Say, if you want all messages to it@example.org to be sent to user@example.org, then an alias is used for this. Also, using aliases, different domains are bound to one user. These aliases can be created by the mail server administrator. But, an administrator can allow users to create something like aliases to make it easier for users to manage their mail. But these user aliases do not replace the entire address, but are added before the dog, after using the special character, say, a plus. As an example, gmail also provides this feature:



For example, user+work@example.org, or user+social@example.org. The user can specify these addresses on various resources during registration, which will make it easier for him to sort letters and manage his mail. If you do not need this functionality, you can leave this field empty.



Next, you should choose whether our mail server will work with ipv4, ipv6, or with both protocols.

On this setup with the Intenet Site template is ready, theoretically you can get to work.

Option "Internet with smarthost"





The third option among the mail server operating modes is internet with smarthost. This is a configuration template for a server that will accept mail directly, or using any utilities such as fetchmail, but the server will send mail to external addresses using other mail servers - host relays, which are also called smart hosts. This can be used in various cases, for example, if your server’s IP address is blacklisted, or to allow outgoing corporate mail through a leak prevention service, etc.



In general, all the options in setting up this mode also look the same, with the exception of the relay server. A smart host can be indicated in square brackets and without, depending on whether you need to send messages immediately or after making an MX request, which allows you to balance traffic between multiple smart hosts.



In the template, we can specify the default smarthost, and in the future we can configure various relays depending on the recipient's domain.

Satellite System Option





Another mode of operation of the mail server is the Satellite system. In this mode, the mail server does not accept mail, but only redirects, that is, it works exclusively as a relay host. From the example earlier, this can be useful in large organizations for internal services, as well as for filtering mail for spam, viruses, etc. In this case, the configuration is almost identical to the previously mentioned options, but in mydestionations you should not leave domains so that the host redirects everything to the necessary mail servers.

Option "Local only"



And the last template - Local only - when our mail server will not send and receive mail from other servers.

All that we talked about earlier are just templates of the mail service operating modes. User cases are different and often such template settings are not enough, and many points need to be reconfigured for your tasks.

All Articles