FortiMail - Relay Basic Configuration

 

Problem

Nowhere is it written exactly how FortiMail must be configured in Relay Mode to run a secure Basic Mail Server.
Here is a summary of most of the settings:

Solution

System

Network

  1. Configure your Interfaces
  2. Be sure that you have configured an default Gateway

Port Forwarding

FortiMail are able to forward Traffic from a the internet to the local LAN (DNAT). For more information: FortiMail Doc

FortiGate

The FortiGate are able to send SMTP traffic through an WCCP Tunnel to the FortiMail for scanning. See for more information: FortiDoc

Configuration

  1. Set the correct Time Zone
  2. Configure your Password Policy
  3. Change the Admin Ports to non default ports
  4. If you need configure the SNMP settings

Mail Settings

  1. Set the Hostname and the Local domain name. Togther there are the FQDN of the FortiMail.
  2. Activate the SMTP MA service (use other ports for mail submiting by clients as mail transfer to other Mail servers. 

FortiGuard

  1. Activate the License

Domain & User

Domain

Configure your Domain as new Domain. The following settings are important:
  • Domain name
  • Host (or other setting, in depend of your enviroment)
  • Enable Recipient Address Verification
  • Enable Automatic Removal of Invalid Quarantine Accounts

This settings enable the mail forwarding to the Mailserver. If you want you can active Relay Authentication. For that you need an own User Account on the Mailserver only for relaing. 

User

Because we run FortiMail in relay mode, we do not need to create the users on the FortiMail. Nevertheless, user settings for quarantine etc. can be configured here. You can find more information in the documentation.

Policy

First, it is very important to understand how policies works. To be short:
  • Access Control: Let you control the SMTP Traffic after the FortiMail accept the TCP/IP connection. This ACLs control what happen with the SMTP Traffic it self for receiving and delivery.
  • IP-Policy: Control the IP Traffic in general. Who is allowed to connect to the FortiMail and with which limitations (Session Profile).
  • Recipient Policy: This rules control the IP Traffic based on the Recipient in the SMTP Header "RCPT TO:". That the only place where you are able to assing the Ressource Profile.
Read the Manual for deep information. It is very important to understand how the polices works!

TIPP:
  • Use IP-Policy where is possible. Recipient Policies makes the evaluation complicate and is often not needed.
IMPORTANT:
Never create on a FortiMail in Relay Modus the following rule:
Becuase if you allow all Mails from anywhere with all senders and recipient you create an open relay and anyone on the world can use your FortiMail as relay host! NEVER DO THAT!


Order of execution of policies

  1. The FortiMail unit looks for a matching IP-based policy
  2. The FortiMail unit loosk for a matching Recipient policy
  3. The FortiMail execute the Recipient policy first (except you enable Take precedence over recipient based policy match)
  4. The FortiMail execute the IP-based policy (only if there some setting which are not set by the recipient policy. No override of settings!)
  5. If traffic allowed: Go further with the Access-Control Policies
Important to now:
  • If the connection not matching any IP-based policy or recipient policy it is allowed and no antivirus or antispam policies are applied!
  • If the connection not matching any Access-Control Policies and the sender is a trusted domain the connection is allowed!

Examples

IP-Policy

The first rule enable outgoing mails (with SMTP Authentication). The second rule allow incoming mails from anywhere. And the both last rules block all other connection in IPv4 and IPv6.

Recipient Policy

Disable all Inbound and Outbound policies.

Access-Control

The first rule allow outgoing Mails only comming from the internal Mail server. The second rule allow all incoming mails from external. And the last rule reject all not authenticated mails from anywhere else.

Profiles

With the different security profiles you have a lot of options. With the default profiles you can work securelly. Please red the guide to find more information about the different options. Link to the guide

More Options

In this post I focus to the important settings to run the FortiMail in Server Mode successfully. The FortiMail as a lot of more features, please read the guide to find out more. ;)

Comments

Popular posts from this blog

FortiGate BGP dual-home with multiple ISP

FortiMail - Server Basic Configuration

FortiGate as DNS Server or DNS Proxy