Alerting

How to configure email alert using gmail smtp?

melonman
Motivator

Hi

I was trying to configure email alert to deliver scheduled saved search result.
The SMTP server I was trying to use is gmail SMTP.

The configuration in Email alert settings -> Mail Server Settings is:

Mail Host -> smtp.gmail.com:465
# Enable SSL checked

Username -> @gmai.com
Password ->
...

Is there any misconfiguration or limitation of SMTP server?
Does anyone know how to use gmail SMTP with splunk email alering?

Thank you!

Tags (1)
1 Solution

itinney
Path Finder

Hi,
What works for me is to use port 587 and use TLS in place of SSL.

If you try to test using the "sendemail" search command then I found that it does not seem to pick up every setting from alert_actions.conf file so I had to specify some of them for it to start working. This includes the undocumented argument "use_tls" which you can find in the sendemail.py script.

The following search worked for me and I then used these settings in alert_actions.conf (configured through the UI):
index=_internal | head 1 | sendemail to="[email protected]" format="html" server=smtp.gmail.com:587 use_tls=1

View solution in original post

sherm77
Path Finder

himynamesdave
Contributor

@sherm77 kudos coming your way!

0 Karma

saurabh_tek
Communicator

Thanks @himynamesdave for sharing the updated link

0 Karma

ashish_test
New Member

Hi, I'm getting error as "command="sendemail", [Errno 11001] getaddrinfo failed while sending mail to: [email protected].
I'hv faced to same error [Errno 11001] while testing integration with servicenow with the help of servicenow app. I think there is something wrong with my system settings? Can you please help.

Python log shows below error-
2013-10-28 19:06:29,036 DEBUG Preloading from 'C:\Program Files\Splunk\var\run\splunk\merged\web.conf'.
2013-10-28 19:06:29,038 DEBUG simpleRequest > GET https://127.0.0.1:8089/servicesNS/nobody/search/admin/alert_actions/email [] sessionSource=direct
2013-10-28 19:06:29,448 DEBUG simpleRequest < server responded status=200 responseTime=0.4110s
2013-10-28 19:06:29,457 ERROR Sending email. subject="Splunk Results", results_link="None", recipients="['[email protected]']"

0 Karma

itinney
Path Finder

Hi,
What works for me is to use port 587 and use TLS in place of SSL.

If you try to test using the "sendemail" search command then I found that it does not seem to pick up every setting from alert_actions.conf file so I had to specify some of them for it to start working. This includes the undocumented argument "use_tls" which you can find in the sendemail.py script.

The following search worked for me and I then used these settings in alert_actions.conf (configured through the UI):
index=_internal | head 1 | sendemail to="[email protected]" format="html" server=smtp.gmail.com:587 use_tls=1

melonman
Motivator

Thanks for answers and tips!

0 Karma

itinney
Path Finder

Oh and when you test the Scheduled Alert, don't forget to disable it so you don't get 50 alert emails in your inbox 😉

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

A Four-Part Event Series: Full Stack Observability For the AI Era

As AI reshapes applications, infrastructure, and the way teams operate, the traditional boundaries of ...

SOC4Kafka - New Kafka Connector Powered by OpenTelemetry

The new SOC4Kafka connector, built on OpenTelemetry, enables the collection of Kafka messages and forwards ...

Event Series: Level up your SOC: Advancing with Splunk Enterprise Security

AI has fundamentally raised the stakes for security operations, and this three-part series is your guide to ...