Electronic Mail Service (SMTP/POP3-IMAP4)¶
Zentyal uses Postfix [6] as a MTA. For the MDA (POP3, IMAP), it uses Dovecot [7]. Both come with support for secure communication over SSL. To fetch mail from external accounts, Zentyal uses Fetchmail [8] .
[6] | Postfix The Postfix Home Page http://www.postfix.org . |
[7] | Dovecot Secure IMAP and POP3 Server http://www.dovecot.org . |
[8] | http://fetchmail.berlios.de/ |
SMTP/POP3-IMAP4 server configuration with Zentyal¶
Receiving and relaying mail¶
To understand the mail system configuration, the difference between receiving mail and relaying mail must be clear.
Reception occurs when the server accepts a mail message which recipients contain an account that belongs to any of its virtual mail domains. Mail can be received from any client that is able to connect to the server.
Relay occurs when the mail server receives a message which recipients do not belong to any of its managed virtual mail domains, thus requiring forwarding of the message to other servers. Mail relay is restricted, otherwise spammers could use the server to send spam all over the Internet.
Zentyal allows mail relay in two cases:
- Authenticated users.
- A source address that belongs to a network object which has a allowed relay policy enabled.
General configuration¶
Accessing Mail ‣ General ‣ Mail server options ‣ Options, you can configure the general settings for the mail service:
- TLS for SMTP server:
- This forces the clients to connect to the mail server using TLS encryption, thus avoiding eavesdropping.
- Require authentication:
- This setting enables the use of authentication. A user must provide an e-mail address and a password to identify; once authenticated, the user can relay mail through the server. An account alias can not be used to authenticate.
Smarthost to send mail:
If this option is set, Zentyal will not send its messages directly, but each received e-mail will be forwarded to the smarthost without keeping a copy. In this case, Zentyal is an intermediary between the user who sends the e-mail and the server that actually sends the message.
Here you can set the domain name or IP address of the smarthost. You could also specify a port appending the text :[port_number] after the address. The default port is the standard SMTP port, 25.
- Smarthost authentication:
- This sets whether the smarthost requires authentication using a user and password pair, or not.
- Server mailname:
- This sets the visible mail name of the system; it will be used by the mail server as the local address of the system.
- Postmaster address:
The postmaster address by default is an alias of the root user, but it could be set to any account; either belonging to any of the managed virtual mail domains or not.
This account is intended to be a standard way to reach the administrator of the mail server. Automatically-generated notification mails will typically use postmaster as reply address.
- Maximum mailbox size allowed:
- Using this option you could indicate a maximum size in MB for any user’s mailboxes. All mail that exceeds the limit will be rejected and the sender will receive a notification. This setting could be overridden for any user in the Users and Groups ‣ Users page.
- Maximum message size accepted:
- It indicates, if necessary, the maximum message size accepted by the smarthost in MB. This is enforced regardless of any user mailbox size limit.
- Expiration period for deleted mails:
- If you enable this option, those mail messages that are in the users’ trash folder will be deleted when their dates exceeds the established limit.
- Expiration period for spam mails:
- This option applies, in the same way as the previous option, but refers to the users’ spam folder.
In addition to this, Zentyal can be configured to relay mail without authentication from some network addresses. To do this, you can add relay policies for Zentyal network objects through Mail ‣ General ‣ Relay policy for network objects. The policies are based on the source mail client IP address. If relay is allowed by an object, then each object member can relay e-mails through Zentyal.
Warning
Be careful when using an Open Relay policy, i.e. forwarding e-mail from everywhere, your mail server will probably become a spam source.
Finally, the mail server can be configured to use a content filter for messages [10]. To do so, the filter server must receive the message from a specific port and send the result back to another port where the mail server is bound to listen to the response. You can choose a custom mailfilter or use Zentyal as a mail filter through Mail ‣ General ‣ Mail filter options. If the mailfilter module is installed and enabled, it will be used by default.
[10] | This topic is deeply explained in the Mail filter section. |
E-mail account creation through virtual domains¶
To set up an e-mail account, a virtual domain and a user are required. You can create as many virtual domains as you want from Mail ‣ Virtual Domains. They provide the domain name for e-mail accounts of Zentyal users. Moreover, it is possible to set aliases for a virtual domain, so that sending an e-mail to a particular virtual domain or to any of its aliases becomes transparent.
In order to set up e-mail accounts, you have to follow the same rules used when configuring filesharing. You can select the main virtual domain for the user from Users and Groups ‣ Users ‣ Edit Users ‣ Create mail account. You can create aliases if you want to set more than a single e-mail address for a user. Regardless of whether aliases have been used, the e-mail messages are kept just once in a mailbox. However, it is not possible to use the alias to authenticate, you always have to use the real account.
Note that you can decide whether an e-mail account should be created by default when a new user is added to Zentyal. You can change this behaviour in Users and Groups ‣ Default User Template ‣ Mail Account.
Likewise, you can set up aliases for user groups. Messages received by these aliases are sent to every user of the group with an e-mail account. Group aliases are created through Users and Groups ‣ Groups ‣ Create alias mail account to group. The group aliases are only available when, at least, one user of the group has an e-mail account.
You can define an alias to an external account as well, that is, mail accounts associated to domains not managed by your server. The mail sent to that alias will be forwarded to the external account. These kind of aliases are set on a virtual domain basis and do not require an e-mail account. They can be set in Mail ‣ Virtual Domains ‣ External accounts aliases.