Sometimes, during mail delivery in QueueProcessorThread, SMTP server rejects mail because of bad recipient. For example, it can happen if recipient looks like local one (without @ in email), so SMTP server will not put incoming email to its queue and will reject it during SMTP conversation. This condition is detected by smtplib and smtplib.SMTPRecipientsRefused will be raised.
Unfortunately, zope.sendmail.queue.QueueProcessorThread does not handle this type of exception and delivery will be reattempted after 3 hours. This cycle repeats forever, which is undesirable.
The attached patch will treat SMTPRecipientsRefused as permanent failure and remove email from mailbox, so its delivery will be stopped.