FASTPANELWIKI

Email

Adding new mailboxes

On this page

Introduction

FASTPANEL® lets you adding mailboxes for both new and existing sites.

Creating a mailboxes

To create a new mailbox go to "Management" → "Mail"

Click "New mailbox"

Fill in all required fields:

  • Login – email account name. If your email address should look like test@example.com you only need to enter "test" in this field
  • Password – enter your password or generate it automatically by clicking "generate"
  • Quota(MB) – the maximum size in megabytes of the contents of the mailbox. If the value is set to zero, the mailbox size is not limited
  • Aliases – alternative names for a specific email account.An email sent to alias will be received by original mailbox.You can set m ultiple aliases for one email account.
  • Redirects (optional field) – if a redirect is set for the account, emails sent to main address will be automatically redirected to the specified address in this field. You can set Multiple redirects for one email account.
note

Do not forget to click "Add" after entering an address in Aliases and Redirects fields before clicking "Save".

How to log in your email accounts

There are two ways to log in your email account:

  1. Directly via Roundcube

    Click "Open Roundcube Web client" and enter your login and password in the opened window.

    note

    In "Login" field enter a full name of your email account. For example if your email address is mail@example.com, enter mail@example.com in the "Login" field.

  2. Instant access

    Click the corresponding icon in the line of your email account:

    By using this feature you will open your email account in Roundcube without the need to enter your access data. Instant access to Rainloop application is not supported.

Delegating mail domains

On this page

Introduction

If you need to delegate mail domains to third-party services - MX-records are required to be changed. In FASTPANEL® this action is fully automated upon condition that the panel is synchronized with an external DNS account according to this article

Delegating mail domains to third-party services

In order to delegate your mail domain you need to do the following:

  1. Go to"Management" → "DNS domains"

  2. Select the required domain and click "More"

  3. Open "Delegate mail to" drop-down menu and select a required service

For example, you need to delegate your mail domain to Google. After selecting a service, mail domain will become turned off the panel and DNS records will be changed automatically:

NameTypePriorityValue
@MX1ASPMX.L.GOOGLE.COM
@MX5ALT1.ASPMX.L.GOOGLE.COM
@MX5ALT2.ASPMX.L.GOOGLE.COM
@MX10ALT3.ASPMX.L.GOOGLE.COM
@MX10ALT4.ASPMX.L.GOOGLE.COM

To complete delegating you mail domain, follow the instructions on the corresponding service.

Mail module update

On this page

To enable and configure the new mail module, follow the steps below based on your operating system (Debian/Ubuntu or RHEL). You'll need root access via SSH to the server.

For Debian-based Systems (Debian, Ubuntu)

  1. Connect to your server via SSH as the root user.
  2. Update FASTPANEL to the latest version
apt update
apt install -y fastpanel2
  1. Install the necessary Dovecot package:
apt install -y dovecot-lmtpd
  1. Configure Exim:
/usr/local/fastpanel2/fastpanel services configure -f -p exim
  1. Configure Dovecot:
/usr/local/fastpanel2/fastpanel services configure -f -p dovecot
  1. Restart the Exim and Dovecot services:
systemctl restart exim4 dovecot

For RHEL-based Systems (Alma/Rocky linux, CentOS)

  1. Connect to your server via SSH as the root user.
  2. Update FASTPANEL to the latest version
yum install -y fastpanel2
  1. Install the necessary Dovecot package:
yum install -y dovecot-pigeonhole
  1. Configure Exim:
/usr/local/fastpanel2/fastpanel services configure -f -p exim
  1. Configure Dovecot:
/usr/local/fastpanel2/fastpanel services configure -f -p dovecot
  1. Restart the Exim and Dovecot services:
systemctl restart exim dovecot

After completing these steps, your mail services will be properly configured and switched to the new setup.

Mail settings

On this page

To access the mail settings, select "Mail" from the "Settings" section in the left navigation panel.

warning

If the "Mail" menu is not visible, refer to the following article.

General Settings

In this section, you can configure general email-related options for your server.

  • Mail compression:
    Enables or disables the compression of email stored on the server.
    Enabled: Emails are compressed, which can save disk space.

  • DSN (Delivery Status Notification):
    Allows you to request a delivery status notification for sent emails.
    Enabled: The mail server will attempt to send you a status update about whether the email was successfully delivered or not.

  • Disable IPv6:
    This option disables sending email for Exim (mail transfer agent) over IPv6 addresses.
    Enabled: Email will only be sent over IPv4.

