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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...

Customer success is front and center at .conf25

Hi Splunkers, If you are not able to be at .conf25 in person, you can still learn about all the latest news ...

.conf25 Global Broadcast: Don’t Miss a Moment

Hello Splunkers, .conf25 is only a click away.  Not able to make it to .conf25 in person? No worries, you can ...