Logstash Email Output Plugin not working

Here is my email setting
email {
to => "lovework@happywork.com"
from => "lovework@happywork.com"
subject => "Alert"
body => "Content:\n%{message}"
domain => "outlook.corp3.happywork.com"
port => 25
}

Domain is default to 'localhost' thus i overrode it to our mail server.

But very oddly, the error log says below:
-10T16:03:03,851][INFO ][org.logstash.beats.BeatsHandler] [local: 0.0.0.0:5044, remote: 10.4.32.91:50234] Exception: An existing connection was forcibly closed by the remote host
[2018-01-10T16:03:46,012][ERROR][logstash.outputs.email ] Something happen while delivering an email {:exception=>#<Errno::ECONNREFUSED: Connection refused - connect(2) for "localhost" port 25>}
[2018-01-10T16:03:47,163][ERROR][logstash.outputs.email ] Something happen while delivering an email {:exception=>#<Errno::ECONNREFUSED: Connection refused - connect(2) for "localhost" port 25>}

I don't quite understand is why it still tries to connect to localhost while i have changed it to
"outlook.corp3.happywork.com"

Thanks!

domain is what is sent on the EHLO, it should match where you are sending mail from, not what you are connecting to. address is what it connects to. Can you try adding this?

address => "outlook.corp3.happywork.com"

It works! Sorry for not reading the doc careful enough. Thank!!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.