FortiManager
FortiManager supports network operations use cases for centralized management, best practices compliance, and workflow automation to provide better protection against breaches.
mdeparisse_FTNT
Article Id 213771
Description This article describes how to configure FortiManager and FortiAnalyzer to use the GMAIL SMTP service.
Scope FortiManager, FortiAnalyzer.
Solution
  1. Configure the Gmail account to use an App Password: It is needed to configure the Gmail account to allow connections from less secure applications, in this case, the FortiManager/FortiAnalyzer. An App Password is a 16-digit passcode that gives a less secure app or device permission to access the Google Account. App Passwords can only be used with accounts that have 2-Step Verification turned on.

  2. Add MAIL settings on the FortiManager or FortiAnalyzer:

config system mail
    edit "gmail"
      set auth enable       

      set user "email_account"

        set passwd "16-digit-password" 

        set port 587
        set secure-option starttls
        set server "smtp.gmail.com"
    next
end

 

Example using a GMAIL account 'fortinet.example@gmail.com':

 

config system mail
  edit "gmail"
    set auth enable
    set passwd 16-digit-password
    set port 587
    set secure-option starttls
    set server "smtp.gmail.com"
    set user "fortinet.example"
   next
end

 

  1. Following this, it will be possible to send a test email:

    diagnose test connection mailserver gmail <email source> <email destination>

Example:

 

diagnose test connection mailserver gmail fortinet.example user1@gmail.com
          Testing SMTP server gmail, please wait...
          * Host smtp.gmail.com:587 was resolved.
          * Connected to smtp.gmail.com (173.194.208.109) port 587
          .....
          > MAIL FROM:<fortinet.example>
          > RCPT TO:<user1@gmail.com>
          A test email has been sent to user1@gmail.com through gmail.

  1. Troubleshooting command if any issues:

 

execute tac report
diagnose debug application fazmaild 255
diagnose debug enable

diagnose test connection mailserver gmail <source SMTP address> <destination SMTP address>

 

Flow capture for FortiManager/FortiAnalyzer v7.6 or above:

 

diagnose test application fazmaild ?

<Integer> Debug level (08).

diagnose debug application fazmaild 8

diagnose debug timestamp enable

diagnose debug enable

 

  1. Capture and send us the results:

 

diagnose debug disable <----- To stop it.

diagnose debug reset

 

Related articles:

Technical Tip: How to configure email alerts for config and policy status changes on FortiManager

Technical Tip: How to set up Email Notifications with notification.fortinet.net

Google App Passwords - Google Support