Fortinet Fortimail Lab Guide For Fortimail 72
Fortinet Fortimail Lab Guide For Fortimail 72
© FORTINET
FortiMail
Lab Guide
for FortiMail 7.2
DO NOT REPRINT
© FORTINET
Fortinet Training Institute - Library
https://training.fortinet.com
https://docs.fortinet.com
https://kb.fortinet.com
https://fusecommunity.fortinet.com/home
Fortinet Forums
https://forum.fortinet.com
https://support.fortinet.com
FortiGuard Labs
https://www.fortiguard.com
https://www.fortinet.com/nse-training
https://home.pearsonvue.com/fortinet
https://helpdesk.training.fortinet.com/support/home
9/13/2022
DO NOT REPRINT
© FORTINET
TABLE OF CONTENTS
Network Topology 8
Lab 1: Initial Setup 9
Exercise 1: Verifying DNS Records 10
Verify MX Records 10
Exercise 2: Configuring FortiMail in Server Mode 12
Verify the Operation Mode 12
Configure System Settings 12
Configure Mail Settings 14
Configure Server Mode Users 14
Verify Mail Flow 15
Configure the MUA Client 16
Exercise 3: Configuring FortiMail in Gateway Mode 20
Configure System Settings 20
Configure Mail Settings 21
Verify Mail Flow 22
Lab 2: Access Control and Policies 24
Exercise 1: Establishing Outbound Email Flow 25
Verify Authenticated Outbound Relay 25
Configure Access Receive Rules 26
Verify Access Receive Rules 27
Exercise 2: Configuring a Relay Host 30
Configure a Relay Host 30
Verify the Relay Host 31
Exercise 3: Tracking Policy Usage 33
Generate Email Logs 33
Review Log Entries 33
Exercise 4: Creating Policies 36
Create an IP Policy 36
Create Recipient Policies 37
Verify the Policy Configuration 39
Lab 3: Authentication 41
Exercise 1: Enforcing User Authentication 42
Disable SMTP Authentication 42
DO NOT REPRINT
© FORTINET
Enforce Authentication 44
Verify Authentication Enforcement 45
Restore SMTP Authentication on Thunderbird 46
Exercise 2: Integrating LDAP 48
Review the OpenLDAP Configuration 48
Configure an LDAP Profile on IntGW and IntSRV FortiMail 51
Validate the LDAP Profile Configuration 53
Configure Recipient Address Verification and Alias Mapping 56
Configure LDAP Authentication for Gateway Mode Webmail Access 57
Configure LDAP Authentication for Server Mode Users 58
Validate LDAP Authentication 59
Exercise 3: Blocking SMTP Brute Force Attacks 63
Configure Authentication Reputation 63
Generate an SMTP Brute Force Attack 63
Lab 4: Session Management 67
Exercise 1: Limiting SMTP Connections 68
Configure Connection Limits 68
Validate Connection Limits 69
Disable Connection Limits 71
Exercise 2: Configuring Sender Address Rate Control 72
Configure Sender Address Rate Control 72
Validate Sender Address Rate Control 74
Disable Sender Address Rate Control 75
Exercise 3: Hiding Internal Headers 76
Configure Header Manipulation 76
Validate Header Manipulation 77
Lab 5: Antivirus 79
Exercise 1: Configuring Antivirus Scanning 80
Configure an Antivirus Action Profile 80
Configure an Antivirus Profile 81
Apply Antivirus to Inbound Emails 82
Validate Antivirus Functionality 82
Lab 6: Antispam 85
Exercise 1: Scanning Incoming Email for Spam 86
Verify FortiGuard Configuration 86
Configure an Antispam Action Profile 87
Configure a Resource Profile 87
Configure an Antispam Profile 88
Apply Antispam Scanning to Inbound Emails 91
Validate the Antispam Configuration 91
Exercise 2: Scanning Outgoing Email for Spam 94
DO NOT REPRINT
© FORTINET
Configure an Outbound Antispam Profile 94
Apply Antispam Scanning to Outbound Emails 95
Validate the Antispam Configuration 95
Exercise 3: Managing User Quarantine 97
Access a Personal Quarantine 97
Configure Quarantine Reports 97
Exercise 4: Configuring Impersonation Analysis 101
Configure an Impersonation Analysis Profile 101
Apply Impersonation Analysis to an Antispam Profile 102
Validate Impersonation Analysis 103
Exercise 5: Configuring Bounce Verification 105
Disable Recipient Address Verification 105
Send Backscatter Spam 105
Configure Bounce Verification 106
Validate Bounce Verification 108
Lab 7: Content Inspection 109
Exercise 1: Configuring Content Inspection 111
Configure a Dictionary Profile 111
Configure a Content Profile and Action 111
Apply Content Inspection to Inbound Emails 113
Validate Content Inspection 113
Exercise 2: Configuring DLP 116
Configure a DLP Scan Rule 116
Configure a DLP Profile 117
Apply DLP Scanning to Outbound Emails 119
Validate DLP Scanning 120
Exercise 3: Configuring CDR 122
Configure a Content Action Profile for CDR 122
Configure CDR 123
Apply CDR to Inbound Emails 124
Validate PDF Sanitization 125
Validate URI Removal 126
Validate HTML Content Sanitization 127
Lab 8: Secure Communications 129
Exercise 1: Implementing SMTPS 130
Verify STARTTLS Usage 130
Configure SMTPS 132
Verify SMTPS 133
Exercise 2: Implementing Content Inspection-Based IBE 135
Configure the IBE Service 135
Configure the IBE Trigger Word 136
DO NOT REPRINT
© FORTINET
Configure an Encryption Profile 137
Configure a Content Action Profile to Trigger IBE 137
Configure a Content Profile for IBE 138
Validate IBE 139
Exercise 3: Accessing IBE Emails 141
Register an IBE User 141
Lab 9: High Availability 144
Exercise 1: stConfiguring HA 147
Configure the Mail Server Settings on the Primary FortiMail 147
Configure the HA Settings on the Primary FortiMail 147
Configure the Mail Server Settings on the Secondary FortiMail 148
Configure the HA Settings on the Secondary FortiMail 149
Verify the HA Status 150
Exercise 2: Verifying the Health of the Cluster 152
Verify the HA Status 152
Verify the HA Synchronization Status on the CLI 154
Exercise 3: Configuring a Virtual IP for the HA Cluster 156
Configure a Virtual IP on the Primary FortiMail 156
Verify the Virtual IP Configuration 157
Trigger a Cluster Failover 157
Restore the Cluster 158
Exercise 4: Monitoring Remote Services 159
Configure SMTP Service Monitoring on the Primary FortiMail 159
Configure SMTP Service Monitoring on the Secondary FortiMail 160
Trigger a Service-Based Failover 161
Restore the Cluster 163
Lab 10: Server Mode 165
Exercise 1: Configuring Resource Profiles 166
Review the Server Mode Configuration 166
Configure Resource Profiles 167
Apply the Resource Profiles to a Recipient Policy 168
Validate the Resource Profile Configuration 169
Exercise 2: Importing Contacts From LDAP 171
Review the Existing LDAP Profile 171
Configure an LDAP Mapping Profile 172
Import Contacts From LDAP 174
Verify the Domain Address Book From Webmail 175
Lab 11: Transparent Mode 177
Exercise 1: Configuring a Transparent Mode FortiMail 178
Verify the ExtTP FortiMail System Configuration and Topology 178
Configure Connection Pickup 180
DO NOT REPRINT
© FORTINET
Configure the Mail Server Settings 181
Configure a Protected Domain 181
Configure an Access Control Rule for Outbound Emails 183
Validate Transparent Mode Functionality 183
Exercise 2: Configuring Bidirectional Transparency 186
Review Outbound and Inbound Message Headers 186
Configure Bidirectional Transparency 187
Verify Inbound Transparency 187
Verify Outbound Transparency 188
Configure SMTP Greeting Rewrite 188
Validate SMTP Greeting Rewrite 189
Lab 12: Maintenance 190
Exercise 1: Configuring and Generating Local Reports 191
Configure a Local Report 191
Generate an On-Demand Report 192
Review a Local Report 192
Exercise 2: Monitoring System Resources 194
Review the Resource Usage History 194
View Resource Usage in Real Time 195
Lab 13: Troubleshooting 198
Exercise 1: Troubleshooting the Problem 199
Investigate Inbound Mail Flow 199
Investigate Outbound Mail Flow 202
Capture Inbound Email Traffic 203
Review the Traffic Capture 204
Capture Outbound Email Traffic 206
Exercise 2: Fixing the Problem 207
Review the Configuration 207
DO Network
NOTTopology
REPRINT
© FORTINET
Network Topology
In this lab, you will verify the DNS MX records for both of the lab domains, perform the initial configuration tasks for
the FortiMail VMs installed in the internal.lab domain for inbound email, and configure an email client to
connect to a FortiMail running in server mode. Then, you will issue basic SMTP commands and inspect email
headers to understand the flow of SMTP.
Objectives
l Verify DNS MX records for the lab domains
l Configure the initial system and email settings on the FortiMail that is operating in server mode
l Configure the initial system and email settings on the FortiMail that is operating in gateway mode
l Manually send basic SMTP commands to an email server to understand SMTP
Time to Complete
Estimated: 45 minutes
DNS is a critical component in routing email messages. In this exercise, you will use the nslookup command-line
tool to verify the published DNS mail exchanger (MX) records for both the internal.lab and external.lab
domains, in order to understand how mail routing works in the lab network.
Verify MX Records
The DNS servers in the lab are configured with MX records that are associated with the internal.lab and
external.lab domains. MX records are necessary to route email messages to mail transfer agents (MTAs),
which are responsible for accepting email messages.
To verify MX records
1. On the Linux-Client VM, open a terminal window (Ctrl+Alt+T).
2. Enter the following command to display the MX records associated with the external.lab domain:
nslookup -type=mx external.lab
You should receive an output similar to the following example:
student@client:~$ nslookup -type=mx external.lab
Server: 10.0.1.254
Address: 10.0.1.254#53
As indicated in the nslookup query output, there is one MX record associated with the
external.lab domain:
external.lab mail exchanger = 10 extsrv.external.lab.
Therefore, all email messages sent to the external.lab domain must be sent to
the extsrv.external.lab host.
3. Enter the following command to display the MX records associated with the internal.lab domain:
nslookup -type=mx internal.lab
© FORTINET
As indicated in the nslookup query output, there are two MX records associated with
the internal.lab domain:
internal.lab mail exchanger = 10 intgw.internal.lab.
The intgw.internal.lab host is the primary MTA for the internal.lab domain
because it has the lowest preference value. However, at this point in the lab, you
haven’t configured the IntGW FortiMail VM to process email messages, so it won’t
respond to SMTP sessions. When the TCP connection fails, the remote sender
automatically tries to send email messages to the next MX record on the list, which is
intsrv.internal.lab.
In the lab network, the MX records for the internal.lab domain are designed for
convenience and shouldn't be used as a template for real-world deployments.
Since the back-end mail server might not have the full range of email security features
enabled, publishing it as a secondary MX entry is detrimental to security. Spammers
can easily use MX records to identify and exploit these servers.
Publishing the back-end mail server as a secondary MX entry also prevents certain
FortiMail features, such as greylisting and sender reputation, from working effectively.
In the lab network, IntSRV FortiMail is running in server mode, and is intended to be the mail server for the
internal.lab domain. The mailboxes for end users are located on IntSRV FortiMail, and this is where you will
perform all user management tasks, as well as tasks that are specific to a FortiMail that is operating in server
mode.
In this exercise, you will perform the basic configuration tasks required to establish inbound email flow on IntSRV
FortiMail. You will verify your configuration by sending an email from ExtSRV FortiMail, and then reviewing the
logs. Next, you will configure a mail user agent (MUA) to connect to IntSRV FortiMail.
You will verify the operation mode of FortiMail on the dashboard of the FortiMail management GUI.
You will configure some necessary system settings, such as the IP address of the interface, network routes, and
system DNS.
© FORTINET
To configure system settings
1. Continuing on the IntSRV FortiMail management GUI, click System > Network > Interface.
2. Select port1, and then click Edit.
3. Verify the following settings:
Field Value
IP/Netmask 10.0.1.99/24
Field Value
Administrative status UP
6. Click OK.
7. Click System > Network > Routing.
8. Verify the following settings:
Field Value
Interface port1
Gateway 10.0.1.254
Field Value
© FORTINET
Configure Mail Settings
You will configure a local host name and domain name. You will also configure the protected domain.
Field Value
3. Click Apply.
4. Click Domain & User > Domain > Domain.
5. Click New.
6. Configure the following settings:
Field Value
7. Click Create.
You will configure an email user whose mailbox will be hosted on IntSRV FortiMail.
Field Value
Password fortinet
4. Click Create.
© FORTINET
Verify Mail Flow
You will send an email message from a user in the external.lab domain to a user in the internal.lab
domain. You will review the logs on IntSRV FortiMail, and confirm that the email message was accepted for
delivery.
Field Value
3. Click Send.
4. On the IntSRV FortiMail webmail GUI, log in with the username user1 and password fortinet.
5. If the test email message doesn’t appear in the Inbox, click the Refresh icon.
© FORTINET
For the purpose of this lab, most logs are found under Monitor > Log > History, in the
Current container, since the logs are generated as you test the labs. However, note
that you might have to look at the historical logs to view logs that are older than a few
days. You can view the historical logs by clicking Monitor > Log > History, and then
clicking List.
You will configure the Mozilla Thunderbird client to connect to IntSRV FortiMail, so that you can send and receive
email messages using the client, instead of using the FortiMail webmail GUI. You will use IMAP to retrieve email
messages and SMTP to send email messages.
2. In the Set Up an Existing Email Account window, configure the following account information:
Field Value
Password fortinet
© FORTINET
3. Click Continue.
Thunderbird attempts to auto-configure the server settings.
© FORTINET
Your configuration should match the following example:
6. Click Done.
7. Select the I understand the risks checkbox, and then click Done.
While it is OK to use unencrypted passwords in the lab network, you should avoid
using them in real-world deployments.
© FORTINET
8. If your configuration is correct, the test email message you sent in the previous exercise appears in your local
inbox.
9. Close Thunderbird.
In the lab network, IntGW FortiMail is running in gateway mode and is intended to be the MTA for the
internal.lab domain. IntGW FortiMail will be the relay server for IntSRV FortiMail, and also where you will
perform most of the inspection configuration tasks.
In this exercise, you will perform the configuration tasks required to establish inbound email flow on IntGW
FortiMail. You will verify your configuration by sending an email using swaks, and then reviewing the email
headers in the Thunderbird mail client.
Remember the DNS verification tasks you performed in the first exercise. As the MX
records show, the intgw.internal.lab (10.0.1.11) host is the primary MTA for
the internal.lab domain. Therefore, all email messages should be sent to IntGW
FortiMail first for processing. IntGW FortiMail will then pass the email messages to
IntSRV FortiMail for delivery to the end user.
You will configure and verify some necessary system settings, such as the IP address of the interface, network
routes, and system DNS.
Field Value
IP/Netmask 10.0.1.11/24
Field Value
© FORTINET
Field Value
Administrative status UP
9. Click OK.
10. Click System > Network > Routing.
11. Verify that the static route has the following values:
Field Value
Interface port1
Gateway 10.0.1.254
Field Value
You will configure a local host name and domain name. You will also configure the protected domain settings.
After you complete the challenge, see Verify Mail Flow on page 22.
© FORTINET
To configure mail settings
1. Continuing on the IntGW FortiMail management GUI, click System > Mail Setting > Mail Server Setting.
2. Configure the following settings:
Field Value
3. Click Apply.
4. Click Domain & User > Domain > Domain.
5. Click New.
6. Configure the following settings:
Field Value
7. Click Create.
8. Log out of the IntGW FortiMail management GUI.
You will send an email message from the Linux-Router VM to a user in the internal.lab domain.
5. Enter the following swaks command to test the configuration of IntGW FortiMail:
swaks -f [email protected] -t [email protected] -s 10.0.1.11 --body 'Gateway mode
FortiMail configuration is successful'
© FORTINET
A copy of the swaks command is in the commands.txt file, which is located in the
Resources folder on the Linux-Client desktop.
9. Compare the Received headers in the test email with the Hello World! email you sent in the previous exercise.
What differences do you see?
The Received header of the Hello World email shows that IntSRV FortiMail received
the email directly from ExtSRV FortiMail.
Received: from ExtSRV (extsrv [100.64.1.99]) by
IntSRV.internal.lab
The Received header of the swaks session email shows that the email was
processed first by IntGW FortiMail, and then handed off to IntSRV FortiMail.
Received: from IntGW.internal.lab ([10.0.1.11]) by
IntSRV.internal.lab
In this lab, you will establish outbound email flow for the internal.lab domain, and configure a relay host for
the FortiMail that is operating in server mode. You will create IP and recipient policies, and then use logged policy
IDs to identify how policies are applied to an email.
Objectives
l Configure access receive rules to allow outbound email
l Configure an external relay host
l Configure IP and recipient policies
l Use logged policy IDs to track messages
Time to Complete
Estimated: 40 minutes
In this exercise, you will configure the necessary access receive rules on both the IntGW and IntSRV FortiMail
VMs to allow outbound email.
Field Value
3. Click Send.
4. Close Thunderbird.
5. On the ExtSRV FortiMail webmail GUI, log in with the username extuser and password fortinet.
6. Verify that the extuser received the email.
By default, FortiMail rejects outbound email, so why didn't FortiMail reject this email?
FortiMail rejects outbound email, unless the sender is authenticated. Because you configured Thunderbird
to authenticate when sending emails using SMTP, IntSRV FortiMail relays it.
© FORTINET
Configure Access Receive Rules
You will configure access receive rules based on sender pattern, IP address, and network mask, to allow safe
relaying of emails from the internal.lab domain.
After you complete the challenge, see Verify Access Receive Rules on page 27.
Field Value
Sender *@internal.lab
Source 10.0.1.0/24
Action Relay
4. Click Create.
While the default behavior reduces configuration requirements, it is still a good practice
to configure an access receive rule with specific sender patterns and sender IP
address and network mask values in a server mode deployment, to restrict outbound
sessions.
© FORTINET
3. Click New.
4. Configure an access receive rule using the following values:
Field Value
Sender *@internal.lab
Source 10.0.1.99/32
Action Relay
On IntGW FortiMail, you are allowing only IntSRV FortiMail to relay emails by using a
/32 subnet mask. No other host can relay emails through IntGW FortiMail.
5. Click Create.
6. Log out of the IntGW FortiMail management GUI.
You will send an outbound email to an external user, and then analyze the headers of that email to learn about the
hops the email took before arriving at the destination mail server.
© FORTINET
The email was generated by the Linux-Client VM (10.0.1.10) and sent to IntSRV
FortiMail (10.0.1.99). IntSRV FortiMail then delivered the email to ExtSRV FortiMail
(10.200.1.99).
Received: from IntSRV.internal.lab ([10.0.1.99]) by
ExtSRV.external.lab with ESMTP id 10S02Wot004754-
10S02Wov004754
According to the headers, the outbound email did not pass through IntGW FortiMail, which is expected.
IntSRV FortiMail delivered the email directly to the ExtSRV FortiMail based on MX query results. If you wish
to ensure all outbound emails from IntSRV FortiMail relay through IntGW FortiMail, you must configure a
relay host on IntSRV FortiMail.
© FORTINET
7. Log out of the ExtSRV FortiMail webmail GUI.
8. On the Linux-Client VM, close Thunderbird.
In this exercise, you will configure an external relay host on IntSRV FortiMail, so that all outbound emails are sent
to IntGW FortiMail for delivery.
For outgoing emails, you will configure an SMTP relay host on IntSRV FortiMail. This will force IntSRV FortiMail to
always use the defined relay to deliver outbound emails, instead of the built-in MTA. The relay host will be IntGW
FortiMail, so all outgoing emails from IntSRV FortiMail will be relayed to IntGW FortiMail.
All outbound emails from the internal.lab domain should be sent to IntGW FortiMail (10.0.1.11).
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Verify the Relay Host on page 31.
Field Value
Name IntGWRelay
6. Click Create.
7. Click Apply.
8. Log out of the IntSRV FortiMail management GUI.
© FORTINET
Verify the Relay Host
You will verify that the relay host is working by sending an email from an internal.lab user to an
external.lab user.
Field Value
3. Click Send.
4. On the ExtSRV FortiMail webmail GUI, log in with the username extuser and password fortinet.
5. Verify that the extuser user received the email.
6. Review the headers.
Do you see any differences in the Received headers? Which hops did the email take this time to reach the
destination inbox?
© FORTINET
The Linux-Client VM (10.0.1.10) generated the emails and sent it to IntSRV
FortiMail (10.0.1.99). IntSRV FortiMail then sent the email to IntGW FortiMail
(10.0.1.11). IntGW FortiMail delivered the email to ExtSRV FortiMail
(10.200.1.99), which is the final destination.
Received: from IntGW.internal.lab ([10.0.1.11]) by
extsrv.external.lab with ESMTP id v1RLvKZS002158-
v1RLvKZU002158
You have successfully established bidirectional email flow for the internal.lab
domain. All inbound and outbound emails will be relayed by IntGW FortiMail.
As emails flow through FortiMail, it creates log entries that show which policies were used to process the emails.
Understanding FortiMail policy tracking will help you to test new policies and troubleshoot existing ones.
In this exercise, you will send two emails, one in each direction, and then review which policies the emails used.
You will send an outbound email from an internal.lab user, and then reply to that email from an
external.lab user.
You will review the log entries for the emails to understand how FortiMail tracks policy usage.
3. Right-click the entry for the inbound email, and then select View Details.
© FORTINET
4. Review the Policy IDs field, and then answer the following questions:
The Policy IDs field is made up of four fields (X:Y:Z:<recipient policy domain name or SYSTEM>). What does
each field correspond to?
© FORTINET
The policy IDs for each email are recorded in the history logs in the format of
X:Y:Z:<recipient policy domain name or SYSTEM>, where X is the ID of the access
control rule, Y is the ID of the IP-based policy, and Z is the ID of the recipient-based
policy. The last field shows the domain name if it matches a recipient policy, and
SYSTEM if it doesn't match a recipient policy.
If the value in the access control rule field for an incoming email is 0, it means that
FortiMail is applying its default rule for handling inbound email. If the value of X:Y:Z is
0 in any other case, it means that a policy or rule couldn’t be matched, or doesn’t exist.
5. Click Close.
6. Open the relevant log entry for the outbound email, and then review the Policy IDs field.
The policy ID recorded for the outbound email is 1:1:0:SYSTEM. It was processed
using access receive rule ID 1, which you created in the previous exercise. Then, the
email was processed using the default IP policy ID 1. Because you didn’t configure an
outbound recipient policy, the last field value is 0 and the domain is SYSTEM.
In this exercise, you will create IP and recipient policies. Then, you will test your configuration by sending emails
back and forth. You will also use logs to observe the changes to the policy usage from the previous exercise.
Create an IP Policy
You will create an IP policy on IntGW FortiMail to process emails specifically from IntSRV FortiMail.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Create Recipient Policies on page 37.
To create an IP policy
1. On the IntGW FortiMail management GUI, log in with the username admin and password password.
2. Click Policy > IP Policy > IP Policy.
3. Click New.
4. Configure the following settings:
Field Value
Source 10.0.1.99/32
Session Outbound_Session
5. Click Create.
The new policy should have an ID value of 3.
© FORTINET
IP policy ID 3 will process all emails sourced from IntSRV FortiMail (outgoing), and IP
Policy ID 1 will process all other emails (incoming). IP policy ID 2 is a default IPv6
policy. Since this lab is not configured for IPv6, it is not required. You can delete the
policy if you want.
You will create inbound and outbound recipient policies on IntGW FortiMail.
© FORTINET
Take the Expert Challenge!
On IntGW FortiMail, create an inbound recipient policy for the internal.lab domain. Do not assign any
inspection profiles to this policy.
On IntGW FortiMail, create an outbound recipient policy for the internal.lab domain. Do not assign any
inspection profiles to this policy.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Verify the Policy Configuration on page 39.
4. Click Create.
5. In the Domain drop-down list, select All or internal.lab—otherwise, you may not see the new policy.
© FORTINET
6. Click Policy > Recipient Policy > Outbound.
7. In the Domain drop-down list, select internal.lab.
8. Click New.
9. Click Create.
10. In the Domain drop-down list, select All or internal.lab—otherwise, you may not see the new policy.
You will verify your policy configuration by sending an email from an internal.lab user, and then replying to
that email from an external.lab user. After, you will review the generated log entries.
© FORTINET
4. In the message body, type a reply, and then click Send.
5. Log out of the ExtSRV FortiMail webmail GUI.
6. Return to the Thunderbird client, and then verify that you received the reply.
7. Close Thunderbird.
The policy usage reflects the new ID values for the policies you created. All outgoing
emails are processed by IP policy ID 3 and outgoing recipient policy ID 2. All incoming
emails are processed by IP policy ID 1 and incoming recipient policy ID 1.
In this lab, you will configure access receive rules to enforce user SMTP authentication. You will also configure an
LDAP profile to enable recipient verification, alias mapping, and user authentication. Finally, you will configure the
authentication reputation feature to block an SMTP brute force attack.
Objectives
l Enforce user SMTP authentication using access receive rules
l Configure an LDAP profile
l Enable recipient verification and alias mapping
l Configure LDAP authentication for users
l Block SMTP brute force attacks
Time to Complete
Estimated: 60 minutes
In this exercise, you will explore how FortiMail handles SMTP authentication. You will enforce authentication using
access receive rules, and test your configuration using various outgoing server settings in Mozilla Thunderbird.
On the Thunderbird client, you previously configured SMTP authentication with a Normal password. Now, you
will change that authentication method to use no authentication, and then attempt to send an unauthenticated
outbound email.
3. In the Account Settings window, in the left pane, click Outgoing Server (SMTP), and then click Edit.
© FORTINET
5. Click OK.
6. Click OK.
© FORTINET
By making these changes, you disabled authentication for SMTP connections.
Therefore, when you send an email, Thunderbird won’t authenticate to the outgoing
SMTP server.
The access receive rule that you configured in the previous lab didn’t have
authentication enforcement enabled.
When you set Authentication Status to Any, FortiMail doesn’t verify whether the
sender matching the rule is authenticated or not.
Enforce Authentication
You will reconfigure the access control rule on IntSRV FortiMail to enforce authentication.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Verify Authentication Enforcement on page 45.
© FORTINET
To enforce authentication
1. On the IntSRV FortiMail management GUI, log in with the username admin and password password.
2. Click Policy > Access Control > Receiving.
3. Select rule ID 1, and then click Edit.
You will verify authentication enforcement by sending an email from a user in the internal.lab domain to a
user in the external.lab domain.
© FORTINET
2. Click OK.
3. Return to the IntSRV FortiMail management GUI, and then click Monitor > Log > History.
The first entry in the History log should correspond to the rejected email.
In this log entry, you can see that IntSRV FortiMail has the Disposition of Reject. By
changing the authentication status setting, you successfully enforced authentication
for users connecting to IntSRV FortiMail.
You will restore SMTP authentication on Thunderbird, so you can continue sending emails through FortiMail.
© FORTINET
The Linux-Client VM has been preconfigured with OpenLDAP for the internal.lab domain. In this exercise,
you will review the OpenLDAP configuration and learn how to retrieve LDAP attributes for OpenLDAP objects.
Then, you will configure an LDAP profile on both IntSRV FortiMail and IntGW FortiMail for user authentication,
alias lookup, and recipient verification.
You will review the OpenLDAP configuration and familiarize yourself with the users and groups that have been
preconfigured on the Linux-Client VM.
2. Click login.
3. Log in using the Login DN cn=admin,dc=internal,dc=lab and Password password.
4. Click Authenticate.
5. Expand the LDAP tree.
6. Expand Training Groups.
7. Expand Training Users.
© FORTINET
The users and groups are located in the Training Users OU and Training Groups
OU respectively. All account passwords are set to fortinet.
© FORTINET
3. Close Firefox.
© FORTINET
Configure an LDAP Profile on IntGW and IntSRV FortiMail
You will configure an LDAP profile on the IntGW and IntSRV FortiMail. The LDAP profile will contain the
necessary queries that FortiMail can use with an OpenLDAP server. You will configure the same LDAP profile on
both IntSRV FortiMail and IntGW FortiMail.
Field Value
Field Value
Bind DN CN=admin,DC=internal,DC=lab
6. Expand the User Query Options section, and then in the Schema drop-down list, select OpenLDAP.
7. Expand the User Alias Options section, and then in the Schema drop-down list, select OpenLDAP.
8. Use the following values to modify the User Alias Options settings:
© FORTINET
Field Value
9. Click Create.
Field Value
© FORTINET
Field Value
Bind DN CN=admin,DC=internal,DC=lab
6. In the User Query Options section, in the Schema drop-down list, select OpenLDAP.
7. In the User Alias Options section, in the Schema drop-down list, select OpenLDAP.
8. Use the following values to modify the User Alias Options:
Field Value
9. Click Create.
You will validate the LDAP profile that you created to ensure that the configuration is correct and the OpenLDAP
server responds to user queries.
© FORTINET
6. If the query fails, make sure that the LDAP profile configuration matches the following example:
© FORTINET
If your configuration is correct, you will see the following message in the Test Result section:
10. If the query fails, make sure that the configuration of the User Alias Options LDAP profile matches the following
example:
© FORTINET
Configure Recipient Address Verification and Alias Mapping
Now that you configured an LDAP profile, you will configure recipient address verification and alias mapping. You
will make these configuration changes on IntGW FortiMail because it is the first MTA hop that will process all
emails for the internal.lab domain.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Configure LDAP Authentication for Gateway Mode Webmail Access
on page 57.
If the LDAP Options section does not appear in the domain settings, switch to the
advanced view in the GUI.
6. In the User alias / address mapping profile drop-down list, select InternalLabLDAP.
Your configuration should match the following example:
© FORTINET
7. Click OK.
You also don’t need to configure alias mapping on IntSRV FortiMail because IntGW
FortiMail does the mapping before it delivers an email to IntSRV FortiMail.
You will configure LDAP authentication on IntGW FortiMail, so that users can authenticate to access their
quarantine inbox using the IntGW FortiMail webmail GUI.
© FORTINET
Take the Expert Challenge!
On IntGW FortiMail, enable LDAP authentication for gateway mode user quarantine mailbox access using
the webmail GUI.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Configure LDAP Authentication for Server Mode Users on page 58.
Field Value
4. Click OK.
Users will use their OpenLDAP accounts to authenticate and access the IntGW
FortiMail webmail GUI for quarantined emails.
If the LDAP profile doesn’t appear in the drop-down list, then you missed a step. Go
back to To configure an LDAP profile on IntSRV FortiMail on page 52, and then follow
the steps to configure the same LDAP profile on IntSRV FortiMail.
5. Click OK.
6. Click New.
© FORTINET
7. Configure the following settings:
Field Value
8. Click Create.
9. Log out of the IntSRV FortiMail management GUI.
You will validate LDAP authentication on both FortiMail VMs in the internal.lab domain.
The webmail GUI in gateway mode gives users access to their bulk folder, which
contains only quarantined emails. You will configure email quarantining in a later lab. In
this section, you are verifying user access only.
Field Value
© FORTINET
3. Click Send.
4. Click Refresh to update the inbox.
You should receive a delivery status notification (DSN) message.
5. Open the DSN message, and then review the transcript details.
6. Return to the IntGW FortiMail management GUI, and then click Monitor > Log > History.
7. Double-click the active log file.
The first entry in the History log should correspond to the email you just sent.
Field Value
2. Click Send.
3. Log out of the ExtSRV FortiMail webmail GUI.
4. On the IntSRV FortiMail webmail GUI, log in with the username user2 and password fortinet.
The email you sent to [email protected] appears in the [email protected] inbox.
© FORTINET
© FORTINET
Alias mapping is useful to consolidate multiple emails for different aliases in a single
email account, using the user's primary email address as the identifier. This reduces
account management overhead for the user and the administrator. For example, if a
user has five aliases in addition to a primary email address, FortiMail can use alias
mapping to maintain a single user quarantine mailbox. Otherwise, the user would have
to manage six separate quarantine accounts, as well as the quarantine reports for
each account.
9. Click Close.
10. Log out of the IntGW FortiMail management GUI.
In this exercise, you will explore how FortiMail handles failed SMTP authentication. You will generate an SMTP
brute force attack and block the offending IP address.
The default block period for an offending IP address is 10 minutes. You can set the
block period to a maximum of 60 minutes and minimum of 5 minutes.
4. Click Apply.
You will execute an SMTP brute force attack on IntGW FortiMail, and then review the logs to validate that the
authentication reputation feature is working correctly.
© FORTINET
3. Enter the password password.
4. Enter pwd.
Verify that your current working directory is /home/student.
5. Enter the following swaks command to generate an SMTP brute force attack:
while sleep 1; do swaks --to [email protected] --from "[email protected]" --
header "Subject: Test mail" --body "This is a test mail" --server 10.0.1.11 --
port 25 --timeout 40s --auth LOGIN --auth-user "[email protected]" --auth-
password "Myworld" -tls; done
A copy of the swaks command is in the commands.txt file, which is located in the
Resources folder on the Linux-Client desktop.
© FORTINET
Stop and think!
FortiMail uses a variety of adaptive factors to detect and block brute forcing (not only consecutive failures)
and they temporarily lock out the user. FortiMail detected a brute force attack and blocked that IP address.
New TCP connections from that attacker were denied.
If you do not see the IP address on the Authentication Reputation tab, enter the
following command on the IntGW FortiMail CLI. To access the CLI console, click
Dashboard > Console.
execute db reset sender-reputation
© FORTINET
2. Click Delete.
3. Log out of the IntGW FortiMail management GUI.
In this lab, you will configure session profiles to inspect the envelope of emails. You will also use session profiles
to hide internal network information from email headers.
Objectives
l Configure session profile connection settings to limit inbound connections to IntGW FortiMail
l Configure sender address rate control to limit outbound connections on IntSRV FortiMail
l Configure session profile header manipulation to hide your internal network information
Time to Complete
Estimated: 45 minutes
Prerequisites
Before beginning this lab, you must restore a configuration file on IntSRV FortiMail.
The configuration file adds a new IP policy that causes all email delivery attempts from
ExtSRV FortiMail to IntSRV FortiMail to fail temporarily. This ensures that when the
session limits are triggered on IntGW FortiMail, ExtSRV FortiMail can’t deliver to
IntSRV FortiMail directly. This change prevents confusion when testing the session
profile settings you will be configuring on the IntGW FortiMail later in this lab.
In this exercise, you will limit the number of SMTP sessions that each client can establish within a 30-minute
period. Spammers usually send as many emails as they can in a short period of time before legitimate email
servers begin to block their delivery. If blocked, the spammers won’t spend the time to retry. Legitimate email
servers will retry delivery if it fails the first time.
You will configure a session profile on IntGW FortiMail to limit the number of connections that ExtSRV FortiMail
can establish over a 30-minute period.
Apply the new session profile to the correct policy, so that IntGW FortiMail applies the connection limits to
all inbound connections.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Validate Connection Limits on page 69.
© FORTINET
6. Click Create.
You will test the connection limitation by sending consecutive emails to trigger a violation. You will also verify your
configuration by reviewing the logs.
© FORTINET
There will be one email sent per TCP connection. Therefore, IntGW FortiMail should
allow the first four but block the fifth, which exceeds your configured connection limit.
5. Close Thunderbird.
6. Return to the IntGW FortiMail management GUI, and then click Monitor > Log > History.
The first entry in the History log should correspond to the rejected email.
Why are the From, To, and Subject fields in this log entry empty?
FortiMail blocked the client’s attempt when it scanned the IP layer of the initial packets
before the SMTP session could be established. The SMTP session contains the SMTP
envelope—the sender’s email address, the recipient’s email address, and the subject.
So, those parts of the email were never received.
© FORTINET
Disable Connection Limits
To continue with the lab exercises, you must disable connection limits in the session profile, so that it does not
interfere with the other labs.
In this exercise, you will configure sender address rate control to control the volume of outbound emails your
internal users can send. While it is important to protect your email users from spammers sending large volumes of
email, it is also important to protect your own mail server IP reputation by controlling the volume of email received
from internal users.
If any user exceeds any of the sender address rate control settings, IntSRV FortiMail should send a
notification email to [email protected].
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Validate Sender Address Rate Control on page 74.
Field Value
Action Reject
7. In the Send email notification upon rate control violations field, click + to add a new notification setting.
8. Configure the following values:
Field Value
Name NotifyUser1
© FORTINET
Field Value
© FORTINET
12. Verify the settings, and then click OK.
13. Click OK.
You will validate sender address rate control by sending five emails from a user in the internal.lab domain.
Since you configured the limit to 4 emails within a 30-minute period, the fifth message will be rejected.
7. On the Linux-Client VM, open Thunderbird, and then view the details in the notification email with the subject
Sender Rate Exceeded.
8. Close Thunderbird.
9. Return to the IntSRV FortiMail management GUI, and then click Monitor > Log > History.
The first entry in the History log should correspond to the rate control violation.
While session profile connection limits and sender address rate control appear to
function very similarly, FortiMail applies them very differently.
As you observed in the previous exercise, FortiMail applies the session profile
connection limits at the IP layer. The sender address rate control feature limits
connections based on the sender's address, which is derived from the Mail From:
field of the SMTP envelope. So, for sender address rate control, FortiMail must
process at least a portion of the SMTP envelope. This is also why
[email protected] appears in the From field of the log entry, but the log entries from
the session profile connection limits are empty.
© FORTINET
10. Click the Session ID to retrieve the cross-search results.
11. Review the related event and antispam logs.
You will disable sender address rate control. In the lab environment, it can interfere with other lab exercises, but in
a real-world environment, it is a good practice to enable sender address rate control.
In this exercise, you will remove internal headers. It is a good security practice to hide your internal network
information and it also reduces the size of messages.
You will observe the effects of header manipulation settings by configuring a session profile on IntGW FortiMail to
hide internal headers.
To review headers
1. On the ExtSRV FortiMail webmail GUI, log in with the username extuser and password fortinet.
2. Open any email message sent by an internal.lab user.
If you deleted all previous email messages, on the Linux-Client VM, open Thunderbird,
and then send a new email message to [email protected].
© FORTINET
Validate Header Manipulation
You will validate header manipulation by comparing the headers of an email before and after you configure header
manipulation.
In the Received: header, you should see only details about IntGW FortiMail and
ExtSRV FortiMail, and no information about Linux-Client (10.0.1.10) or IntSRV
FortiMail (10.0.1.99).
© FORTINET
8. Return to the ExtSRV FortiMail webmail GUI, and then click OK.
9. Log out of the ExtSRV FortiMail webmail GUI.
In this lab, you will configure FortiMail local malware detection techniques to scan for viruses in inbound email.
Objectives
l Configure an antivirus action profile to enable local malware detection
l Configure an antivirus profile to replace infected content from an email
l Apply antivirus scanning to inbound email
l Test antivirus functionality
Time to Complete
Estimated: 15 minutes
In this exercise, you will configure an antivirus action profile and an antivirus profile on IntGW FortiMail. Then, you
will apply the antivirus profile to a recipient-based policy in order to scan all inbound emails sent to the
internal.lab domain.
The antivirus action profile should be available for the internal.lab domain only.
The antivirus action profile should remove all malicious attachments from emails and tag the email subject
line with the string [VIRUS DETECTED].
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Configure an Antivirus Profile on page 81.
Field Value
Domain internal.lab
© FORTINET
6. Click Create.
The action profile that you created doesn’t appear in the list. Why?
The list view is filtered by domain. If you want to see the new profile, change the selection in the Domain
drop-down list. Select internal.lab to view the action profiles for that specific domain, or select All to view
the action profiles for all domains.
You will create an antivirus profile and specify the default action that FortiMail takes when it detects a virus. If
FortiMail detects a virus, it takes the actions that you define in the antivirus action profiles.
© FORTINET
Take the Expert Challenge!
On IntGW FortiMail, configure an antivirus profile and name it AV_In.
The antivirus profile should be available for the internal.lab domain only.
The antivirus profile should use the AV_Tag_Replace antivirus action profile.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Apply Antivirus to Inbound Emails on page 82.
Field Value
Domain internal.lab
4. Click Create.
5. In the Domain drop-down list, select internal.lab.
The AV_In antivirus profile is displayed.
You will apply the antivirus profile to the inbound recipient policy for the internal.lab domain.
You will test antivirus functionality using an EICAR file. An EICAR file does not contain a real virus. It is a
harmless, industry-standard test file that is designed to trigger antivirus engines for testing purposes. So, if your
antivirus configuration is correct, FortiMail should detect the EICAR file as a virus.
© FORTINET
You shouldn’t test your antivirus configuration using a live virus. By doing so, you risk
infecting your network hosts if your configuration is incorrect.
Field Value
3. Click the Session ID link to review the cross-search result for more details.
© FORTINET
In this lab, you will configure antispam scanning for both inbound and outbound email. Then, you will verify your
configuration by sending spam through IntGW FortiMail. You will also configure quarantine report settings and
manage user quarantine mailboxes.
Objectives
l Scan both incoming and outgoing emails for spam
l Send spam emails to user quarantine
l Manage quarantine report configuration
l Access and explore the user quarantine mailbox
Time to Complete
Estimated: 70 minutes
Prerequisites
Before beginning this lab, you must restore a configuration file on the internal.lab FortiMail VMs.
The configuration files disable all session profile inspection features, which can
potentially interfere with the antispam testing you will do in this lab.
In this exercise, you will verify the FortiGuard configuration. Then, you will configure an antispam profile to scan all
incoming email and send all spam email to the users’ personal quarantine accounts.
You will configure FortiGuard settings. FortiMail devices receive antispam and antivirus updates from the
FortiGuard Distribution Network (FDN), as long as there is a support contract attached to the device serial
number.
If the Query result is No response, check the License Information widget on the
FortiMail dashboard (Dashboard > Status). If the status is Trial, force a license
update on the FortiMail GUI.
© FORTINET
Configure an Antispam Action Profile
The antispam action profile should be available for the internal.lab domain only.
The antispam action profile should send all detected spam messages to user quarantine.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Configure a Resource Profile on page 87.
Field Value
Domain internal.lab
You will configure a resource profile, which allows you to control user accounts at the policy level. You will enable
web and email release so that the recipient can use either email actions or web actions to release or delete
quarantined messages.
© FORTINET
Take the Expert Challenge!
On IntGW FortiMail, create a new resource profile and name it Resource_AS_In_User_Quar.
The resource profile should be available for the internal.lab domain only.
Configure the resource profile so that users will receive quarantine reports, and can use both web and email
release functions.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Configure an Antispam Profile on page 88.
Field Value
Domain internal.lab
4. Click Create.
You will create an antispam profile, enable various antispam techniques, and select the antispam action profile
that you created before, as the default action.
© FORTINET
Field Value
Domain internal.lab
4. Click Create.
5. In the Domain drop-down list, select internal.lab.
6. Select the AS_In antispam profile, and then click Edit.
7. Review the default settings.
The following antispam techniques should already be enabled:
l FortiGuard
l SPF
8. Expand FortiGuard.
9. Expand IP Reputation, and then enable Extract IP from Received Header.
10. In the URL Category section, enable Primary, and then in the drop-down list, select phishing.
11. Enable the following antispam techniques:
l DMARC
l Behavior analysis
l Header analysis
l Heuristic
12. Expand Heuristic, and then in the The percentage of rules used field, type 100.
13. Enable the following antispam techniques:
l Suspicious newsletter
l Newsletter
Your configuration should match the following example:
© FORTINET
© FORTINET
Apply Antispam Scanning to Inbound Emails
You will apply the antispam profile to the inbound recipient policy for the internal.lab domain.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Validate the Antispam Configuration on page 91.
To validate your antispam settings, you will use the swaks tool on the Linux-Router VM to send spam messages to
the user mailboxes in the internal.lab domain.
A copy of the swaks command is in the commands.txt file, which is located in the
Resources folder on the Linux-Client desktop.
© FORTINET
Wait until all the spam emails are sent. This could take up to 5 minutes.
You can see current information about the total number of emails received, the percentage of spam detected,
and the type of antispam technique used to detect most of the spam.
© FORTINET
4. Click the Session ID link of a history log entry, and then review the related antispam log for the session.
5. Log out of the IntGW FortiMail management GUI.
In this exercise, you will configure outbound antispam scanning on IntGW FortiMail. Then, you will test the
configuration by sending an outbound email containing a banned word.
You will configure an antispam profile, and then apply that profile to an outbound recipient policy. In this profile
configuration, you will enable banned words for FortiMail to scan for in outbound emails.
The antispam profile should be available for the internal.lab domain only.
In the antispam profile, configure banned word scanning. Choose your own words and email locations
(body, subject, or both).
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Apply Antispam Scanning to Outbound Emails on page 95.
Field Value
Domain internal.lab
© FORTINET
8. Click OK.
9. Click Create.
You will apply antispam scanning to all outbound email from the internal.lab domain.
You will validate the antispam configuration by sending an outbound email, containing one of the banned words
you configured in the previous task, from the internal.lab domain. You will also monitor the logs on IntGW
FortiMail.
3. Open the DSN message, and then review the transcript details.
© FORTINET
4. Close Thunderbird.
2. Review the log, and verify that the appropriate action was applied to the outbound email message.
3. Click the Session ID link to review the cross-search results for more details.
4. Log out of the IntGW FortiMail management GUI.
An email user can access their list of quarantined emails using either POP3 or webmail. In this exercise, you will
access the [email protected] quarantine mailbox on the IntGW FortiMail webmail GUI. You will also
configure quarantine report scheduling and generate an on-demand quarantine report. Then, you will explore the
options available in a quarantine report.
In the previous lab exercise, you selected user quarantine as an action in the antispam action profiles. All the
spam emails from the previous exercise were redirected to their personal quarantine. Now, you will access the
personal quarantine mailbox of user1.
Once released, the message is delivered to the user's inbox. To verify this, you can view the message in the
Thunderbird client.
You will configure quarantine reports, which will allow recipients to delete or release quarantined email messages.
© FORTINET
To configure quarantine reports
1. On the IntGW FortiMail management GUI, log in with the username admin and password password.
2. Click Security > Quarantine > Quarantine Report.
3. In the Schedule section, enable the following days and times only:
l These hours: 9:00 10:00 11:00 12:00 13:00 14:00 15:00 16:00 17:00 18:00
l These days: Mon Tue Wed Thu Fri
4. In the Quarantine report template drop-down list, select default-with-icons.
5. Click Apply to save the changes.
© FORTINET
4. Click the web delete action for one of the spam emails.
You are redirected to the deletion confirmation page.
You can perform the web actions using most email clients as long as they support the
clicking of web links in emails. This is disabled in the lab so if you use Thunderbird you
must copy and paste the links from the quarantine report into a browser tab.
5. Return to the FortiMail webmail GUI, and then scroll down to the end of the quarantine report.
The end of the quarantine report contains options to delete all quarantined emails using either an email or a
web action.
6. Select the web action to delete all the quarantined email messages for [email protected].
You are redirected to the deletion confirmation page.
© FORTINET
In this exercise, you will configure FortiMail to inspect all emails designed to impersonate critical personnel and
take appropriate action on these types of messages.
You will configure an impersonation analysis profile with a display name mapped to an email address, and then
apply that profile to an inbound antispam profile that you configured in a previous lab exercise.
Configure a wildcard match rule for the Corporate CEO display name and [email protected] email
address.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Apply Impersonation Analysis to an Antispam Profile on page 102.
Field Value
9. Click Create.
Your configuration should match the following example:
© FORTINET
© FORTINET
7. Click OK.
The AS_In antispam profile is already applied to the inbound recipient policy ID 1 for
the internal.lab domain.
You will validate your configuration by sending an impersonation email from the Linux-Router VM.
To test impersonation
1. On the Linux-Client VM, open a terminal window (Ctrl+Alt+T).
2. Enter the following command to start an SSH connection to the Linux-Router VM:
ssh [email protected]
3. Enter the password password.
4. Enter pwd.
Verify that your current working directory is /home/student.
© FORTINET
5. Enter the following swaks command to impersonate a high-target user:
swaks -f [email protected] -t [email protected] -s 10.0.1.11 --header-From
"Corporate CEO <[email protected]>"
A copy of the swaks command is in the commands.txt file, which is located in the
Resources folder on the Linux-Client desktop.
In this exercise, you will configure bounce verification to block backscatter spam.
You will disable recipient address verification on IntGW FortiMail so that you can test backscatter spam.
You will send a backscatter spam email from the Linux-Router VM. You will use the backscatter target email
address in the MAIL FROM: field, and use an invalid recipient address in the RCPT TO: field. Then, you will
review the spam email and identify the spam content in the DSN message.
A copy of the swaks command is in the commands.txt file, which is located in the
Resources folder on the Linux-Client desktop.
© FORTINET
To verify the DSN email
1. Continuing on the Linux-Client VM, open Thunderbird.
2. Open the email with Returned mail: see transcript for details in the subject line.
The spam is attached to the DSN email.
3. Close Thunderbird.
You will configure bounce verification to detect backscatter spam and discard it.
© FORTINET
Take the Expert Challenge!
On IntSRV FortiMail, configure bounce verification to discard all backscatter spam. You can use internal
as a key.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Validate Bounce Verification on page 108.
9. Click Apply.
© FORTINET
Validate Bounce Verification
You will send a backscatter spam email to validate your bounce verification configuration, and then review the
logs on IntSRV FortiMail.
A copy of the swaks command is in the commands.txt file, which is located in the
Resources folder on the Linux-Client desktop.
In this lab, you will configure a content filter to monitor email based on dictionary word scores. You will also
configure the data loss prevention (DLP) feature to detect and block any outbound email that contains credit card
numbers. Finally, you will configure and verify the content disarm and reconstruction (CDR) feature on FortiMail.
Objectives
l Configure a dictionary profile to monitor words using scores
l Configure a content profile to use the dictionary profile
l Apply content filtering on all inbound email
l Configure DLP to detect credit card numbers in an email body and attachments
l Apply DLP on all outbound email
l Configure CDR to detect HTML tags and URIs in an email body and attachments
l Apply CDR to all inbound email
Time to Complete
Estimated: 60 minutes
Prerequisites
Before beginning this lab, you must restore a configuration file on the internal.lab FortiMail VMs.
© FORTINET
The configuration files disable bounce verification on IntSRV FortiMail and the
antispam profile on IntGW FortiMail, which can potentially interfere with the content
inspection testing you will do in this lab.
In this exercise, you will configure the content monitoring and filtering options of a content profile to scan for
specific pattern occurrences in inbound emails. Then, you will configure the action to be applied after the same
word occurs three times in an email.
You will create a new dictionary profile with pattern scores. This allows FortiMail to inspect email content for
multiple occurrences of a word and, if a specific number of matches are found, take appropriate action.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Configure a Content Profile and Action on page 111.
Field Value
Pattern fortimail
7. Click Create.
8. Click OK.
You will create a new content profile to use the dictionary profile you just created.
© FORTINET
Take the Expert Challenge!
On IntGW FortiMail, create a new content profile and name it CF_Dictionary.
The profile should use the SysQuarantine_Inbound action profile and be set to send system quarantine
emails to the Content folder.
The profile should use the WordScores dictionary profile, and trigger only after at least three occurrences
of the configured pattern in an email.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Apply Content Inspection to Inbound Emails on page 113.
Field Value
Domain internal.lab
Action SysQuarantine_Inbound
Field Value
Dictionary profile
WordScores
Minimum score 3
7. Click Create.
8. Click Create.
Configuring a Minimum score of 3 ensures that the action profile is applied only after
fortimail has found three occurrences of the pattern in a single email.
© FORTINET
To configure a content action
1. Continuing on the IntGW FortiMail management GUI, click Profile > Content > Action.
2. Double-click SysQuarantine_Inbound.
3. Configure a new content profile using the following values:
Field Value
4. Click OK.
You will apply the content profile to the inbound recipient policy ID 1 for the internal.lab.
You will send an email from an external.lab user to an internal.lab user. The email will contain several
instances of the configured dictionary pattern. FortiMail should detect the email because it exceeds the minimum
threshold score. Then, you will review the logs generated by content inspection.
3. Return to the Linux-Client VM desktop, and then browse to the folder Resources > Files.
4. Double-click the messagebody.txt file to open it.
5. Copy the contents of the file, return to the ExtSRV FortiMail webmail GUI, and then paste it into the body of the
email.
6. Click Send.
© FORTINET
The messagebody.txt file contains the following text:
5. Click Close.
© FORTINET
To access the system quarantine
1. Continuing on the IntGW FortiMail management GUI, click Monitor > Quarantine > System Quarantine.
2. Double-click Content/current.
Verify that the email was sent to the system quarantine folder.
In this exercise, you will configure a DLP profile on IntGW FortiMail. Then, you will apply the DLP profile to a
recipient-based policy, to scan all outbound email sent from the internal.lab domain.
You will configure a DLP scan rule. This rule scans the body and attachments in an email for credit card numbers.
Configure a new DLP scan rule to scan for credit card numbers in an email message body and attachments.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Configure a DLP Profile on page 117.
© FORTINET
You will configure a DLP profile to use the DLP rule you just created. You will also create a new action profile,
which sends the identified emails to the DLP system quarantine folder.
Configure the action profile to send identified emails to the DLP system quarantine folder.
The profile should use the DLP action profile and the DLP scan rule you just created.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Apply DLP Scanning to Outbound Emails on page 119.
Field Value
© FORTINET
6. In the Final action drop-down list, select System quarantine.
7. In the Folder name drop-down list, select Dlp.
8. Click Create.
9. In the Content Scan Setting section, click New.
© FORTINET
You will apply the DLP profile to an outbound recipient policy so that any outgoing emails that contain credit card
numbers are quarantined.
© FORTINET
4. In the Profiles section, in the DLP drop-down list, select DLP_Out.
5. Click OK.
You will test your DLP configuration by sending an email to an external user with an attachment that contains
credit card numbers. You will also review the logs to verify your configuration.
Field Value
4. Click Attach.
5. Click Desktop > Resources > Files > sample.pdf, and then click Open.
6. Click Send.
7. Close Thunderbird.
© FORTINET
5. Click Close.
In this exercise, you will configure CDR in a content profile to scan the HTML content in an email body and
attachments that may contain potentially hazardous tags and attributes, such as hyperlinks and scripts.
You will configure a content action profile that will be used specifically for CDR, so that any inbound emails that
trigger CDR will be sanitized. The sanitized email will be delivered to the end user mailbox, but the original email
will be sent to the user's personal quarantine mailbox.
You will also configure the action profile settings to quarantine unmodified copies of emails. This means that the
original email will be preserved in the personal quarantine, while the end user will receive an email with sanitized
contents.
Field Value
Domain internal.lab
© FORTINET
3. Click Apply.
Configure CDR
You will configure CDR for HTML content, text content, and PDF files.
The profile should be available for the internal.lab domain only, and use the CDR_User_Quar action
profile.
In the profile, configure CDR to sanitize HTML content, remove URIs, and inspect PDF files.
The CDR action should be the default action profile for the content profile.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Apply CDR to Inbound Emails on page 124.
To configure CDR
1. Continuing on the IntGW FortiMail management GUI, click Profile > Content > Content.
2. Click New.
3. Configure a new content profile using the following values:
Field Value
Domain internal.lab
© FORTINET
Field Value
Action CDR_User_Quar
Field Value
PDF Enable
9. Click Create.
© FORTINET
Validate PDF Sanitization
You will validate your CDR configuration by sending an email with a PDF attachment from a user in the
external.lab domain. You will review the logs on IntGW FortiMail. You will also compare the original PDF
attachment with the sanitized PDF attachment.
5. Click Send.
6. Log out of the ExtSRV FortiMail webmail GUI.
© FORTINET
2. Open the PDF attachment.
3. Verify that the URIs in the PDF file were neutralized.
4. Close the PDF reader.
5. Open a new browser tab, and then on the IntGW FortiMail webmail GUI, log in with the username user1 and
password fortinet.
6. Open the quarantined email, and then view the attached, unmodified PDF file.
7. Compare the quarantined PDF file with the sanitized PDF file that was delivered to the user's mailbox.
In the sanitized PDF file , the links were neutralized by CDR. You cannot click the links
to visit the websites.
In the quarantined PDF, the links are still active. You can click the links to visit the
websites.
You will validate CDR URI removal by sending an email with different URIs. FortiMail will remove any URI to
display only the website name and no underlying links that can be misleading or malicious.
© FORTINET
Notice that FortiMail expands what URL was associated with a link in the email.
(http://www.fortinet.com for www.fortinet.com), https://eicar.org is exactly as listed,
and fortiguard.com did not have an associated web link and is treated as basic text.
You will send an email with HTML content. CDR should neutralize all potentially hazardous tags and attributes,
such as hyperlinks and scripts. Then, you will release the original email from quarantine and compare the original
email with the sanitized email.
5. Enter the following swaks command to send the email with HTML content:
cat Resources/tosanitize.dat | swaks -f [email protected] -t [email protected] -s
intgw.internal.lab --ehlo linux.internal.lab --data -
Swaks takes the contents of the tosanitize.dat file, which contains HTML
content, and includes it in the body of the email.
A copy of the swaks command is in the commands.txt file, which is located in the
Resources folder on the Linux-Client VM desktop.
© FORTINET
6. Close the terminal window.
7. In Thunderbird, review the email that you just sent.
8. Verify that it has been converted to text and all URIs in the email body have been neutralized and displayed in
parentheses.
HTML links in the body of the email will redirect the user to various websites.
In this lab, you will implement SMTPS between IntGW FortiMail and IntSRV FortiMail. You will also configure
content inspection-based identity-based encryption (IBE), and verify your configuration by sending a secure
email.
Objectives
l Implement SMTPS between IntGW FortiMail and IntSRV FortiMail
l Implement content inspection-based IBE
l Configure the dictionary profile with the trigger word
l Configure an encryption profile
l Configure a content action profile to apply the encryption profile
l Apply the dictionary profile and content action profile to a content profile
l Apply the content profile to an outbound recipient-based policy
l Register an IBE user and access the IBE email
Time to Complete
Estimated: 40 minutes
Prerequisites
Before beginning this lab, you must disable CDR on IntGW FortiMail.
In this exercise, you will configure SMTPS between IntGW FortiMail and IntSRV FortiMail. You will also compare
logged details before and after implementing SMTPS.
You will send an email from an external MTA, and then review the logs on IntGW FortiMail to validate the type of
connection that was established between the external MTA and IntGW FortiMail.
To review logs
1. On the ExtSRV FortiMail webmail GUI, log in with the username extuser and password fortinet.
2. Send an email message to [email protected].
3. On the IntGW FortiMail management GUI, log in with the username admin and password password.
4. Click Monitor > Log > History.
The first entry in the History logs should correspond to the email you just sent.
5. Click the Session ID link to retrieve the cross-search results, and then review the last two entries, which contain
details about the session between IntGW FortiMail and IntSRV FortiMail.
© FORTINET
© FORTINET
By default, FortiMail uses SMTP over TLS if the recipient MTA supports it. In this
session, IntSRV FortiMail is the recipient MTA.
Configure SMTPS
On IntGW FortiMail, you will enable SMTPS for back-end connectivity with IntSRV FortiMail.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Verify SMTPS on page 133.
To configure SMTPS
1. Continuing on the IntGW FortiMail management GUI, click Domain & User > Domain > Domain.
2. Select internal.lab, and then click Edit.
3. Enable Use SMTPS.
© FORTINET
4. Click OK.
Verify SMTPS
You will send an email from a user in the external.lab domain, and then review the logs on IntGW FortiMail, to
validate that SMTPS is being used.
To verify SMTPS
1. Return to the ExtSRV FortiMail webmail GUI, and then send another email to [email protected].
2. Log out of the ExtSRV FortiMail webmail GUI.
3. Return to the IntGW FortiMail management GUI, and then click Monitor > Log > History.
The first entry in the History logs should correspond to the email message you just sent.
© FORTINET
The underlying encryption mechanism for SMTPS and SMTP over TLS is the same.
Both protocols use TLS. In this case, the FortiMail VMs negotiate TLSv1.3. The
difference is in how and when TLS encryption is applied.
When SMTP over TLS is used, the connection is made on the standard SMTP port—
TCP port 25. If the recipient MTA supports the STARTTLS extension, the sender
chooses whether SMTP over TLS is used, by transmitting the STARTTLS message.
This STARTTLS request happens after the envelope exchange, and so, in SMTP over
TLS, only a portion of the session is encrypted.
When SMTPS is used, the client initiates the SMTP session with the server over a
fully-encrypted tunnel, using a separate port—TCP port 465. SMTPS encrypts the full
session.
In this exercise, you will configure content inspection-based IBE. You will also verify your configuration by sending
an IBE email message and reviewing the logs.
You will enable the IBE service on IntGW FortiMail. You will enable replying, forwarding, and composing of email
messages for IBE users in the secure webmail portal.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Configure the IBE Trigger Word on page 136.
Field Value
© FORTINET
4. In the Email Status Notification section, enable Message is read (notify sender).
5. Click Apply.
You will configure a dictionary profile to define the IBE trigger word.
Create a wildcard dictionary entry. Use the string [CONFIDENTIAL]. Remember to use the correct escape
character.
The dictionary profile should search for the trigger word in email headers only.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Configure an Encryption Profile on page 137.
© FORTINET
Field Value
Pattern \[CONFIDENTIAL]
5. Click Create.
6. Click OK.
You will create a new content action profile that will trigger IBE.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Configure a Content Profile for IBE on page 138.
© FORTINET
Field Value
Domain --System--
You will configure a content profile for IBE, and then apply it to the outbound recipient policy for the
internal.lab domain.
The content profile should use the CF_IBE_Pull content action profile.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Validate IBE on page 139.
Field Value
Domain --System--
Action CF_IBE_Pull
© FORTINET
7. Click Create.
8. Click Create.
Validate IBE
You will send an email with the IBE trigger word to a user in the external.lab domain. You will verify that IBE is
working by viewing the logs on IntGW FortiMail.
Field Value
3. Click Send.
4. Close Thunderbird.
© FORTINET
To verify IBE operations using logs
1. Return to the IntGW FortiMail management GUI, and then click Monitor > Log > History.
The first entry in the History logs should correspond to the email you just sent.
In this exercise, you will register a new IBE user. Then, you will log in to the secure portal to retrieve the IBE email.
You will also see the message read notification that the sender receives after the IBE user has read the IBE email.
You will register an IBE user. To register, you must submit your name, create a password, and answer three
password recovery questions.
© FORTINET
The FortiMail IBE webmail GUI displays a notification that the registration was successful.
© FORTINET
6. Reply to the IBE email message.
7. Log out of the IBE webmail GUI.
8. Log out of the ExtSRV FortiMail webmail GUI.
3. Close Thunderbird.
In this lab, you will build an active-passive FortiMail high availability (HA) cluster with two FortiMail VMs. The
cluster will operate in server mode.
You will configure IntSRV FortiMail (10.0.1.99) as the primary device and IntGW FortiMail (10.0.1.11) as the
secondary device. You will verify the HA and configuration synchronization status, configure a virtual IP, and use
the HA service monitor to detect when the SMTP service connectivity fails on the primary FortiMail device.
The DNS server in the lab network has the following CNAME records to help identify the two clustered devices:
l primary CNAME intsrv.internal.lab
l secondary CNAME intgw.internal.lab
Objectives
l Configure an active-passive HA cluster
l Verify the health of the cluster
l Configure a virtual IP for the HA cluster
l Configure remote service monitoring
Time to Complete
Estimated: 40 minutes
Prerequisites
Before beginning this lab, you must change the operation mode of IntGW FortiMail.
© FORTINET
The IP address for port1 on IntGW FortiMail persists after changing the operation
mode. After the restart, you will be able to access the IntGW FortiMail management
GUI again.
6. Verify that the following system settings have not been reset:
© FORTINET
l Interface (System > Network > Interface)
l Route (System > Network > Routing)
l DNS (System > Network > DNS)
7. Verify the status of the following mail settings—the settings should be reset to factory default values:
l Mail server settings (System > Mail Setting > Mail Server Setting)
l Domains (Domain & User > Domain > Domain)
IntGW FortiMail is ready to be configured as a secondary device in the cluster.
Caution: When doing the lab exercises, ensure you apply the configuration changes
to the correct FortiMail VM.
If, at any point, you want to reset the configuration state for the FortiMail VMs, you can
restore the following configuration files:
Always restore the secondary FortiMail first, and then the primary FortiMail. The
configuration files restore the VMs to the standalone states they were in after you
completed Secure Communications on page 129.
In this exercise, you will configure an active-passive cluster with two FortiMail VMs.
You will configure the mail server settings on the primary FortiMail.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Configure the HA Settings on the Primary FortiMail on page 147.
On failure, the primary FortiMail (IntSRV) should wait for recovery, and then restore to the original role.
Configure port1 as a primary heartbeat port, enable port monitoring, and peer with the secondary FortiMail
(IntGW 10.0.1.11).
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Configure the Mail Server Settings on the Secondary FortiMail on
page 148.
© FORTINET
To configure the HA settings on the primary FortiMail
1. Continuing on the primary FortiMail (IntSRV) management GUI, click System > High Availability >
Configuration.
2. Configure the following settings:
Field Value
HA mode Primary
Field Value
5. Click Apply.
6. In the Interface section, double-click port1.
7. Configure the following settings:
Field Value
8. Click OK.
9. Click Apply.
10. Log out of the primary FortiMail (IntSRV) management GUI.
You will configure the mail server settings on the secondary FortiMail.
© FORTINET
Take the Expert Challenge!
Configure the host name of the secondary FortiMail (IntGW, 10.0.1.11) as secondary.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Configure the HA Settings on the Secondary FortiMail on page 149.
Field Value
4. Click Apply.
On failure, the secondary FortiMail (IntGW) should wait for recovery, and then restore to the original role.
On the secondary FortiMail (IntGW), configure port1 as a primary heartbeat port, enable port monitoring,
and configure the peer as the primary FortiMail (IntSRV 10.0.1.99).
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Verify the HA Status on page 150.
© FORTINET
Field Value
HA mode Secondary
Field Value
5. Click Apply.
6. In the Interface section, double-click port1.
7. Configure the following settings:
Field Value
8. Click OK.
9. Click Apply.
As soon as the two devices join in a cluster and complete synchronization, the
secondary FortiMail (IntGW) management GUI session times out and returns to the
login prompt. This process may take a few minutes.
© FORTINET
In this exercise, you will verify the status of both HA and the configuration synchronization for the FortiMail cluster.
You will verify the status of the HA cluster and configuration synchronization between the cluster members.
3. Click System > High Availability > Status to find the same information.
© FORTINET
3. Click System > High Availability > Status to find the same information.
© FORTINET
You will use CLI commands to verify the status of HA synchronization. The checksum for both FortiMail VMs
should match, indicating that the cluster is in sync.
© FORTINET
diagnose system ha showcsum
3. Open an SSH connection to the secondary FortiMail (IntGW).
4. Enter the following command to display the configuration checksum for the secondary FortiMail (IntGW):
diagnose system ha showcsum
5. Compare the checksum values of the two FortiMail VMs.
If they match, their configurations are in sync.
In this exercise, you will configure a virtual IP for the HA cluster. You will also verify the virtual IP function by
forcing a failover.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Verify the Virtual IP Configuration on page 157.
Field Value
5. Click OK.
6. Click Apply.
7. Log out of the primary FortiMail (IntSRV) management GUI.
© FORTINET
Field Value
5. Click OK.
6. Click Apply.
7. Log out of the secondary FortiMail (IntGW) management GUI.
You will verify the virtual IP configuration for the cluster by accessing the FortiMail management GUI.
Ignore any security warnings generated by your browser. These relate to the CN field
and the signer of the self-signed FortiMail certificate.
You will trigger a cluster failover and verify that the failover was successful.
© FORTINET
3. Click OK.
4. Click OK.
After a few seconds, you are redirected to the login prompt.
In this exercise, you will configure remote SMTP service monitoring on both devices in the cluster. Then, you will
trigger a service-based failover to verify the configuration, and then verify the failover using event logs.
You will configure remote SMTP service monitoring on the primary FortiMail.
If the connection attempt times out for 10 seconds, it should be considered a failure.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Configure SMTP Service Monitoring on the Secondary FortiMail on
page 160.
Field Value
Enable Enabled
Remote IP 10.0.1.11
Timeout 10
Interval 30
Retries 2
© FORTINET
For the purposes of this lab, you are reducing the time values to their lowest
configurable value to speed things up. In a live production environment, the default
values are a good place to start. You can fine-tune them as you discover what kind of
outage your email network can tolerate.
5. Click OK.
6. Click Apply.
If the connection attempt times out for 10 seconds, it should be considered a failure.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Trigger a Service-Based Failover on page 161.
Field Value
Enable Enabled
Remote IP 10.0.1.99
Timeout 10
Interval 30
Retries 2
5. Click OK.
6. Click Apply.
© FORTINET
Trigger a Service-Based Failover
You will trigger a service-based failover by changing the SMTP service port on the primary FortiMail (IntSRV). The
secondary FortiMail (IntGW) will fail to connect to the standard SMTP port (TCP port 25), which should trigger a
failover. You will verify the failover using the system event logs.
You changed the SMTP service port on the primary FortiMail (IntSRV) to port 125.
Because of this change, the secondary FortiMail (IntGW) can no longer detect SMTP
services on port 25. This will trigger a failover based on a remote service failure.
You must wait a few minutes for the secondary FortiMail (IntGW) to go through the
service monitoring check schedule before a failover is triggered.
After the second detection, the secondary FortiMail takes over as the active member.
© FORTINET
5. Return to the primary FortiMail (IntSRV) management GUI, and then click Dashboard > Status.
6. On the System Information widget, verify that the HA status values are Configured: Primary, Effective:
Failed.
This means that the primary FortiMail (IntSRV) has had a failure.
© FORTINET
Restore the Cluster
You will restore the SMTP services on the primary FortiMail (IntSRV), which will restore the cluster.
4. Continuing on the primary FortiMail (IntSRV) management GUI, click System > High Availability > Status.
5. In the Actions section, click Restart the HA system.
6. Click OK.
7. Click the Refresh button.
The primary FortiMail (IntSRV) joins the cluster as Secondary because that was how it was configured.
© FORTINET
In this lab, you will configure server mode resource profiles, and see their effect on user resource allocation. You
will also populate the global address book from the LDAP server.
Objectives
l Configure resource profiles
l Configure LDAP mapping to import a domain address book
Time to Complete
Estimated: 35 minutes
Prerequisites
Before beginning this lab, you must restore a configuration file on the internal.lab FortiMail VMs.
The configuration files will restore the FortiMail VMs to a similar state they were in
before you completed High Availability on page 144.
In this exercise, you will review the IntSRV FortiMail configuration. Then, you will configure resource profiles and
observe their effects on resource allocation for email users.
You will review the server mode webmail interface, which comes with all the standard mailbox features. You will
also verify the default disk limit for users.
If there are no resource profiles configured, server mode users have access to their
personal address book only.
© FORTINET
Configure Resource Profiles
The PowerUsers resource profile should allow users access to 2000 MB of disk space and the domain
address book.
The RegularUsers resource profile should allow users access to 1000 MB of disk space.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Apply the Resource Profiles to a Recipient Policy on page 168.
Field Value
Domain internal.lab
5. Expand Webmail access, and then enable Domain under Address book access.
6. Click Create.
7. Click New.
8. Configure the following settings:
Field Value
Domain internal.lab
9. Click Create.
© FORTINET
Apply the Resource Profiles to a Recipient Policy
You will create two new inbound recipient policies, and apply resource profiles to specific users.
Configure a second recipient policy to apply the RegularUsers resource profile to [email protected].
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Validate the Resource Profile Configuration on page 169.
Field Value
Domain internal.lab
Resource PowerUsers
4. Click Create.
5. Click New.
6. Configure the following values:
Field Value
Domain internal.lab
Resource RegularUsers
7. Click Create.
Your recipient policy configuration should match the following example:
© FORTINET
For larger deployments that have different levels of resource allocation requirements,
you can create recipient policies for local or LDAP groups, and assign resource profiles
using separate recipient policies.
You will verify the resource profile configuration by comparing the disk quota and address book access for user1
and user2.
If you were already logged in, you must log out and log back in for the resource profile
changes to apply.
2. Verify that [email protected] has the correct disk quota and address book access.
© FORTINET
In this exercise, you will review the existing LDAP profile you configured in Authentication on page 41. Then, you
will configure an LDAP mapping profile and use the LDAP profile to import contacts into the domain address book.
© FORTINET
5. Click Cancel.
You will configure a new LDAP mapping profile. You will use attributes from the OpenLDAP server.
© FORTINET
Take the Expert Challenge!
On IntSRV FortiMail, create a new LDAP mapping profile and name it InternalLabMapping.
Map the following address book fields to their matching LDAP attributes:
l Email (Work) → mail
l Display name → cn
l First name → givenName
l Last name → sn
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Import Contacts From LDAP on page 174.
Field Value
Display name cn
Last name sn
To review how to find the LDAP attributes of OpenLDAP objects, see Authentication on
page 41.
© FORTINET
4. Click Create.
You will import all LDAP contacts from the internal.lab LDAP database.
The import should overwrite existing contacts and delete any nonexistent contacts.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Verify the Domain Address Book From Webmail on page 175.
Field Value
© FORTINET
Field Value
5. Click OK.
The system notifies you that LDAP synchronization is running.
6. Click OK.
7. Click the refresh icon.
After the import, your internal.lab address book should match the following example:
There are extra contact entries for Mail User 1 and Mail User 2 because they were added automatically when
these users were created on the FortiMail as local domain users. If you want, you can delete them from the
contact list.
You will verify the domain address book from the IntSRV FortiMail webmail interface.
© FORTINET
3. Click Domain.
4. Verify that the contacts imported from LDAP are now in the Domain address book for [email protected].
In this lab, you will configure a transparent mode FortiMail to process bidirectional email for the external.lab
domain, using the built-in MTA. You will also configure and verify bidirectional transparency.
Objectives
l Configure a transparent mode FortiMail to process bidirectional email
l Verify built-in MTA functionality
l Configure bidirectional transparency
Time to Complete
Estimated: 50 minutes
In this exercise, you will review the initial system configuration and deployment topology of ExtTP FortiMail
running in transparent mode. Then, you will perform the rest of the basic configuration tasks required to establish
bidirectional email flow. You will also verify built-in MTA functionality using logs.
You will verify the initial system configuration of ExtTP FortiMail. You will verify the operation mode, network
interface, and routing. You will also configure the DNS settings, and review the deployment topology.
© FORTINET
Field Value
9. Click Apply.
© FORTINET
Configure Connection Pickup
You will verify and configure connection pickup settings on ExtTP FortiMail.
Configure port2 to proxy outgoing connections, pass through incoming connections, and drop local
connections.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Configure the Mail Server Settings on page 181.
Field Value
5. Click OK.
6. Double-click port2.
7. Expand the SMTP proxy section.
8. Configure the following settings:
Field Value
9. Click OK.
© FORTINET
Since port1 is the closest interface to the source for all incoming email, port1 proxies all
incoming connections. Since port2 is the closest interface to the source for all outgoing
email, port2 proxies all outgoing connections.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Configure a Protected Domain on page 181.
Field Value
3. Click Apply.
You will configure a protected domain on ExtTP FortiMail, and configure the transparent mode settings to identify
which interface will connect to the back-end mail server (ExtSRV FortiMail).
After processing, the emails should be delivered to ExtSRV FortiMail (100.64.1.99), using port2.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Configure an Access Control Rule for Outbound Emails on page 183.
© FORTINET
To configure a protected domain
1. Continuing on the ExtTP FortiMail management GUI, click Domain & User > Domain > Domain.
2. Click New.
3. Configure the following settings:
Field Value
6. Click Create.
© FORTINET
Configure an Access Control Rule for Outbound Emails
You will create an access receive rule to allow outbound emails from the external.lab users.
After you complete the challenge, see Validate Transparent Mode Functionality on page 183.
Field Value
Sender *@external.lab
Source 100.64.1.99/32
Action Relay
4. Click Create.
You will validate your configuration by sending emails back and forth between the internal.lab and
external.lab domains. The email should be routed in both directions, and you will verify that from the logs on
ExtTP FortiMail.
Field Value
© FORTINET
Field Value
3. Click Send.
4. On the ExtSRV FortiMail webmail GUI, log in with the username extuser and password fortinet.
5. Verify that the email was delivered.
6. Reply to the email.
7. Log out of the ExtSRV FortiMail webmail GUI.
8. Return to the Thunderbird client, and then verify that the reply was received.
9. Close Thunderbird.
3. View the details for each log, and review the values in the Direction and Mailer fields.
© FORTINET
The mta value in the Mailer field shows that ExtTP FortiMail is using its built-in MTA to
route emails in both directions.
You verified that ExtTP FortiMail is picking up emails in both directions, and using the built-in MTA to route emails
to their destination successfully.
In this exercise, you will examine email message headers to investigate the transparency of ExtTP FortiMail.
Then, you will configure transparency for both incoming and outgoing emails.
You will examine the message headers of emails to determine the transparency of ExtTP FortiMail.
ExtTP FortiMail appears in the Received headers. It is not yet fully transparent.
© FORTINET
Configure Bidirectional Transparency
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Verify Inbound Transparency on page 187.
You will verify inbound transparency by sending an email from a user in the internal.lab domain to a user in
the external.lab domain. You will review the message headers of that email to verify that ExtTP FortiMail does
not appear in the Received headers.
© FORTINET
You will send an email from a user in the external.lab domain to a user in the internal.lab domain. You
will review the message headers of that email to verify outbound transparency.
While the header is now showing the IP address of ExtSRV FortiMail (100.64.1.99),
the host name still shows ExtTP.external.lab. This is because ExtTP FortiMail
uses its own host name in the SMTP greeting. There is one more configuration change
you must make to prevent this.
You will configure SMTP greeting rewrite so that ExtTP FortiMail does not use its own host name in the SMTP
greeting. To replicate the ExtSRV SMTP greeting, you will use the host name ExtSRV.external.lab.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
After you complete the challenge, see Validate SMTP Greeting Rewrite on page 189.
© FORTINET
4. In the SMTP greeting (EHLO/HELO) name (as client) drop-down list, select Use other name, and then in the
field, type ExtSRV.external.lab.
5. Click OK.
6. Click OK.
7. Log out of the ExtTP FortiMail management GUI.
You will send another email from a user in the external.lab domain, and then verify the message headers.
6. Close Thunderbird.
In this lab, you will configure and generate a local report, and monitor system resource use.
Objectives
l Configure and generate a local report
l Monitor historical and real-time system resource use
Time to Complete
Estimated: 20 minutes
In this exercise, you will configure a local report on IntGW FortiMail for mail filtering statistics. Then, you will
generate an on-demand report and review the statistics.
Field Value
© FORTINET
9. Click Create.
On a production FortiMail, you should also configure scheduling, and add a notification
email address so that the report is automatically generated and emailed to you. The
scheduled reporting helps keep you up-to-date on the email trends of your network.
2. Click OK.
© FORTINET
4. Use the menu on the left to navigate and review the data.
In this exercise, you will view the historical and real-time resource usage on IntGW FortiMail.
3. Make a note of the trends in resource usage below the System Resource widget.
© FORTINET
You will use a script to generate continuous emails at a high rate, and then you will view the resource usage trends
during the period the script is running.
A list of system processes is displayed. The processes consuming the most CPU are
at the top of the list. The list refreshes every second, which gives you a real-time view
of the system resource usage.
© FORTINET
To generate traffic
1. On the Linux-Client VM, open a terminal window (Ctrl+Alt+T).
2. Enter the following command to open an SSH connection to the Linux-Router VM:
ssh [email protected]
3. Enter the password password.
4. Enter pwd.
5. Verify that your current working directory is /home/student.
6. Enter the following swaks command to send emails continuously:
while sleep 1; do swaks --to [email protected] --from "[email protected]" --
header "Subject: Testing live system resources" --body "This is a test mail" --
server IntGW.internal.lab --port 25 --timeout 40s; done
7. Leave the terminal window open.
A copy of the swaks command is in the commands.txt file, which is located in the
Resources folder on the Linux-Client desktop.
You must wait a few minutes before the charts refresh with new data.
Using the Period icon, you can select a different period time or specify how much
history you want to see for a particular resource.
2. Review the change in resource utilization across CPU, System Load, and Statistics History.
© FORTINET
3. Log out of the IntGW FortiMail management GUI.
4. Return to the Linux-Client VM, and then stop the swaks script (Ctrl+C).
5. Close the terminal window.
The internal.lab users are complaining that they cannot send or receive emails. In this lab, you will use SMTP
event logs and the built-in packet capture tool to investigate and fix the mail flow issues.
Objectives
l Investigate user complaints
l Use SMTP event logs and packet capturing to determine where the issue is occurring
l Fix the email flow issues
Time to Complete
Estimated: 45 minutes
Prerequisites
Before beginning this lab, you must restore a configuration file on the internal.lab FortiMail VMs.
In this exercise, you will verify the problem. Then, you will use SMTP event logs and packet capture tools to
determine where the issue is.
You will send an email from a user in the external.lab domain to a user in the internal.lab domain. You
will view the logs on IntGW FortiMail and try to identify any potential issues.
© FORTINET
© FORTINET
In this instance, the History log details don’t provide much information. You must dig
deeper.
5. Click Close.
6. Click the Session ID link to retrieve the cross-search results.
7. Review the Mail Event logs related to the session.
The first two event logs are for the external part of the session—from ExtSRV FortiMail
to IntGW FortiMail. The third event log is for the internal part of the session—from
IntGW FortiMail to IntSRV FortiMail.
© FORTINET
The external part of the session appears to be without issues. The internal part of the
session appears to be experiencing problems. Specifically, the connection from IntGW
FortiMail to 10.0.1.99 is not connecting. However, the reason for the timeout is not
listed.
8. Click Close.
9. Log out of the IntGW FortiMail management GUI.
You will send an email from a user in the internal.lab domain to a user in the external.lab domain. You
will view the logs on IntSRV FortiMail and try to identify any potential issues.
2. Click Cancel.
3. Click OK.
If you can’t find an entry in the history or event logs for a specific session, it means
there is an issue at either the IP or TCP layer. In these types of scenarios, only a traffic
capture might show you what the problem is.
© FORTINET
Capture Inbound Email Traffic
You will send an email from a user in the external.lab domain to a user in the internal.lab domain, and
capture that email traffic on IntGW FortiMail.
Field Value
Description InboundCapture
Duration 10 minutes
Interface port1
IP/Host 10.0.1.99
Filter None
After investigating the inbound email flow, you established that the issue appears to be
with the internal portion of the email session. Therefore, you are only interested in
seeing traffic for IntSRV FortiMail (10.0.1.99).
5. Click Create.
6. Return to the ExtSRV FortiMail webmail GUI, and then send a new email to [email protected].
7. Log out of the ExtSRV FortiMail webmail GUI.
8. Return to the Linux-Client VM, and then on the Traffic Capture tab, click the Refresh icon ( ).
© FORTINET
12. Save the capture file to the Downloads folder.
13. Log out of the IntGW FortiMail management GUI.
You will review the traffic capture file and try to identify any potential issues.
3. Select the first packet (Source: 10.0.1.11 Destination 10.0.1.99), and then expand the Transmission
Control Protocol header.
© FORTINET
This is the first packet of the session between IntGW FortiMail (10.0.1.11) and
IntSRV FortiMail (10.0.1.99) on destination port 465. This packet has a sequence
number of 0 and is flagged as the SYN packet. This packet is expected, since all TCP
sessions start with a SYN packet.
This second packet is not expected. It is a TCP Retransmission packet with a SYN
flag. IntSRV FortiMail (10.0.1.99) is not sending a reply back to IntGW FortiMail
(10.0.1.11) when it attempts to connect on port 465. The expected packet is a
SYN/ACK packet, but this is not the case.
From this analysis, you can start to form an idea about the root cause. IntGW FortiMail
(10.0.1.11) is sending a SYN packet for port 465—however, the connection to
IntSRV FortiMail (10.0.1.99) is timing out. So, it must be related to the remote side
not replying to the traffic. However, before you try to fix this issue, look at the outbound
session using another packet capture.
7. Close Wireshark.
© FORTINET
Capture Outbound Email Traffic
You will capture outbound email traffic using the packet capture tool on the IntSRV FortiMail CLI. You will review
the packet capture output and try to identify any potential issues.
The sniffer filter captures SMTP (port 25) traffic from the Linux-Client VM
(10.0.1.10).
3. Return to the Linux-Client VM, and then using Thunderbird, try to resend the email to [email protected].
4. Click Cancel.
5. Click OK.
6. Return to the IntSRV FortiMail SSH session, and then review the capture output.
IntSRV FortiMail is showing similar behavior for outbound traffic. The Linux-Client VM
(10.0.1.10) is initiating the session on port 25 with a SYN packet. However, IntSRV
FortiMail (10.0.1.99) is not replying to the session.
In this exercise, you will review the configuration and fix any errors. Then, you will verify your changes by sending
email in both directions.
You will review the configuration on IntSRV FortiMail, and fix any potential configuration issues.
Validate your fixes by sending email messages back and forth between the internal.lab domain and
external.lab domain.
If you require assistance, or to verify your work, use the step-by-step instructions that follow.
© FORTINET
The SMTP server port number and SMTPS server port number values have been
modified.
No part of this publication may be reproduced in any form or by any means or used to make any
derivative such as translation, transformation, or adaptation without permission from Fortinet Inc.,
as stipulated by the United States Copyright Act of 1976.
Copyright© 2022 Fortinet, Inc. All rights reserved. Fortinet®, FortiGate®, FortiCare® and FortiGuard®, and certain other marks are registered trademarks of Fortinet,
Inc., in the U.S. and other jurisdictions, and other Fortinet names herein may also be registered and/or common law trademarks of Fortinet. All other product or company
names may be trademarks of their respective owners. Performance and other metrics contained herein were attained in internal lab tests under ideal conditions, and
actual performance and other results may vary. Network variables, different network environments and other conditions may affect performance results. Nothing herein
represents any binding commitment by Fortinet, and Fortinet disclaims all warranties, whether express or implied, except to the extent Fortinet enters a binding written
contract, signed by Fortinet’s General Counsel, with a purchaser that expressly warrants that the identified product will perform according to certain expressly-identified
performance metrics and, in such event, only the specific performance metrics expressly identified in such binding written contract shall be binding on Fortinet. For
absolute clarity, any such warranty will be limited to performance in the same ideal conditions as in Fortinet’s internal lab tests. In no event does Fortinet make any
commitment related to future deliverables, features, or development, and circumstances may change such that any forward-looking statements herein are not accurate.
Fortinet disclaims in full any covenants, representations,and guarantees pursuant hereto, whether express or implied. Fortinet reserves the right to change, modify,
transfer, or otherwise revise this publication without notice, and the most current version of the publication shall be applicable.