Description
When the prepared mail fails to be saved on disk, we still add a status entry in the DB with the cause of the problem. This is good. However when the wiki restarts, we get all the failing statuses and try to resent the mails, and when messages couldn't be saved on this, we get a resend error of course.
Example:
2020-01-17 14:27:24,810 [XWiki initialization] WARN o.x.m.i.DatabaseMailResender - Failed to resend mail message for batchId [1a577252-32f7-4711-899b-08d95e1559c4], messageId [ZU2Ve8PfvFn5x15ePxp0BM+cB9w=]. Root cause [FileNotFoundException: /var/lib/xwiki/data/mails/1a577252-32f7-4711-899b-08d95e1559c4/ZU2Ve8PfvFn5x15ePxp0BM%2BcB9w%3D (No such file or directory)]