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

[SMTP] AUTH LOGIN #334

Open
w4tzmann opened this issue Mar 2, 2023 · 4 comments
Open

[SMTP] AUTH LOGIN #334

w4tzmann opened this issue Mar 2, 2023 · 4 comments
Labels
Service: SMTP Related to the SMTP service Status: Available Type: Enhancement New feature or request

Comments

@w4tzmann
Copy link

w4tzmann commented Mar 2, 2023

Hi :)
I'm not sure if this is a bug, a feature request, or i'm just making a mistake in the setup.
I am trying to send the email notification for watchtower via a microsoft exchange 2019 server, via starttls and user auth.
Exchange offers with AUTH GSSAPI NTLM LOGIN.
Unfortunately, according to the documentation, shoutrr cannot do any of these.

Currently the "WATCHTOWER_NOTIFICATION_URL" looks like this: "smtp://%upn%:%password%@%fqdn-ex%:587/?from=%fromaddress%&to=%toadress%&ClientHost=watchtower.local"

The watchtower log shows the following:

level=error msg="Failed to send shoutrrr notification" error="failed to snd using smtp: timed out".

The Exchange transport log has the following relevant entries:

504 5.7.4 Unrecognized authentication type
500 5.3.3 Unrecognized command '*'.
QUIT
221 2.0.0 Service closing transmission channel

Has anyone successfully used this constellation?
Is there an easy way to teach shoutrrr "AUTH Login"?

I would be happy to help with testing and provide more information.

Thanks and greetings

@piksel
Copy link
Member

piksel commented Jun 11, 2023

It could be possible to implement LOGIN authentication for the go email client. I think I managed to get it working in a PoC at some point, but it never went further than that.

@w4tzmann
Copy link
Author

Right now I have "solved" the problem by using a Docker postfix container as a relay.
I did a little research on this topic. I really don't understand why the GO net/smpt library doesn't include AUTH LOGIN method. I found some workarounds to implement the function, but my first attempts didn't work unfortunately. Since I'm not really a programmer (much less a golang), I decided to take the easy way out and spin up a mail relay. The effort to create a custom Docker image (for each Go application) incl. customization of the Go files seems too big for just a simple notification, which I can ignore 99% of the time anyway :D

If someone has a working solution ready, I'll be happy to test it.

@pingas12345
Copy link

Right now I have "solved" the problem by using a Docker postfix container as a relay. I did a little research on this topic. I really don't understand why the GO net/smpt library doesn't include AUTH LOGIN method. I found some workarounds to implement the function, but my first attempts didn't work unfortunately. Since I'm not really a programmer (much less a golang), I decided to take the easy way out and spin up a mail relay. The effort to create a custom Docker image (for each Go application) incl. customization of the Go files seems too big for just a simple notification, which I can ignore 99% of the time anyway :D

If someone has a working solution ready, I'll be happy to test it.

Hey, sorry to necro but do you mind explaining how you setup postfix as a relay? Thank you

@w4tzmann
Copy link
Author

Hey, sorry to necro but do you mind explaining how you setup postfix as a relay? Thank you

Hola,
unfortunately i don't have a matching setup running at the moment, so no step by step instructions with config example.
you have to work around the lack of smtp auth login support of go. There are now 2 possibilities: the smtp server does not need any authentication support, or it offers one of the other methods supported by go/shoutrrr.
So let's assume that our exchange requires mandatory authentication, in which case we use a postifx that can do AUTH Plain, for example. This MTA accepts the mail from shoutrrrr and then forwards it to the exchange server. There it authenticates itself with AUTH LOGIN.
For the lazy among us, there are ready-made docker images that can help us with this (use at your own risk), e.g. wader/postfix-relay: Postfix SMTP relay docker image (github.com)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Service: SMTP Related to the SMTP service Status: Available Type: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants