Watchtower: SMTP autenticates as LocalHost

Created on 9 Jun 2020  路  9Comments  路  Source: containrrr/watchtower

Describe the bug
Watchtower sends EHLO HELO msg as LocalHost. Localhost is rejected by most mailservers.

To Reproduce
Steps to reproduce the behavior:

  1. Check postfix settings
  2. Send mail to postfix or other mail server
  3. see HELO as "localhost"

Expected behavior
Requires a fqdn for example name of hostsystem.

Environment

  • Platform: Arch
  • Architecture: x64
  • Docker version: 1.19

Logs from running watchtower with the --debug option
Watchtower:
time="2020-06-09T13:40:01Z" level=debug msg="Retrieving running containers"
time="2020-06-09T13:40:02Z" level=info msg="First run: 2020-06-10 04:00:00 +0000 UTC"
Failed to send notification email: 504 5.5.2 : Helo command rejected: need fully-qualified hostname

Postfix:
info | NOQUEUE: reject: RCPT from XXX[XX.XX.XX.XX]: 504 5.5.2 : Helo command rejected: need fully-qualified hostname; from=watchtower@XXX.XXX to=XXX@XXX.com proto=ESMTP helo=
-- | -- | --
info | Anonymous TLS connection established from XXX[XX.XX.XX.XX] to xx.xx.xx: TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)

Medium Available Bug

All 9 comments

Hi there! 馃憢馃徏 As you're new to this repo, we'd like to suggest that you read our code of conduct as well as our contribution guidelines. Thanks a bunch for opening your first issue! 馃檹

Ehm, what type of SMTP server are you trying to use? The statement that "Localhost is rejected by most mailservers." is only true for connections from mail relays/servers (where you do not have any credentials to prove that you are allowed to send the e-mail), not SMTP clients (as in, a user mail agent)

Ehm, what type of SMTP server are you trying to use? The statement that "Localhost is rejected by most mailservers." is only true for connections from SMTP clients (as in, a user mail agent), only between SMTP servers/relays (where you do not have any credentials to prove that you are allowed to send the e-mail).

I'm using mailcow and this breaks down to a postfix. No relay. This is a default setting and required via RFC. ( https://www.ietf.org/rfc/rfc2821.txt )

reject_non_fqdn_helo_hostname,
reject_invalid_helo_hostname,

http://www.postfix.org/postconf.5.html#reject_non_fqdn_helo_hostname

EDIT: no local mailserver on the same host.

Okay, so it's self-hosted? Watchtower is set up to communicate with "entry" SMTP relay servers (not the end-target SMTPs), where the HELO is essentially useless, since the user mail agent hardly ever know it's own FQDN, nor can be authenticated by it. Instead they authenticate using AUTH, providing credentials and restricting them to send e-mail from a limited set of addresses.
The easiest way to solve this for you is to either use an internet-facing SMTP (like from your ISP/hosting provider) or reconfigure your server with an exception (much tricker to get right without creating a open relay).

Ah okay, now I get it. This wasn't clear to me.

Yes self-hosted postfix.

Has the issue been resolved and we can close this?

Yes we can close this.

Thx for asking.

To avoid important communication to get lost in a closed issues no one monitors, I'll go ahead and lock this issue. If you want to continue the discussion, please open a new issue. Thank you! 馃檹馃徏

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ag0r4n picture ag0r4n  路  4Comments

auanasgheps picture auanasgheps  路  6Comments

andreo picture andreo  路  6Comments

aogg picture aogg  路  3Comments

meandthedevil picture meandthedevil  路  6Comments