Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Delete received outgoing messages from SMTP queue (#5115)
Some SMTP servers are running slow before-queue filters, most commonly Postfix with `rspamd` filter which is implemented as a [before-queue Milter](https://www.postfix.org/MILTER_README.html). Some of `rspamd` plugin filters are slow on large mails. We previously had problems with timing out during waiting for SMTP response: #1383. This is largely fixed by async-email/async-smtp#29 and currently we have 60-second timeout just for reading a response but apparently it is not sufficient -- maybe connection gets killed by NAT while we are waiting for response or `rspamd` takes more than 60 seconds for large messages. As a result a message is resent multiple times and eventually fails with "too many retries" while multiple BCC-self messages are received. We should remove the message from the SMTP queue as soon as we receive it via IMAP as it is clear the message was sent even if we did not manage to get actual SMTP server response.
- Loading branch information