Mail server disconnect after some time
Summary
When configuring mail server for notification, after a while, the connection to the server close and the app is unable to send mails
The app open a connexion to the mail too soon and doesn't retry to openit
Steps to reproduce
- Configure mail support
- Wait a long time
- Try to generate a mail by modifying an Incident/Maintenance
What is the current bug behavior?
The app is unable to send mail because the connection has been closed from the remote server
What is the expected correct behavior?
The app should always be able to send mail
Relevant logs and/or screenshots
Environment info
Current develop
branch 57c34782
Possible fixes
Open connection to the mail server only just before sending a mail. Also don't forget to close it.
Relevant files : https://gitlab.com/prod-manager/prod-manager/-/blob/develop/ProdManager/helpers/mail.py
Related : #44 (closed) and !16 (merged)