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

[mail] Ensure SMTP thing status reflects connection status #17817

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

clinique
Copy link
Contributor

@clinique clinique commented Nov 28, 2024

Split session initialization from mail sending

Resolves #17337

@clinique clinique added the enhancement An enhancement or new feature for an existing add-on label Nov 28, 2024
@clinique clinique self-assigned this Nov 28, 2024
@clinique clinique requested a review from J-N-K as a code owner November 28, 2024 13:39
Signed-off-by: Gaël L'hopital <[email protected]>
Signed-off-by: Gaël L'hopital <[email protected]>
Signed-off-by: Gaël L'hopital <[email protected]>
/**
* use this server to send a mail
*
* @param mail the Email that needs to be sent
* @return true if successful, false if failed
*/
public boolean sendMail(Email mail) {
Session localSession = session;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you do it like this a single failed login (or connection problem) during initialization leads to an "forever unable to send mail" state. I don't think that's really a good idea.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@J-N-K : you're correct. Changed.

…to open the connection if it was not opened.

Signed-off-by: Gaël L'hopital <[email protected]>
@clinique clinique changed the title [mail] Ensure SMTP thing status reflects connection capability [mail] Ensure SMTP thing status reflects connection status Nov 29, 2024
Signed-off-by: Gaël L'hopital <[email protected]>
@jlaur
Copy link
Contributor

jlaur commented Nov 29, 2024

Resolves issue #17337

@clinique - please see #12972 (comment). 🙂 This will ensure that the issue gets linked and closed upon completing the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[mail] SMTP thing status not reliable
3 participants