Alerting

How to use SMTP AUTH for action.email.mailserver emails?

mashery
Engager

I need alert emails generated by saved search monitors to be delivered via an email server that requires SMTP Authentication.

How can I specify SMTP AUTH credentials with action.email.* values?

araitz
Splunk Employee
Splunk Employee

SMTP authentication should be possible in Splunk 4.2.

the_wolverine
Champion

GERALD,

Can you post a sample sendemail.py script that has been modified to do SMTP AUTH?

Thank you.

0 Karma

gkanapathy
Splunk Employee
Splunk Employee

No, I can't. But it's just a matter of getting the credentials, then inserting a call to smtp.login() http://docs.python.org/library/smtplib.html#smtplib.SMTP.login after creating the smtp in the line smtp = smtplib.SMTP(serverURL).

0 Karma

gkanapathy
Splunk Employee
Splunk Employee

There are a couple of ways to do this:

  • You could customize and modify the sendemail.py python script that actually does the sending. The original is located in $SPLUNK_HOME/etc/apps/search/bin/. Rather than modifying the delivered file directly though (it will get clobbered on updates), you can create a version with a different name and either: override [sendemail] in etc/apps/search/default/commands.conf with a local .conf file, which will make Splunk just use the new version; or create a new commands.conf entry and override the command setting in the [email] stanza in etc/system/default/alert_actions.conf.
  • Another way that some prefer is to leave Splunk unmodified and configure your own SMTP server (e.g., one that is already running on the Splunk server) to authenticate to and relay all mail to the desired authentication-requiring SMTP server, leave yours to accept mail with no authentication, and have Splunk send messages to this local server. (You'll want to make sure your server is reachable only locally in this case.) You would follow instructions to set up your local SMTP server to perform SASL authentication to the desired outbound relay. A couple of simple examples with sendmail and postfix are here: http://www.screaming-penguin.com/node/4214 and here: http://www.riverturn.com/blog/?p=239
Get Updates on the Splunk Community!

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...

Stay Connected: Your Guide to October Tech Talks, Office Hours, and Webinars!

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...