/*++ /* NAME /* smtpd_dsn_fix 3 /* SUMMARY /* fix DSN status /* SYNOPSIS /* #include <smtpd_dsn_fix.h> /* /* const char *smtpd_dsn_fix(status, reply_class) /* const char *status; /* const char *reply_class; /* DESCRIPTION /* smtpd_dsn_fix() transforms DSN status codes according to the /* status information that is actually being reported. The /* following transformations are implemented: /* .IP \(bu /* Transform a recipient address DSN into a sender address DSN /* when reporting sender address status information, and vice /* versa. This transformation may be needed because some Postfix /* access control features don't know whether the address being /* rejected is a sender or recipient. Examples are smtpd access /* tables, rbl reply templates, and the error mailer. /* .IP \(bu /* Transform a sender or recipient address DSN into a non-address /* DSN when reporting non-address status information. For /* example, if something rejects HELO with DSN status 4.1.1 /* (unknown recipient address), then we send the more neutral /* 4.0.0 DSN instead. This transformation is needed when the /* same smtpd access map entry or rbl reply template is used /* for both address and non-address information. /* .PP /* A non-address DSN is not transformed /* when reporting sender or recipient address status information, /* as there are many legitimate instances of such usage. /* /* It is left up to the caller to update the initial DSN digit /* appropriately; in Postfix this is done as late as possible, /* because hard rejects may be changed into soft rejects for /* all kinds of reasons. /* /* Arguments: /* .IP status /* A DSN status as per RFC 3463. /* .IP reply_class /* SMTPD_NAME_SENDER, SMTPD_NAME_RECIPIENT or some other /* null-terminated string. /* LICENSE /* .ad /* .fi /* The Secure Mailer license must be distributed with this software. /* AUTHOR(S) /* Wietse Venema /* IBM T.J. Watson Research /* P.O. Box 704 /* Yorktown Heights, NY 10598, USA
/*--*/ /* System library. */
/* *FixrecipientaddressDSNwhilerejectingasenderaddress.Don't *letfuturerecipient-specificDSNcodesslippastus.
*/ if (strcmp(reply_class, SMTPD_NAME_SENDER) == 0) { for (dp = dsn_map; dp->micro_code != 0; dp++) if (strcmp(status + 4, dp->micro_code) == 0) break;
result = dp->sender_dsn;
}
/* *FixsenderaddressDSNwhilerejectingarecipientaddress.Don't *letfuturesender-specificDSNcodesslippastus.
*/ elseif (strcmp(reply_class, SMTPD_NAME_RECIPIENT) == 0) { for (dp = dsn_map; dp->micro_code != 0; dp++) if (strcmp(status + 4, dp->micro_code) == 0) break;
result = dp->rcpt_dsn;
}
/* *Fixaddress-specificDSNwhilerejectinganon-address.
*/ else {
result = "4.0.0";
}
/* *Givethemaclueofwhatisgoingon.
*/ if (strcmp(status + 2, result + 2) != 0)
msg_info("mapping DSN status %s into %s status %c%s",
status, reply_class, status[0], result + 1); return (result);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.