Blacklist Management

These settings allow you to manage which senders, recipients, and IPs are blocked from interacting with your email server.

  • Sender blacklist:
    Add email addresses or domains to block incoming messages from specific senders.

  • Sender IP blacklist:
    Block incoming messages from specific IP addresses or IP ranges.

  • Recipient blacklist:
    Add recipient email addresses or domains to block outgoing messages to specific recipients.

  • DNSBL (Domain Name System-based Blackhole List):
    Configure DNS-based blocklists to block email traffic from known spammers and malicious sources.
    The system will check incoming email against DNSBL services to automatically block potentially harmful emails.

Spam protection

On this page

Introduction

FASTPANEL® allows you to enable anti-spam module SpamAssassin.

Installing and Configuring SpamAssassin

To install and configure SpamAssassin, navigate to "Settings" -> "Applications", find SpamAssassin in the list, and click the install button.
Wait until the status changes to "Installed".

Once installed, activate SpamAssassin by going to "Settings" -> "Mail" -> "General Settings".
In the "General settings" section, toggle the SpamAssassin switch to enable spam filtering.

To apply spam filtering to specific mailboxes, go to "Mail" -> "Mailboxes", select or create a mailbox, and enable the "Reject spam" option in the mailbox settings. Save the changes to complete the setup.

Checklist for successful mail sending and delivery verification

On this page

The following software will be required for further checks:

  • The host utility

    • Debian/Ubuntu: apt-get install bind9-host
    • CentOS: yum install bind9-host
  • Telnet utility

    • Debian/Ubuntu: apt-get install telnet
    • CentOS: yum install telnet

MX record

MX-record is a type of DNS-record designed to register mail servers using the SMTP protocol. This record is responsible to determine the server to which an email must be delivered by sender's mail agent. There are several records types with different priorities on one domain.

You can check if the mail works locally or uses a third-party mail server by using the host command:

host -t MX example.com

When working with the local mail server, an output will be displayed as follows:

example.com mail is handled by 10 mail.example.com.

It is worth mentioning that the mail.example.com entry can also be pointed to another server. In addition it is necessary to note that mail.example.com must be an existing A-record pointing to the server you are sending mails from.

You can also run these commands for checking:

host example.com
host mail.example.com

And compare the IP addresses to which the primary domain, in this case example.com and mail.example.com are pointed to.

important

An MX record is required to be set so that mail servers can receive your email.

MX record example:

Name: example.com.
Type: MX
Value: mail.example.com.
Priority: 10

DKIM-signature

With the help of FASTPANEL® the DKIM signature can be obitailned in management menu → "Mail" section by clicking "DKIM" in front of the required mail domain

From the DNS side the record has to be added as follows:

Name: dkim._domainkey
Type: TXT
Value: v=DKIM1; k=rsa; p=public_key

Here is an example of the correct DKIM record

dkim._domainkey TXT v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCpbBQ0T2xO3/SwziunIC/IFbsxBRub6WXiu8Kc2w7uB4GVw+SAB5wSEslDJbFXQRbdV9i/Duu8EQ9xik8dbqdLVyP4iAtw34g4j6QWKcfocgK4hEkwlPFff1dzUlNQONh2riNE5KVJXuWcizm8hub7nPnl36e7OnxiL0qIU7tT1QIDAQAB

More information about DKIM can be found at https://wikipedia.org/wiki/DomainKeys_Identified_Mail

SPF-record

The presence of an SPF record can be checked by executing host command. In this case, the command will look like this:

host -t TXT example.com

With the output like:

example.com descriptive text "v=spf1 ip4:ipv4_of_your_server ip6:ipv6_of_your_server a mx ~all"

Note that ipv6 may not be present in this entry. In this case the SPF signature will look like:

example.com descriptive text "v=spf1 ip4:ipv4_of_your_server a mx ~all"

note

It is necessary to point out that there has to be only one SFP record

On the DNS side the record should be added as follows:

Name: example.com.
Type: TXT
Value:
v=spf1 ip4:ipv4_of_your_server ip6:ipv6_of_your_server a mx ~all
or (if ipv6 is not used)
v=spf1 ip4:ipv4_of_your_server a mx ~all

For example:

example.com TXT v=spf1 ip4:1.2.3.4 a mx ~all

More information on SPF can be obtained at https://wikipedia.org/wiki/Sender_Policy_Framework

DMARC-record

In most of the cases DMARC record value will be the same.

From the DNS side the record has to be added as follows:

