sitcomlab / Ethics-app

Ethics-application for the approval of user-studies
http://giv-ethics-app.uni-muenster.de
MIT License
2 stars 8 forks source link

Incorrect error detection in SMTP connection #56

Open SpeckiJ opened 4 years ago

SpeckiJ commented 4 years ago

When sending an Email fails. e.g. due to issues with the credentials, a callback(err) is invoced instead of a correct callback(err, 500). Additionally it seems like err.message is not set by the transport library, instead an additional info object is provided.

https://github.com/sitcomlab/Ethics-app/blob/de7f31ec74339874ed51305b9da7dcd61b0ee07f/controllers/documents/post.js#L238

This issue can happen because depending on the SMTP configuration, the verify function https://github.com/sitcomlab/Ethics-app/blob/de7f31ec74339874ed51305b9da7dcd61b0ee07f/server.js#L61 might succeed even though sending emails will be rejected later on.