Message might stuck in the outbox with an smtp error.
Steps to reproduce
https://github.com/nextcloud/mail/blob/98804d97d11c2d566d506575edce9917a6b09af1/lib/Service/MailTransmission.php#L147-L152
https://github.com/nextcloud/mail/blob/98804d97d11c2d566d506575edce9917a6b09af1/lib/Send/Chain.php#L41-L48
- The log statement in MailTransmission lacks any context and is therefore hard to match to an actual message / account.
- The chain is called over and over again for messages in the outbox and will pollute the log file without providing any useful information.
Expected behavior
- Log the problem with context
- Don't log the same error over and over again
This phenomenon is causing us a lot of trouble. We are a school and our teachers frequently send emails to contact groups (e.g., parents of a class, colleagues, etc.). As an administrator, I always see the message repeating every 10 minutes in the nextcloud.log. Then I have to write to the user to inform them that there is an email stuck in their outbox, which often cannot even be opened. I can then delete it from the database. It took me months to figure out what was going on. An experienced colleague wanted to forward an email to someone, and it got stuck. He then forwarded it in Outlook: The email provider (SMTP) did not want to accept the email because it thought it was spam. This was displayed in Outlook. The mail app should also pass on error messages from SMTP (if necessary by email or at least in the log file) and not just leave the email silently in the outbox. It's just very annoying when emails are not sent without comment.
In my case, this was caused by me changing the password of the sender address in my email server, and not updating Nextcloud configuration as well. Re-setting the password in the Mailer app UI fixed the issue.
That's right, we had that issue with the password in one case. However, in that case, the message in the nextcloud.log is clear.