FortiAnalyzer
FortiAnalyzer can receive logs and Windows host events directly from endpoints connected to EMS, and you can use FortiAnalyzer to analyze the logs and run reports.
bksol92
Staff
Staff
Article Id 301234

 

Description This article describes the '2-Step' Verification Issue When Using smtp.gmail.com as FortiAnalyzer/FortiManager's Mail Server.
Scope FortiManager, FortiAnalyzer.
Solution

Sometimes, there are requirements to use 2-factor authentication in one's mail server configuration.

In such cases, when using smtp.gmail.com as an SMTP server, with Gmail's 2-step verification turned on, one would encounter the following error:

 

Juara-kvm09 # diag test connection mailserver smtp send-from@gmail.com send-to@gmail.com

<-->
< 250-smtp.gmail.com at your service, [211.25.130.154]
< 250-SIZE 35882577
< 250-8BITMIME
< 250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH
< 250-ENHANCEDSTATUSCODES
< 250-PIPELINING
< 250-CHUNKING
< 250 SMTPUTF8
> AUTH PLAIN
< 334
> ###################################
< 534-5.7.9 Application-specific password required. For more information, go to
< 534 5.7.9 https://support.google.com/mail/?p=InvalidSecondFactor i17-20020a17090332d100b001db45855530sm2750230plr.290 - gsmtp
* Closing connection 0
Failed to send a test email to send-to@gmail.com through smtp.

 

The '2-step' verification requires an app password to be configured for FortiAnalyzer:

https://support.google.com/mail/answer/185833?hl=en#zippy=%2Cwhy-you-may-need-an-app-password

 

app-password1.PNG

 

 

Once created, an app password will be generated:

 

pw.PNG

 

Use the app password in FortiAnalyzer's mail server config, and a test email will be sent to the destination mail account successfully:

 

diag test connection mailserver smtp send-from@gmail.comsend-to@gmail.com

<-->

250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH
< 250-ENHANCEDSTATUSCODES
< 250-PIPELINING
< 250-CHUNKING
< 250 SMTPUTF8
> AUTH PLAIN
< 334
> ###################################
< 235 2.7.0 Accepted
> MAIL FROM:<send-from@gmail.com>
< 250 2.1.0 OK g3-20020a170902f74300b001dbf5048716sm2811014plw.95 - gsmtp
> RCPT TO:<send-to@gmail.com>
< 250 2.1.5 OK g3-20020a170902f74300b001dbf5048716sm2811014plw.95 - gsmtp
> DATA
< 354 Go ahead g3-20020a170902f74300b001dbf5048716sm2811014plw.95 - gsmtp
< 250 2.0.0 OK 1708913017 g3-20020a170902f74300b001dbf5048716sm2811014plw.95 - gsmtp
* Connection #0 to host smtp.gmail.com left intact
A test email has been sent to send-to@gmail.com through smtp.

 

Related article:

Technical Tip: Configuring FortiManager and FortiAnalyzer to use GMAIL