Name: _dmarc
Type: TXT
Value: v=DMARC1; p=none

For example:

_dmarc.example.com. TXT v=DMARC1; p=none

More information on DMARC can be found at https://wikipedia.org/wiki/DMARC

PTR record and hostname of the server

The PTR record is a reversed DNS record which converts an IP address into a name. The main purpose of this record for the mail server is to eliminate most of the spam. This record allows to determine the name of a host from which an e-mail is coming from. Most commonly a PTR-record contains a domain name used on the server.

PTR-record associates an ip-address with a host name. If PTR-record isn't specified correctly, your mails will be rejected and won't reach the addressee.

The hostname should be specified as the name of the actual domain pointing to the server, and the PTR should point to the domain, which in turn points to the server.

For example, you have a domain example.com on your server.

By running the command:

host example.com

you can get the output:

example.com has address 1.2.3.4
example.com mail is handled by 10 mail.example.com.

To avoid possible problems, it is recommended to set the hostname and PTR record as an existing second-level subdomain, for example mail.example.com

SMTP ports availability

Some hosting providers close the possibility of using ports that are used to send or receive mail. Ports for mail services can be 25, 587, 465, 143 and 993.

One of the easiest ways to check the availability of these ports is to use the telnet command.

To check the incoming connection from a third-party server

Run the command:

telnet ip_adress port

For example, if you try to telnet to port 25 at 1.2.3.4, the command to execute is:

telnet 1.2.3.4 25

If the connection is successful you will see an output like:

Trying 1.2.3.4...
Connected to 1.2.3.4.
Escape character is '^]'.

If the connection fails, the output will look like this:

Connecting To 1.2.3.4 ...
Could not open connection to the host on port some_port: Connect failed

Or:

telnet: Unable to connect to remote host: Connection timed out

For an outgoing connection

From your server, run the command:

telnet smtp.gmail.com 25

If the connection is successful you will see an output like:

Trying 2a00:1450:4010:c0b::6c...
Connected to smtp.gmail.com.
Escape character is '^]'.
220 smtp.gmail.com ESMTP j6-20020ac25506000000b004b53eb60e3csm1066162lfk.256 - gsmtp

Please note that if you use cloud hosting and use port 25 for your SMTP server, chances are your hosting provider is blocking outgoing connections on port 25 by default. Below you can see links with instructions on how to solve this problem:

In addition to port blocking by your hosting provider, you need to check if the ports on your server are closed or not. Let's take for example iptables, which acts as a firewall, using the FASTPANEL control panel. The command to check if there is a rule for a specific port, in this case 25, is:

iptables-save | grep 25

If you don't have a rule for the port you want to check, no information will be given. If you see that there is a rule blocking the port of the mail service then you need to remove this rule with the command:

iptables -D rule chain

For instance, you ran a command and found the following:

iptables-save | grep 25

-A INPUT -p tcp -m tcp --dport 25 -j DROP

This rule doesn't allow any access to your server via port 25 which will prevent mailing

To remove the rule use the command:

iptables -D INPUT -p tcp -m tcp --dport 25 -j DROP

This command example allow you to check every port used for mailing

IPv6 influence on mailing

If you need to use ipv6 for your mail services, the first thing you need to do is to check if there is a PTR record for ipv6 and if the mail services are listening to ipv6 on certain ports.

You can perform the check by using the command:

netstat -nltpp | grep tcp6

The result of the output of this command will be a list of all services that use ipv6, among which you can already check if your mail service uses this address. Unfortunately, nowadays the use of ipv6 may not work correctly even if you've done all the settings correctly.

If you found out by checking the logs of the mail service that the error is related to ipv6 and the whole configuration is correct, you can disable the use of ipv6 for the mail service.

On the example of exim4 ipv6 disabling looks like this:

  1. Check if the ipv6 address is used for the service with the command

    netstat -nltp | grep exim
  2. In the configuration file /etc/exim4/exim4.conf.template the following line must be added to the very top of the file:

    disable_ipv6=true

  3. Save changes in file and then restart the service with a command like:

    systemctl restart exim4
  4. Execute the command:

    netstat -nltp | grep exim

    to check if the service is no longer in the list

Check mail sending by using third-party services

After you have checked all of the above items you can check mail sending from your server using third-party resources.

One of the most convenient and informative services is https://www.mail-tester.com

By using it you can check the current rating of your mail, get information on whether or not the data set above is correct, as well as get a recommendation to improve the rating.

To do this, just send an email to the address that is listed on the site, and then click on "Then check your score".