Skip to content

Instantly share code, notes, and snippets.

@peelman
Last active August 25, 2024 22:00
Show Gist options
  • Save peelman/614d881d3063bdedd7d8494b6cdf05f8 to your computer and use it in GitHub Desktop.
Save peelman/614d881d3063bdedd7d8494b6cdf05f8 to your computer and use it in GitHub Desktop.
SMTP Error Code as YAML
# translate a note for dns if it exists
if [postfix_dsn] {
translate {
source => "postfix_dsn"
target => "postfix_dsn_description"
dictionary => {
"2.0.0" => "Success"
"2.1.5" => "Success - Filtered to folder"
"2.6.0" => "Success - Message queued for delivery"
"4.0.0" => "Unknown Failure (will retry)"
"4.1.0" => "To Address failure (will retry)"
"4.1.1" => "To Address does not exist (will retry)"
"4.2.1" => "To Address disabled; delivery rejected (will retry)"
"4.2.2" => "To Address mailbox full; delivery rejected (will retry)"
"4.3.4" => "Message too big; delivery rejected by mail system (will retry)"
"4.4.1" => "No answer from host or connection lost (will retry)"
"4.4.2" => "Bad connection with host (will retry)"
"4.4.5" => "Destination system congested (will retry)"
"4.4.7" => "Delivery time expired (will retry)"
"4.5.3" => "Too many recipients (will retry)"
"4.7.0" => "Other or undefined security status (will retry)"
"4.7.1" => "Delivery not authorized, message refused (will retry)"
"4.7.2" => "Mailing list expansion prohibited (will retry)"
"4.7.3" => "Security conversion required but not possible (will retry)"
"4.7.4" => "Security features not supported (will retry)"
"4.7.5" => "Cryptographic failure (will retry)"
"4.7.6" => "Cryptographic algorithm not supported (will retry)"
"4.7.7" => "Message integrity failure (will retry)"
"4.7.8" => "Authentication credentials invalid (will retry)"
"4.7.9" => "Authentication mechanism is too weak (will retry)"
"4.7.10" => "Encryption Needed (will retry)"
"4.7.11" => "Encryption required for requested authentication mechanism (will retry)"
"4.7.12" => "A password transition is needed (will retry)"
"4.7.13" => "User Account Disabled (will retry)"
"4.7.14" => "Trust relationship required (will retry)"
"4.7.15" => "Priority Level is too low (will retry)"
"4.7.16" => "Message is too big for the specified priority (will retry)"
"4.7.17" => "Mailbox owner has changed (will retry)"
"4.7.18" => "Domain owner has changed (will retry)"
"4.7.19" => "RRVS test cannot be completed (will retry)"
"4.7.20" => "No passing DKIM signature found (will retry)"
"4.7.21" => "No acceptable DKIM signature found (will retry)"
"4.7.22" => "No valid author-matched DKIM signature found (will retry)"
"4.7.23" => "SPF validation failed (will retry)"
"4.7.24" => "SPF validation error (will retry)"
"4.7.25" => "Reverse DNS validation failed (will retry)"
"4.7.26" => "Multiple authentication checks failed (will retry)"
"4.7.27" => "Sender address has null MX (will retry)"
"4.7.28" => "Mail flood detected (will retry)"
"4.7.29" => "ARC validation failure (will retry)"
"4.7.30" => "REQUIRETLS support required (will retry)"
"5.0.0" => "Message Rejected (permanent)"
"5.1.0" => "To Address failure (permanent)"
"5.1.1" => "To Address does not exist (permanent)"
"5.2.1" => "To Address disabled; delivery rejected (permanent)"
"5.2.2" => "To Address mailbox full; delivery rejected (permanent)"
"5.3.4" => "Message too big; delivery rejected by mail system (permanent)"
"5.4.1" => "No answer from host or connection lost (permanent)"
"5.4.4" => "Unable to route (permanent)"
"5.4.6" => "Routing loop detected (permanent)"
"5.5.0" => "Other or undefined protocol status (permanent)"
"5.5.1" => "Invalid command (permanent)"
"5.5.2" => "Syntax error (permanent)"
"5.5.3" => "Too many recipients (permanent)"
"5.5.4" => "Invalid command arguments (permanent)"
"5.5.5" => "Wrong protocol version (permanent)"
"5.5.6" => "Authentication Exchange line is too long (permanent)"
"5.7.0" => "Other or undefined security status (permanent)"
"5.7.1" => "Delivery not authorized, message refused (permanent)"
"5.7.2" => "Mailing list expansion prohibited (permanent)"
"5.7.3" => "Security conversion required but not possible (permanent)"
"5.7.4" => "Security features not supported (permanent)"
"5.7.5" => "Cryptographic failure (permanent)"
"5.7.6" => "Cryptographic algorithm not supported (permanent)"
"5.7.7" => "Message integrity failure (permanent)"
"5.7.8" => "Authentication credentials invalid (permanent)"
"5.7.9" => "Authentication mechanism is too weak (permanent)"
"5.7.10" => "Encryption Needed (permanent)"
"5.7.11" => "Encryption required for requested authentication mechanism (permanent)"
"5.7.12" => "A password transition is needed (permanent)"
"5.7.13" => "User Account Disabled (permanent)"
"5.7.14" => "Trust relationship required (permanent)"
"5.7.15" => "Priority Level is too low (permanent)"
"5.7.16" => "Message is too big for the specified priority (permanent)"
"5.7.17" => "Mailbox owner has changed (permanent)"
"5.7.18" => "Domain owner has changed (permanent)"
"5.7.19" => "RRVS test cannot be completed (permanent)"
"5.7.20" => "No passing DKIM signature found (permanent)"
"5.7.21" => "No acceptable DKIM signature found (permanent)"
"5.7.22" => "No valid author-matched DKIM signature found (permanent)"
"5.7.23" => "SPF validation failed (permanent)"
"5.7.24" => "SPF validation error (permanent)"
"5.7.25" => "Reverse DNS validation failed (permanent)"
"5.7.26" => "Multiple authentication checks failed (permanent)"
"5.7.27" => "Sender address has null MX (permanent)"
"5.7.28" => "Mail flood detected (permanent)"
"5.7.29" => "ARC validation failure (permanent)"
"5.7.30" => "REQUIRETLS support required (permanent)"
}
fallback => "Unknown DSN"
}
}

