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

dex-worker: Log warning or fatal exit if -email-from is not set #389

Closed
jonnenauha opened this issue Mar 29, 2016 · 4 comments
Closed

dex-worker: Log warning or fatal exit if -email-from is not set #389

jonnenauha opened this issue Mar 29, 2016 · 4 comments

Comments

@jonnenauha
Copy link

I just spent a good amount of time figuring out why emails are not firing. I recently migrated from 0.1 or something to 0.3 which was painless. I dont think this -email-from was needed in 0.1, don't know when it was introduced. It was then reported to me that the email verification etc. emails were not working.

Anyhow, seemingly no emails are sent if this cmd line flag is not set, even if you specify a valid email config file. I assumed it would be enough as the username is the same as the email address, but I suppose this cant be assumed with all smtp servers (?!).

No warnings during startup. I tried the reset password functionality that is when I saw

ERROR: error sending password reset email gomail: could not send email 1: mail: no address:

Not sure where this is coming from but started looking at the cmd line params after that and once -email-from was set it started working.

Either fatal exit the app or print a warning/error to log if a valid (non fake type) emailer config is provided but the -email-from is not defined.

The cmd line -h documentation should probably also mention its mandatory if you want emails to work.

@jonnenauha
Copy link
Author

Better yet make this a line in the emailer config `"from": "your.mail@domain.com"`` (put something in the example so its clear you need to fill it). Remove the cmdline option and fatal out if "from" is empty.

@jonnenauha jonnenauha changed the title Log warning or fatal exit if -email-from is not set dex-worker: Log warning or fatal exit if -email-from is not set Mar 29, 2016
@ericchiang
Copy link
Contributor

Better yet make this a line in the emailer config "from": "your.mail@domain.com"` (put something in the example so its clear you need to fill it). Remove the cmdline option and fatal out if "from" is empty.

Yes let's do this. It's really weird to have some configuration in the command line flags and others from the config file.

Is there a reasonable value we could default to? What were emails as being sent before this change?

@jonnenauha
Copy link
Author

Good question, I don't recall what the sender was with 0.1.

As I'm using gmail, I would assume that the from field is not mandatory and google will figure it out if sent as blank? Not sure if you can make this generalization for all smtp services? If the golang email library needs the field to be filled, that's another story then.

@ericchiang
Copy link
Contributor

cc @xaka

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants