Yelp / elastalert

Easy & Flexible Alerting With ElasticSearch
https://elastalert.readthedocs.org
Apache License 2.0
7.99k stars 1.74k forks source link

Help: Using sendmail from docker with docker namespaces #2730

Open gerbdla opened 4 years ago

gerbdla commented 4 years ago

This is a shot in the dark, but has anyone used sendmail from within the elastalert docker container to send a message to postfix with docker namespaces turned on?

I am getting this message sendmail: can't connect to remote host (127.0.0.1): Connection refused

I cannot turn on host networking for this image because of namespaces. I am stumped.

For my project I have to use postfix.

Thanks!

gerbdla commented 4 years ago

I found the solution to this. You need to use sendmail with the docker0 interface or the interface of the network you set up. If your using postfix, you need to update the main.cf postfix config file intet_interfaces=[ip of docker interface] mynetworks= ip of docker container and the subnet ie. 192.168.0.0/16. sendmail -S [docker0 interface ip] Thanks