If you're using Logstash to parse log files and break down Postfix logging into consumable data, using whyscream or similar patterns, it can be useful to include a description of what the DSN code actually means.

This is a working list, based off of responses I've seen hit our servers. If you encounter any additional ones you want to see added, please feel free to leave a comment. I used the IANA assignments as the foundation for the messages themselves.

"2.0.0": "Success"
"2.1.5": "Success - Filtered to folder"
"2.6.0": "Success - Message queued for delivery"
"4.0.0": "Unknown Failure (will retry)"
"4.1.0": "To Address failure (will retry)"
"4.1.1": "To Address does not exist (will retry)"
"4.2.1": "To Address disabled; delivery rejected (will retry)"
"4.2.2": "To Address mailbox full; delivery rejected (will retry)"
"4.3.4": "Message too big; delivery rejected by mail system (will retry)"
"4.4.1": "No answer from host or connection lost (will retry)"
"4.4.2": "Bad connection with host (will retry)"
"4.4.5": "Destination system congested (will retry)"
"4.4.7": "Delivery time expired (will retry)"
"4.5.3": "Too many recipients (will retry)"
"4.7.0": "Other or undefined security status (will retry)"
"4.7.1": "Delivery not authorized, message refused (will retry)"
"4.7.2": "Mailing list expansion prohibited (will retry)"
"4.7.3": "Security conversion required but not possible (will retry)"
"4.7.4": "Security features not supported (will retry)"
"4.7.5": "Cryptographic failure (will retry)"
"4.7.6": "Cryptographic algorithm not supported (will retry)"
"4.7.7": "Message integrity failure (will retry)"
"4.7.8": "Authentication credentials invalid (will retry)"
"4.7.9": "Authentication mechanism is too weak (will retry)"
"4.7.10": "Encryption Needed (will retry)"
"4.7.11": "Encryption required for requested authentication mechanism (will retry)"
"4.7.12": "A password transition is needed (will retry)"
"4.7.13": "User Account Disabled (will retry)"
"4.7.14": "Trust relationship required (will retry)"
"4.7.15": "Priority Level is too low (will retry)"
"4.7.16": "Message is too big for the specified priority (will retry)"
"4.7.17": "Mailbox owner has changed (will retry)"
"4.7.18": "Domain owner has changed (will retry)"
"4.7.19": "RRVS test cannot be completed (will retry)"
"4.7.20": "No passing DKIM signature found (will retry)"
"4.7.21": "No acceptable DKIM signature found (will retry)"
"4.7.22": "No valid author-matched DKIM signature found (will retry)"
"4.7.23": "SPF validation failed (will retry)"
"4.7.24": "SPF validation error (will retry)"
"4.7.25": "Reverse DNS validation failed (will retry)"
"4.7.26": "Multiple authentication checks failed (will retry)"
"4.7.27": "Sender address has null MX (will retry)"
"4.7.28": "Mail flood detected (will retry)"
"4.7.29": "ARC validation failure (will retry)"
"4.7.30": "REQUIRETLS support required (will retry)"
"5.0.0": "Message Rejected (permanent)"
"5.1.0": "To Address failure (permanent)"
"5.1.1": "To Address does not exist (permanent)"
"5.2.1": "To Address disabled; delivery rejected (permanent)"
"5.2.2": "To Address mailbox full; delivery rejected (permanent)"
"5.3.4": "Message too big; delivery rejected by mail system (permanent)"
"5.4.1": "No answer from host or connection lost (permanent)"
"5.4.4": "Unable to route (permanent)"
"5.4.6": "Routing loop detected (permanent)"
"5.5.0": "Other or undefined protocol status (permanent)"
"5.5.1": "Invalid command (permanent)"
"5.5.2": "Syntax error (permanent)"
"5.5.3": "Too many recipients (permanent)"
"5.5.4": "Invalid command arguments (permanent)"
"5.5.5": "Wrong protocol version (permanent)"
"5.5.6": "Authentication Exchange line is too long (permanent)"
"5.7.0": "Other or undefined security status (permanent)"
"5.7.1": "Delivery not authorized, message refused (permanent)"
"5.7.2": "Mailing list expansion prohibited (permanent)"
"5.7.3": "Security conversion required but not possible (permanent)"
"5.7.4": "Security features not supported (permanent)"
"5.7.5": "Cryptographic failure (permanent)"
"5.7.6": "Cryptographic algorithm not supported (permanent)"
"5.7.7": "Message integrity failure (permanent)"
"5.7.8": "Authentication credentials invalid (permanent)"
"5.7.9": "Authentication mechanism is too weak (permanent)"
"5.7.10": "Encryption Needed (permanent)"
"5.7.11": "Encryption required for requested authentication mechanism (permanent)"
"5.7.12": "A password transition is needed (permanent)"
"5.7.13": "User Account Disabled (permanent)"
"5.7.14": "Trust relationship required (permanent)"
"5.7.15": "Priority Level is too low (permanent)"
"5.7.16": "Message is too big for the specified priority (permanent)"
"5.7.17": "Mailbox owner has changed (permanent)"
"5.7.18": "Domain owner has changed (permanent)"
"5.7.19": "RRVS test cannot be completed (permanent)"
"5.7.20": "No passing DKIM signature found (permanent)"
"5.7.21": "No acceptable DKIM signature found (permanent)"
"5.7.22": "No valid author-matched DKIM signature found (permanent)"
"5.7.23": "SPF validation failed (permanent)"
"5.7.24": "SPF validation error (permanent)"
"5.7.25": "Reverse DNS validation failed (permanent)"
"5.7.26": "Multiple authentication checks failed (permanent)"
"5.7.27": "Sender address has null MX (permanent)"
"5.7.28": "Mail flood detected (permanent)"
"5.7.29": "ARC validation failure (permanent)"
"5.7.30": "REQUIRETLS support required (permanent)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment