mailcow / mailcow-dockerized

mailcow: dockerized - 🐮 + 🐋 = 💕
https://mailcow.email
GNU General Public License v3.0
8.98k stars 1.18k forks source link

Error handling for SMTP errors #3860

Open XVII opened 4 years ago

XVII commented 4 years ago

Summary

When receiving error responses from other transport agents or delivery agents, they don't seem to be marked as anything more than an "info" log.

I'd like to manage and re-queue these as needed, but they no longer exist in Queue Manager.

Some Examples

relay=hotmail-com.olc.protection.outlook.com[104.47.8.33]:25, delay=2.5, delays=0.12/0.03/2.1/0.25, dsn=5.7.1, status=bounced (host hotmail-com.olc.protection.outlook.com[104.47.8.33] said: 550 5.7.1

relay=mail.protection.outlook.com[104.47.71.138]:25, delay=0.96, delays=0.02/0.02/0.76/0.16, dsn=5.4.1, status=bounced (host mail.protection.outlook.com[104.47.71.138] said: 550 5.4.1 Recipient address rejected: Access denied. AS(201806281) (in reply to RCPT TO command))

E927D830AB: relay=smtp.office365.com[52.98.3.178]:25, delay=1.1, delays=0.13/0.02/0.56/0.37, dsn=5.2.0, status=bounced (host smtp.office365.com[52.98.3.178] said: 554 5.2.0 STOREDRV.Submission.Exception:SendAsDeniedException.MapiExceptionSendAsDenied; Failed to process message due to a permanent exception with message Cannot submit message.

Motivation

An extension to Queue Manager that helps diagnose SMTP failures.

Additional context

We use mailcow for an application service, so we'd like to surface SMTP errors centrally for remediation.

Thanks for all your effort #teammailcow 🐮🤠❤

VermiumSifell commented 1 year ago

This seems quite easy to fix @DerLinkman