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

Silent failure on misspelled options #199

Closed
inimino opened this issue Jul 21, 2017 · 3 comments
Closed

Silent failure on misspelled options #199

inimino opened this issue Jul 21, 2017 · 3 comments

Comments

@inimino
Copy link

inimino commented Jul 21, 2017

I hesitate to admit how many hours this cost me...

How quickly can you spot the problem here?

emailjs.server.connect(
  {"username":"<redacted>"
  ,"password":"<redacted>"
  ,"tls":true
  ,"host":"<redacted>"
  ,"port":587
  });

Finally after sifting through log files on my mail server I found that the SMTP authentication just isn't happening at all. The "username" option does not exist, it should be "user".

So, my strong suggestion would be to whitelist the options and throw an exception if there are any unrecognized properties on the options object.

Would be happy to submit a PR for this...

@eleith
Copy link
Owner

eleith commented Jul 21, 2017

that is a great UX suggestion. pull requests are welcome.

@maotora
Copy link

maotora commented Dec 21, 2017

I also never got any emails until I understood my mixed options.

Please, some error/failure message will be helpful.

@zackschuster
Copy link
Collaborator

as of 2ce27a2 the constructor will error if it receives a password but no user. closing this as i think that resolves things, but feel free to re-open if you have any concerns :)

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

No branches or pull requests

4 participants