Reporting

How to determine a sendmail issue?

tkwaller_2
Communicator

I am getting an error after settign up email alerting
The error I get is:

08-29-2018 15:33:19.626 +0000 ERROR ScriptRunner - stderr from '/opt/splunk/bin/python /opt/splunk/etc/apps/search/bin/sendemail.py "results_link=https://ourdomain.com/app/ourapp/@go?sid=scheduler__twaller__ourapp__ABC5980879bd671d6025_at_1535556780_96501" "ssname=Todds Test Email" "graceful=True" "trigger_time=1535556798" results_file="/opt/splunk/var/run/splunk/dispatch/scheduler__twaller__ourapp__ABC5980879bd671d6025_at_1535556780_96501/results.csv.gz"':  ERROR:root:Connection unexpectedly closed while sending mail to: me@gmail.com
My email settings are:

Mail Server Settings
Mail host
smtp-relay.gmail.com:465

Email security =Enable SSL

No username/pass

Link hostname
https://ourdomain.com

Send emails as
MyCompany
Any ideas why I might be getting these errors about the closing connection? I get the same when searching and using sendemail

like:

index=main | head 5 | sendemail to=me@gmail.com server=smtp-relay.gmail.com:465 subject="Here is an email notification" message="This is an example message" sendresults=true inline=true format=raw sendpdf=true

I appreciate the assistance as always

0 Karma
1 Solution

tkwaller_2
Communicator

Found the issue. Well issues:

  1. If the search takes to long the sendemail will fail with this error

  2. The "Send emails as" field in the request sent to the relay server requires domain name to be within my domain. For example
    if my domain is google.com it will only allow emails from senders ending in @google.com

Changed from noreply-splunkdev
to noreply-splunkdev@gmail.com

View solution in original post

0 Karma

tkwaller_2
Communicator

Found the issue. Well issues:

  1. If the search takes to long the sendemail will fail with this error

  2. The "Send emails as" field in the request sent to the relay server requires domain name to be within my domain. For example
    if my domain is google.com it will only allow emails from senders ending in @google.com

Changed from noreply-splunkdev
to noreply-splunkdev@gmail.com

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!

Build the Future of Agentic AI: Join the Splunk Agentic Ops Hackathon

AI is changing how teams investigate incidents, detect threats, automate workflows, and build intelligent ...

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...