Solution |
-In some scenarios, where customers use automation stitch in order to receive notification about an action or trigger of an event.
- By default, the FortiGate unit tries to send the email using 'From email' fetched from the email-server config which is 'noreply' by default.
However, this results in a failed action.
# config system automation-action
edit "email_email"
set action-type email set email-to "abc@fortinet.com" set email-subject "email-test"
next
end
Debug logs
mail_info: from:smtp.office365.com user:noreply mail_info: reverse path:noreply@smtp.office365.com user name:noreply to[0]:abc@fortinet.com <==_init_mail_info create session resolve smtp.office365.com to 1 IP ==> send mail ! ! connecting to smtp.office365.com port 587 session: 0x1659e040, rsp_state: greeting, code: 220 session: 0x1659e040, rsp_state: ehlo, code: 250 session: 0x1659e040, rsp_state: mail, code: 501 session: 0x1659e040, rsp_state: quit, code: 221 session finined _session_on_destroy <== send mail failed, m = 0x165535f0 s = 0x1659e040 >>>>>
- In order to send the email correctly for automation stitch, the 'email-from' section needs to be explicitly configured under the specific automation-action.
Configuration:
# config system automation-action
edit "email_email"
set action-type email set email-to "abc@fortinet.com" set email-from "xyz@hotmail.fr"----> This needs to be set. set email-subject "email-test"
next
end
Debug logs with the correct 'email-from' address.
mail_info: from:smtp.office365.com user:xyz@hotmail.fr mail_info: reverse path:xyz@hotmail.fr user name:xyz to[0]:abc@fortinet.com <==_init_mail_info create session resolve smtp.office365.com to 1 IP ==> send mail connecting to 52.97.133.210 port 587 send mail 0x5fe22a0 session 0x5f1ade0 session: 0x5f1ade0, rsp_state: greeting, code: 220 session: 0x5f1ade0, rsp_state: ehlo, code: 250 session: 0x5f1ade0, rsp_state: starttls, code: 220 rsp_starttls: creating ssl structure for session 0x5f1ade0 create_ssl: 0x5fd1878 sessionn 0x5f1ade0, SSL connected session: 0x5f1ade0, rsp_state: ehlo, code: 250 session: 0x5f1ade0, rsp_state: auth, code: 334 session: 0x5f1ade0, rsp_state: auth2, code: 235 session: 0x5f1ade0, rsp_state: mail, code: 250 session: 0x5f1ade0, rsp_state: rcpt, code: 250 session: 0x5f1ade0, rsp_state: data, code: 354 === send: FGT[FGT61E4Q17004179] Automation Stitch:email is triggered. date=2022-06-30 time=07:23:17 eventtime="1656598997928780739" tz="-0700" logid="0100032102" type="event" subtype="system" level="alert" vd="root" logdesc="Configurati on changed" user="admin" ui="automation" action="test" msg="Automation Stitch Test: Configuration is changed in the admin session" stitch="email"
session: 0x5f1ade0, rsp_state: data2, code: 250 session: 0x5f1ade0, rsp_state: quit, code: 221 session finined _session_on_destroy <== send mail success, m = 0x5fe22a0 s = 0x5f1ade0 >>> Email has been sent successfully.
|