Qpsmtpd::DSN(3pm)

โœจ Qpsmtpd::DSN โ€” Enhanced Mail System Status Codes, RFC 1893 โœจ

okay bestie, this is the Qpsmtpd::DSN page from the User Contributed Perl Documentation (that's the 3pm vibe, iykyk) ๐Ÿ’–


๐ŸŒธ DESCRIPTION ๐ŸŒธ

So basically? Qpsmtpd::DSN implements the Enhanced Mail System Status Codes from RFC 1893. That's it, that's the whole concept, and honestly? iconic of it. ๐Ÿ’…


๐ŸŽ€ USAGE ๐ŸŽ€

Every single qpsmtpd plugin can get at these status codes, no gatekeeping here. All the sub routines are called the exact same way, so once you know the pattern you know everything:

use Qpsmtpd::DSN;
...;
return Qpsmtpd::DSN->relaying_denied();

or

return Qpsmtpd::DSN->relaying_denied("Relaying from $ip denied");

or

return Qpsmtpd::DSN->relaying_denied(DENY,"Relaying from $ip denied");

Here's the tea on how arguments work โ˜•:

  • If you don't hand it a status message, it just uses the predefined one from the RFC. Low maintenance queen.
  • If the first argument is numeric, that number gets used as the return code.
  • If it isn't, the default return code is used instead.

Not sure which default return code goes with which function? It's all spelled out below, don't worry ๐Ÿซถ

So for the examples up top: the first one returns (DENY, "Relaying denied"). The other two return (DENY, "Relaying from $ip denied"). Either way that's what gets handed back to qpsmtpd. โœจ

Also! For all those sub routines that don't start with addr_, sys_, net_, proto_, media_, or sec_, I've added a default message that describes the status better than the plain RFC message does. You're welcome ๐Ÿ’–


๐Ÿ“ฌ ADDRESS STATUS ๐Ÿ“ฌ

  • addr_unspecified โ€” X.1.0, default: DENYSOFT
  • no_such_user, addr_bad_dest_mbox โ€” X.1.1, default: DENY
  • addr_bad_dest_system โ€” X.1.2, default: DENY
  • addr_bad_dest_syntax โ€” X.1.3, default: DENY
  • addr_dest_ambigous โ€” X.1.4, default: DENYSOFT
  • addr_rcpt_ok โ€” X.1.5, default: OK
  • addr_mbox_moved โ€” X.1.6, default: DENY
  • addr_bad_from_syntax โ€” X.1.7, default: DENY
  • addr_bad_from_system โ€” X.1.8, default: DENY

๐Ÿ“ฅ MAILBOX STATUS ๐Ÿ“ฅ

  • mbox_unspecified โ€” X.2.0, default: DENYSOFT
  • mbox_disabled โ€” X.2.1, default: DENY โ€ฆ but the RFC says:
The mailbox exists, but is not accepting messages. This may be a permanent error if the mailbox will never be re-enabled or a transient error if the mailbox is only temporarily disabled.
  • mbox_full โ€” X.2.2, default: DENYSOFT
  • mbox_msg_too_long โ€” X.2.3, default: DENY
  • mbox_list_expansion_problem โ€” X.2.4, default: DENYSOFT

๐Ÿ–ฅ๏ธ MAIL SYSTEM STATUS ๐Ÿ–ฅ๏ธ

  • sys_unspecified โ€” X.3.0, default: DENYSOFT
  • sys_disk_full โ€” X.3.1, default: DENYSOFT
  • sys_not_accepting_mail โ€” X.3.2, default: DENYSOFT
  • sys_not_supported โ€” X.3.3, default: DENYSOFT
Selected features specified for the message are not supported by the destination system. This can occur in gateways when features from one domain cannot be mapped onto the supported feature in another.
  • sys_msg_too_big โ€” X.3.4, default DENY

๐ŸŒ NETWORK AND ROUTING STATUS ๐ŸŒ

  • net_unspecified โ€” X.4.0, default: DENYSOFT
  • net_directory_server_failed, temp_resolver_failed โ€” X.4.3, default: DENYSOFT
  • net_system_congested โ€” X.4.5, default: DENYSOFT
  • net_routing_loop, too_many_hops โ€” X.4.6, default: DENY, but the RFC says:
A routing loop caused the message to be forwarded too many times, either because of incorrect routing tables or a user forwarding loop. This is useful only as a persistent transient error.

and likeโ€ฆ why would we want to DENYSOFT something like this?? ๐Ÿ˜ญ genuinely asking.


๐Ÿ“ฎ MAIL DELIVERY PROTOCOL STATUS ๐Ÿ“ฎ

  • proto_unspecified โ€” X.5.0, default: DENYSOFT
  • proto_invalid_command โ€” X.5.1, default: DENY
  • proto_syntax_error โ€” X.5.2, default: DENY
  • proto_rcpt_list_too_long, too_many_rcpts โ€” X.5.3, default: DENYSOFT
  • proto_invalid_cmd_args โ€” X.5.4, default: DENY
  • proto_wrong_version โ€” X.5.5, default: DENYSOFT

๐ŸŽจ MESSAGE CONTENT OR MESSAGE MEDIA STATUS ๐ŸŽจ

  • media_unspecified โ€” X.6.0, default: DENYSOFT
  • media_unsupported โ€” X.6.1, default: DENY
  • media_conv_prohibited โ€” X.6.2, default: DENY
  • media_conv_unsupported โ€” X.6.3, default: DENYSOFT
  • media_conv_lossy โ€” X.6.4, default: DENYSOFT

๐Ÿ”’ SECURITY OR POLICY STATUS ๐Ÿ”’

  • sec_unspecified โ€” X.7.0, default: DENYSOFT
  • sec_sender_unauthorized, bad_sender_ip, relaying_denied โ€” X.7.1, default: DENY
  • sec_list_dest_prohibited โ€” X.7.2, default: DENY
  • sec_conv_failed โ€” X.7.3, default: DENY
  • sec_feature_unsupported โ€” X.7.4, default: DENY
  • sec_crypto_failure โ€” X.7.5, default: DENY
  • sec_crypto_algorithm_unsupported โ€” X.7.6, default: DENYSOFT
  • sec_msg_integrity_failure โ€” X.7.7, default: DENY

and that's the whole page bestie, we ate and left no crumbs ๐Ÿ’…โœจ this one's from perl v5.40.1, dated 2025-03-21 โ€” mwah, ily, go return some status codes ๐Ÿซถ๐Ÿ’–

๐Ÿ“ฆ where this page comes from