Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

notify/email.go: fixup smtp.NewClient second param #681

Merged
merged 1 commit into from
Apr 13, 2020

Conversation

ttys3
Copy link
Contributor

@ttys3 ttys3 commented Apr 13, 2020

  1. second param is wrong

  2. most time it does not effact the result, but when you are connecting to a localhost smtp server with
    PLAIN AUTH enabled but without TLS enabled. it will fail

I also marked this problem in my smtp-brd FAQ

smtp.plainAuth failed: unencrypted connection
You need either to setup TLS on your SMTP server,
use localhost as a relay or disable authentication.
the answer come from
this issue

The error is because the Go SMTP package doesn't allow authentication without encryption.
From <https://godoc.org/net/smtp#PlainAuth>

PlainAuth will only send the credentials if the connection is using TLS
or is connected to localhost. Otherwise authentication
will fail with an error, without sending the credentials.

the important part is localhost, if your send it localhost:25 or other addr with port, it will fail.

@ttys3 ttys3 requested a review from umputun as a code owner April 13, 2020 12:10
Copy link
Collaborator

@paskal paskal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks legit. Thank you for the fix!

@umputun umputun merged commit 9459a2a into umputun:master Apr 13, 2020
@umputun umputun added this to the v1.6 milestone Apr 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants