Skip to main content
bpriya
Staff & Editor
Staff & Editor
May 26, 2020

Technical Tip: How to configure alert email settings

  • May 26, 2020
  • 0 replies
  • 245715 views

Description

This article describes how to configure email alerts for security profile, administrative, and VPN events.

Scope

FortiGate.

Solution

From the GUI:

Note: This default server will only be available to registered devices with an active FortiCare support contract. If, no FortiCare support contract is recognized, a warning will be displayed in System -> Settings for SMTP Server.

When trying to apply the changes in System -> Settings without a registered FortiCare support contract, another warning will display and require confirmation before being able to proceed.

1.jpg

 

Configure a mail service:


By default, the mail server of Fortinet is used, and it can be customized by enabling the custom settings under System -> Settings -> Email Service.

system-setting.PNG

 

To configure an alert email:


Go to Log & Report and enable 'Email Alert Settings'. Enable required events for alert mail as shown below.

 

mzainuddinahm_0-1741089702836.png


Note: 

On v6.4.0 and above, 'Email Alert Settings' is removed from the GUI. It can be configured with the 'config alertemail setting' command.

For example:

config alertemail setting
    set username "test@example.com"
    set mailto1 "test@example.com"
    set HA-logs enable
    set IPsec-errors-logs enable
    set PPP-errors-logs enable
    set sslvpn-authentication-errors-logs enable
    set configuration-changes-logs enable
end


From the CLI:

 

  • To configure the default email server (notification.fortinet.net): 

 

config system email-server
    set server "notification.fortinet.net"
    set reply-to "admin@fortinet.com"
    set source-ip 0.0.0.0
    set port 465
    set security smtps
end


Note:

The option 'set reply-to "admin@fortinet.com"' has been removed from v7.4.4.


It is important to set the source IP because it is often required in conditions where the WAN IP address cannot reach the internet directly or public visibility is handled by a secondary IP on the WAN role interface.

If there is no response from the server, change the outgoing interface.

config system email-server
    set interface-select-method specify
    set interface port1
end


Note: In this example, the interface port1 is specified. If the interface is SD-WAN, select only 'sdwan'. To make the FortiGate decide what interface is used, select 'auto' so the FortiGate sets the outgoing interface automatically.

 

To configure a custom email service in the CLI:

config system email-server
    set type custom
    set reply-to "helpdesk@fortinet.com"
    set server "smtp.office365.com"
    set port 587
    set source-ip 0.0.0.0
    set source-ip6 ::
    set authenticate enable
    set validate-server disable
    set username "example@domain.it"
    set security starttls
    set ssl-min-proto-version default
end


Note:

From v6.4.10, v7.0.8, v7.2.0, and above, the 'reply-to' option is only configurable when using a custom SMTP server. It will not be available when using the default SMTP server 'notification.fortinet.net'.

Starting from v7.4.4, the default email server in FortiOS has been updated from 'notification.fortinet.net' to 'fortinet-notifications.com'.


On v7.4.4 and later, the 'reply-to' address is now automatically set to 'DoNotReply@fortinet-notifications.com' for all email servers, including custom configurations. As a result, the 'reply-to' option is no longer available even on a custom SMTP server and thus cannot be changed. See the following article for more information: Technical Tip: Unable to configure 'Default Reply to' via GUI and CLI.

 

For custom servers, if a username is configured, then mail from is set to the username, but if no username is configured, then mail from is the same as mail to. It is not possible to customize the reply-to value when configuring a custom email server in the CLI.

config system email-server
    set type custom                                          
    set server "smtp.office.365.com"
    set port 587
    set source-ip 0.0.0.0
    set source-ip6 ::
    set authenticate enable
    set validate-server disable
    set username "test@notify.fortinet.com"
    set password ENC ***
    set security starttls
    set ssl-min-proto-version default
    set interface-select-method auto
end

 

After the settings are completed, a test email can be triggered to test the settings:

diagnose log alertmail test 

 

If the issue persists, collect the output of the following debug commands:

 

To collect the debug outputs for email alerts:

diagnose debug reset
diagnose debug enable
diagnose debug console timestamp enable
diagnose debug application alertmail -1

 

Send a test activation email: 

diagnose log alertmail test

 

Disable the debugging afterward:

diagnose debug disable
diagnose debug reset

 

Save the output. Either download it via the CLI window or use the PuTTY tool to log it. Attach the debug logs to the case for TAC review.

Notes:

  • If the 'username' and 'mailto' are set on the same domain name, the email cannot be received. They must be on different domain names. The maximum number of recipients using the 'mailto' command is 3; to configure more than 3 recipients, an email group is required, or configure automation stitch as an alternative. 

  • Email delivery through the server 'notification.fortinet.net' is only affected by IP reputation and not by any block policies. Issues with sending emails through this setup are not actively investigated due to the complexity of routing paths and potential ISP port blockages. The suggested solution is to use a proprietary email account and server, as explained in: Technical Tip: How to configure SMTP using a custom server and port on FortiGate.

 

Related documents: