Reporting

Why am I getting error "Connection refused while sending mail to: [email protected]" using the sendemail command in a search?

toddles666
New Member

I'm running the following search in order to test my email settings (I've obfuscated the email address)

and I'm getting this error:

command="sendemail", [Errno 111] Connection refused while sending mail to: [email protected]

Is there a log that has more details, or a more verbose response? The email config and credentials are being used elsewhere to send mail successfully.

Thanks,
Todd

0 Karma

juvetm
Communicator

Hi toddles666

this means that the sendemail script was not able to use your mailserver. The sendemail script uses by default localhost as mailserver (set by argument server= ). This can have multiple reasons like firewall blocking or mail server refusing to accept your request or no email process/server running on localhost. Check with your network/mailserver admin.

hope this helps ...

0 Karma

stephanefotso
Motivator

Is your splunk instance is in the cloud? because emails goes from one server to anothers you will not be able to send emails until your splunk instance is hosted.
Thanks

SGF
0 Karma

toddles666
New Member

A little more detail: The Splunk server is hosted on an AWS EC2 instance. I want to use the AWS Simple Email Service (that is successfully being used elsewhere in my VPC) to send email. The "Mail Server Settings" in the Splunk config has been configured with the AWS SES host, port, and credentials. These settings are correct as I can send email using the email host, port, and credentials from a shell session on the instance hosting the Splunk server. So:

  • Config and credentials seem to be correct
  • Firewall / Security Groups do not seem to be an issue

Is there any way I can further test or get better logging from Splunk itself?

Thanks,
Todd

0 Karma

stephanefotso
Motivator

Are you sure that your query is correct? Complete it as follows and let me know the result.

| sendemail [email protected] format=html server=my.server.net [email protected] sendresults=true subject="search email test" message=search_results 
SGF
0 Karma

juvetm
Communicator

are u doing this went you are connected locally because you needn to connected through internet to able to send mail

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!

Your Feedback. Our Roadmap. Visit the PX Feedback Booth at .conf26

You use Splunk every day, come and help shape what's next.  Save Your Seat: Product-Focused Sessions at ...

Agentic SOC Triage: Investigating Splunk ES Notables with MCP Server and a Local LLM

The Problem: Too Many Alerts, Too Little Context Security operations teams running Splunk Enterprise Security ...

Painting a Clearer Picture: Creating Cross-Domain Visibility with AI Canvas

Watch Now Painting a Clearer Picture: Creating Cross-Domain Visibility with AI Canvas     Do you ever feel ...