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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...