Repository: containrrr/watchtower

Issue #341: Failed to send notification email:  dial tcp xxx:0: connect: connection refused
Created: 2019-07-02T08:24:56Z
Describe the bug
I try to send notification mails via an external / host postfix.
To Reproduce
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -e WATCHTOWER_NOTIFICATIONS=email -e WATCHTOWER_NOTIFICATION_EMAIL_FROM=me@example.com -e WATCHTOWER_NOTIFICATION_EMAIL_TO=me@example.com -e WATCHTOWER_NOTIFICATION_EMAIL_SERVER=x.x.x.x -e WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PORT=25 containrrr/watchtower --run-once --monitor-only
Expected behavior
notification mail sent via x.x.x.x:25
Environment

Platform: Ubuntu 19.04
Architecture: x64
Docker version: 18.09.6

Logs from running watchtower with the --debug option
time="2019-07-02T08:23:23Z" level=info msg="Running a one time update."
time="2019-07-02T08:23:23Z" level=debug msg="Checking containers for updated images"
time="2019-07-02T08:23:23Z" level=debug msg="Retrieving running containers"
Failed to send notification email:  dial tcp x.x.x.x:0: connect: connection refused
Additional context
As you can see, the port is ignored and watchtower tries to connect to port 0, whis also happpen if I omit  WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PORT

Duplicate issue #342: Failed to send notification email
Created: 2019-07-02T09:19:19Z
Since 4 days no e-mail notification is sent. The log for the container says:
"Failed to send notification email:  dial tcp 173.194.76.109:0: connect: connection timed out"
Environment

Platform: Ubuntu 18.04.2 LTS (4.15.0-54-generic)
Architecture: linux x86_64
Docker version: 18.09.5 (API: 1.39)

