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>}