Logs from running watchtower with the --debug option
time="2019-07-02T04:50:46+02:00" level=debug msg="Skipped another update already running.",
time="2019-07-02T04:50:46+02:00" level=debug msg="Scheduled next run: 2019-07-02 04:50:47 +0200 CEST",
time="2019-07-02T04:50:46+02:00" level=debug msg="No new images found for /watchtower",
time="2019-07-02T04:50:46+02:00" level=debug msg="Pulling mod242/easyepg:latest for /easyepg",
time="2019-07-02T04:50:46+02:00" level=debug msg="No credentials for mod242 in /config.json",
time="2019-07-02T04:50:46+02:00" level=debug msg="Got auth value: ",
time="2019-07-02T04:50:46+02:00" level=debug msg="Got image name: mod242/easyepg:latest",
time="2019-07-02T04:50:46+02:00" level=debug msg="No authentication credentials found for mod242/easyepg:latest",
time="2019-07-02T04:50:47+02:00" level=debug msg="Skipped another update already running.",
time="2019-07-02T04:50:47+02:00" level=debug msg="Scheduled next run: 2019-07-02 04:50:48 +0200 CEST",
time="2019-07-02T04:50:48+02:00" level=debug msg="Skipped another update already running.",
time="2019-07-02T04:50:48+02:00" level=debug msg="Scheduled next run: 2019-07-02 04:50:49 +0200 CEST",
time="2019-07-02T04:50:48+02:00" level=debug msg="No new images found for /easyepg",
time="2019-07-02T04:50:48+02:00" level=debug msg="Pulling portainer/portainer:latest for /portainer",
time="2019-07-02T04:50:48+02:00" level=debug msg="No credentials for portainer in /config.json",
time="2019-07-02T04:50:48+02:00" level=debug msg="Got auth value: ",
time="2019-07-02T04:50:48+02:00" level=debug msg="Got image name: portainer/portainer:latest",
time="2019-07-02T04:50:48+02:00" level=debug msg="No authentication credentials found for portainer/portainer:latest",
time="2019-07-02T04:50:49+02:00" level=debug msg="Skipped another update already running.",
time="2019-07-02T04:50:49+02:00" level=debug msg="Scheduled next run: 2019-07-02 04:50:50 +0200 CEST",
time="2019-07-02T04:50:50+02:00" level=debug msg="Skipped another update already running.",
time="2019-07-02T04:50:50+02:00" level=debug msg="Scheduled next run: 2019-07-02 04:50:51 +0200 CEST",
time="2019-07-02T04:50:50+02:00" level=debug msg="No new images found for /portainer",
time="2019-07-02T04:50:50+02:00" level=debug msg="This is the watchtower container /watchtower",
time="2019-07-02T04:50:50+02:00" level=info msg="Stopping /hassio_supervisor (e6da434abfc3f24d69f65547df1aeda91431c13867656653be3ddf826d7b2dfd) with SIGTERM",
time="2019-07-02T04:50:51+02:00" level=debug msg="Skipped another update already running.",
time="2019-07-02T04:50:51+02:00" level=debug msg="Scheduled next run: 2019-07-02 04:50:52 +0200 CEST",
time="2019-07-02T04:50:51+02:00" level=debug msg="Removing container e6da434abfc3f24d69f65547df1aeda91431c13867656653be3ddf826d7b2dfd",
time="2019-07-02T04:50:51+02:00" level=info msg="Creating /hassio_supervisor",
time="2019-07-02T04:50:51+02:00" level=debug msg="Starting container /hassio_supervisor (0fbc44f12d6cb93b6f0ed88c3f3d13171c802414012fc8d206540ad2ee0109f5)",
time="2019-07-02T04:50:52+02:00" level=debug msg="Skipped another update already running.",
time="2019-07-02T04:50:52+02:00" level=debug msg="Scheduled next run: 2019-07-02 04:50:53 +0200 CEST",
time="2019-07-02T04:50:52+02:00" level=info msg="Removing image sha256:445047a76a72aa9fa46ed13087de832ac3702f8b1b65842802ec98318f3dbe40",
time="2019-07-02T04:50:52+02:00" level=debug msg="Scheduled next run: 2019-07-02 04:50:53 +0200 CEST",
time="2019-07-02T04:50:53+02:00" level=debug msg="Checking containers for updated images",
time="2019-07-02T04:50:53+02:00" level=debug msg="Retrieving running containers",
time="2019-07-02T04:50:53+02:00" level=debug msg="Pulling homeassistant/amd64-hassio-supervisor:latest for /hassio_supervisor",
time="2019-07-02T04:50:53+02:00" level=debug msg="No credentials for homeassistant in /config.json",
time="2019-07-02T04:50:53+02:00" level=debug msg="Got auth value: ",
time="2019-07-02T04:50:53+02:00" level=debug msg="Got image name: homeassistant/amd64-hassio-supervisor:latest",
time="2019-07-02T04:50:53+02:00" level=debug msg="No authentication credentials found for homeassistant/amd64-hassio-supervisor:latest",
time="2019-07-02T04:50:54+02:00" level=debug msg="Skipped another update already running.",
time="2019-07-02T04:50:54+02:00" level=debug msg="Scheduled next run: 2019-07-02 04:50:55 +0200 CEST",
time="2019-07-02T04:50:54+02:00" level=debug msg="No new images found for /hassio_supervisor",
time="2019-07-02T04:50:54+02:00" level=debug msg="Pulling linuxserver/tvheadend:latest for /tvheadend",
time="2019-07-02T04:50:54+02:00" level=debug msg="No credentials for linuxserver in /config.json",
time="2019-07-02T04:50:54+02:00" level=debug msg="Got auth value: ",
time="2019-07-02T04:50:54+02:00" level=debug msg="Got image name: linuxserver/tvheadend:latest",
time="2019-07-02T04:50:54+02:00" level=debug msg="No authentication credentials found for linuxserver/tvheadend:latest",
time="2019-07-02T04:50:55+02:00" level=debug msg="Skipped another update already running.",
time="2019-07-02T04:50:55+02:00" level=debug msg="Scheduled next run: 2019-07-02 04:50:56 +0200 CEST",
time="2019-07-02T04:50:56+02:00" level=debug msg="Skipped another update already running.",
time="2019-07-02T04:50:56+02:00" level=debug msg="Scheduled next run: 2019-07-02 04:50:57 +0200 CEST",
time="2019-07-02T04:50:56+02:00" level=debug msg="No new images found for /tvheadend",
time="2019-07-02T04:50:56+02:00" level=debug msg="Pulling rix1337/docker-rsscrawler:latest for /RSScrawler",
time="2019-07-02T04:50:56+02:00" level=debug msg="No credentials for rix1337 in /config.json",
time="2019-07-02T04:50:56+02:00" level=debug msg="Got auth value: ",
time="2019-07-02T04:50:56+02:00" level=debug msg="Got image name: rix1337/docker-rsscrawler:latest",
time="2019-07-02T04:50:56+02:00" level=debug msg="No authentication credentials found for rix1337/docker-rsscrawler:latest",
time="2019-07-02T04:50:57+02:00" level=debug msg="Skipped another update already running.",
time="2019-07-02T04:50:57+02:00" level=debug msg="Scheduled next run: 2019-07-02 04:50:58 +0200 CEST",
time="2019-07-02T04:50:57+02:00" level=debug msg="No new images found for /RSScrawler",
time="2019-07-02T04:50:57+02:00" level=debug msg="Pulling homeassistant/qemux86-64-homeassistant:latest for /homeassistant",
time="2019-07-02T04:50:57+02:00" level=debug msg="No credentials for homeassistant in /config.json",
time="2019-07-02T04:50:57+02:00" level=debug msg="Got auth value: ",
time="2019-07-02T04:50:57+02:00" level=debug msg="Got image name: homeassistant/qemux86-64-homeassistant:latest",
time="2019-07-02T04:50:57+02:00" level=debug msg="No authentication credentials found for homeassistant/qemux86-64-homeassistant:latest",
time="2019-07-02T04:50:58+02:00" level=debug msg="Skipped another update already running.",
time="2019-07-02T04:50:58+02:00" level=debug msg="Scheduled next run: 2019-07-02 04:50:59 +0200 CEST",
time="2019-07-02T04:50:59+02:00" level=debug msg="Skipped another update already running.",
time="2019-07-02T04:50:59+02:00" level=debug msg="Scheduled next run: 2019-07-03 04:50:00 +0200 CEST",
time="2019-07-02T04:50:59+02:00" level=debug msg="No new images found for /homeassistant",
time="2019-07-02T04:50:59+02:00" level=debug msg="Pulling homeassistant/amd64-addon-configurator:latest for /addon_core_configurator",
time="2019-07-02T04:50:59+02:00" level=debug msg="No credentials for homeassistant in /config.json",
time="2019-07-02T04:50:59+02:00" level=debug msg="Got auth value: ",
time="2019-07-02T04:50:59+02:00" level=debug msg="Got image name: homeassistant/amd64-addon-configurator:latest",
time="2019-07-02T04:50:59+02:00" level=debug msg="No authentication credentials found for homeassistant/amd64-addon-configurator:latest",
time="2019-07-02T04:51:00+02:00" level=debug msg="No new images found for /addon_core_configurator",
time="2019-07-02T04:51:00+02:00" level=debug msg="Pulling containrrr/watchtower:latest for /watchtower",
time="2019-07-02T04:51:00+02:00" level=debug msg="No credentials for containrrr in /config.json",
time="2019-07-02T04:51:00+02:00" level=debug msg="Got auth value: ",
time="2019-07-02T04:51:00+02:00" level=debug msg="Got image name: containrrr/watchtower:latest",
time="2019-07-02T04:51:00+02:00" level=debug msg="No authentication credentials found for containrrr/watchtower:latest",
time="2019-07-02T04:51:02+02:00" level=debug msg="No new images found for /watchtower",
time="2019-07-02T04:51:02+02:00" level=debug msg="Pulling mod242/easyepg:latest for /easyepg",
time="2019-07-02T04:51:02+02:00" level=debug msg="No credentials for mod242 in /config.json",
time="2019-07-02T04:51:02+02:00" level=debug msg="Got auth value: ",
time="2019-07-02T04:51:02+02:00" level=debug msg="Got image name: mod242/easyepg:latest",
time="2019-07-02T04:51:02+02:00" level=debug msg="No authentication credentials found for mod242/easyepg:latest",
time="2019-07-02T04:51:04+02:00" level=debug msg="No new images found for /easyepg",
time="2019-07-02T04:51:04+02:00" level=debug msg="Pulling portainer/portainer:latest for /portainer",
time="2019-07-02T04:51:04+02:00" level=debug msg="No credentials for portainer in /config.json",
time="2019-07-02T04:51:04+02:00" level=debug msg="Got auth value: ",
time="2019-07-02T04:51:04+02:00" level=debug msg="Got image name: portainer/portainer:latest",
time="2019-07-02T04:51:04+02:00" level=debug msg="No authentication credentials found for portainer/portainer:latest",
time="2019-07-02T04:51:06+02:00" level=debug msg="No new images found for /portainer",
time="2019-07-02T04:51:06+02:00" level=debug msg="This is the watchtower container /watchtower",
time="2019-07-02T04:51:06+02:00" level=debug msg="Scheduled next run: 2019-07-03 04:50:00 +0200 CEST",
Failed to send notification email:  dial tcp 173.194.76.109:0: connect: connection timed out,
Failed to send notification email:  dial tcp 173.194.76.109:0: connect: connection timed out,

Closing comment (2019-07-02T09:25:52Z): Thank you for the report 🙏
From what I can tell, this is a duplicate of #341 so I'm gonna go ahead and close this in favor of that one.