diff --git a/postfix/COMPATIBILITY b/postfix/COMPATIBILITY index 354931975..b48862241 100644 --- a/postfix/COMPATIBILITY +++ b/postfix/COMPATIBILITY @@ -14,7 +14,7 @@ db tables yes (compile time option) dbm tables yes (compile time option) delivered-to yes (configurable with prepend_delivered_header) dsn almost (supports enhanced status codes and DSN format bounces) -errors-to: yes (disabled by default since Postfix 2.1) +errors-to: no (removed with Postfix 2.2) esmtp yes etrn support yes (per-destination log for authorized destinations only) fcntl locking yes (runtime configurable) diff --git a/postfix/HISTORY b/postfix/HISTORY index 729de2949..65058fc00 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -10747,8 +10747,23 @@ Apologies for any names omitted. error mailer information is used for senders or recipients. Files: smtpd/smtpd_check.c, smtpd/smtpd_dsn_fix.[hc]. +20050512 + + Feature: support for more SASL logging call-backs, if these + are defined in the compile-time environment. Files: + smtpd/smtpd_sasl_glue.c, smtp/smtp_sasl_glue.c. + +20050513 + + Workaround: Postfix now uses "localdomain" as the default + domain name when $myhostname is not in "host.domain" form. + Files: global/mail_params.[hc]. + Open problems: + Feature: need "soft-bounce before fall-back relay" for + SOHO type operations. + Med: disable header address rewriting after XCLIENT? Introduce a better concept of original submission? diff --git a/postfix/html/error.8.html b/postfix/html/error.8.html index ab31a7d5a..c70ff5f01 100644 --- a/postfix/html/error.8.html +++ b/postfix/html/error.8.html @@ -37,7 +37,7 @@ ERROR(8) ERROR(8) privilege. STANDARDS - None. + RFC 3463 (Enhanced Status Codes) DIAGNOSTICS Problems and transactions are logged to syslogd(8). diff --git a/postfix/man/man8/error.8 b/postfix/man/man8/error.8 index 6f10a5007..62804888a 100644 --- a/postfix/man/man8/error.8 +++ b/postfix/man/man8/error.8 @@ -39,7 +39,7 @@ to the network, and can be run chrooted at fixed low privilege. .SH "STANDARDS" .na .nf -None. +RFC 3463 (Enhanced Status Codes) .SH DIAGNOSTICS .ad .fi diff --git a/postfix/src/cleanup/cleanup_api.c b/postfix/src/cleanup/cleanup_api.c index 050cd57b7..ce7c1db61 100644 --- a/postfix/src/cleanup/cleanup_api.c +++ b/postfix/src/cleanup/cleanup_api.c @@ -218,6 +218,8 @@ int cleanup_flush(CLEANUP_STATE *state) */ if (state->errs == 0 && (state->flags & CLEANUP_FLAG_DISCARD) == 0) { if ((state->flags & CLEANUP_FLAG_HOLD) != 0) { + myfree(state->queue_name); + state->queue_name = MAIL_QUEUE_HOLD; mail_stream_ctl(state->handle, MAIL_STREAM_CTL_QUEUE, MAIL_QUEUE_HOLD, MAIL_STREAM_CTL_CLASS, 0, diff --git a/postfix/src/error/error.c b/postfix/src/error/error.c index 9fc83cc14..386433f2a 100644 --- a/postfix/src/error/error.c +++ b/postfix/src/error/error.c @@ -29,7 +29,7 @@ /* The \fBerror\fR(8) mailer is not security-sensitive. It does not talk /* to the network, and can be run chrooted at fixed low privilege. /* STANDARDS -/* None. +/* RFC 3463 (Enhanced Status Codes) /* DIAGNOSTICS /* Problems and transactions are logged to \fBsyslogd\fR(8). /* diff --git a/postfix/src/global/mail_params.c b/postfix/src/global/mail_params.c index a43d5715c..5d2b92118 100644 --- a/postfix/src/global/mail_params.c +++ b/postfix/src/global/mail_params.c @@ -310,16 +310,13 @@ static const char *check_myhostname(void) /* * If the local machine name is not in FQDN form, try to append the - * contents of $mydomain. + * contents of $mydomain. Use a default domain as a final workaround. */ name = get_hostname(); if ((dot = strchr(name, '.')) == 0) { if ((domain = mail_conf_lookup_eval(VAR_MYDOMAIN)) == 0) - msg_warn("My hostname %s is not a fully qualified name - set %s or %s in %s/%s", - name, VAR_MYHOSTNAME, VAR_MYDOMAIN, - var_config_dir, MAIN_CONF_FILE); - else - name = concatenate(name, ".", domain, (char *) 0); + domain = DEF_MYDOMAIN; + name = concatenate(name, ".", domain, (char *) 0); } return (name); } @@ -331,11 +328,10 @@ static const char *check_mydomainname(void) char *dot; /* - * Use the hostname when it is not a FQDN ("foo"), or when the hostname - * actually is a domain name ("foo.com"). + * Use a default domain when the hostname is not a FQDN ("foo"). */ - if ((dot = strchr(var_myhostname, '.')) == 0 || strchr(dot + 1, '.') == 0) - return (var_myhostname); + if ((dot = strchr(var_myhostname, '.')) == 0) + return (DEF_MYDOMAIN); return (dot + 1); } diff --git a/postfix/src/global/mail_params.h b/postfix/src/global/mail_params.h index 9cd1a9900..fb59e3d16 100644 --- a/postfix/src/global/mail_params.h +++ b/postfix/src/global/mail_params.h @@ -114,6 +114,7 @@ extern char *var_mydest; extern char *var_myhostname; #define VAR_MYDOMAIN "mydomain" /* my domain name */ +#define DEF_MYDOMAIN "localdomain" extern char *var_mydomain; /* diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 94daaa2bc..9c4606d4d 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -20,7 +20,7 @@ * Patches change the patchlevel and the release date. Snapshots change the * release date only. */ -#define MAIL_RELEASE_DATE "20050510" +#define MAIL_RELEASE_DATE "20050517" #define MAIL_VERSION_NUMBER "2.3" #define VAR_MAIL_VERSION "mail_version" diff --git a/postfix/src/smtp/smtp_sasl_glue.c b/postfix/src/smtp/smtp_sasl_glue.c index ca9b6203b..a34b3842f 100644 --- a/postfix/src/smtp/smtp_sasl_glue.c +++ b/postfix/src/smtp/smtp_sasl_glue.c @@ -201,17 +201,36 @@ static int smtp_sasl_log(void *unused_context, int priority, const char *message) { switch (priority) { - case SASL_LOG_ERR: /* unusual errors */ - case SASL_LOG_WARN: /* non-fatal warnings */ + case SASL_LOG_ERR: /* unusual errors */ + case SASL_LOG_WARN: /* non-fatal warnings */ msg_warn("SASL authentication problem: %s", message); break; case SASL_LOG_NOTE: /* other info */ if (msg_verbose) msg_info("SASL authentication info: %s", message); break; -#if SASL_VERSION_MAJOR >= 2 +#ifdef SASL_LOG_FAIL case SASL_LOG_FAIL: /* authentication failures */ msg_warn("SASL authentication failure: %s", message); + break; +#endif +#ifdef SASL_LOG_DEBUG + case SASL_LOG_DEBUG: + if (msg_verbose > 1) + msg_info("SASL authentication debug: %s", message); + break; +#endif +#ifdef SASL_LOG_TRACE + case SASL_LOG_TRACE: + if (msg_verbose > 1) + msg_info("SASL authentication trace: %s", message); + break; +#endif +#ifdef SASL_LOG_PASS + case SASL_LOG_PASS: + if (msg_verbose > 1) + msg_info("SASL authentication pass: %s", message); + break; #endif } return (SASL_OK); diff --git a/postfix/src/smtpd/smtpd.c b/postfix/src/smtpd/smtpd.c index 93e073425..f96230eba 100644 --- a/postfix/src/smtpd/smtpd.c +++ b/postfix/src/smtpd/smtpd.c @@ -1832,7 +1832,7 @@ static void rcpt_reset(SMTPD_STATE *state) state->rcpt_overshoot = 0; } -/* comment_sanitize - clesn up comment string */ +/* comment_sanitize - clean up comment string */ static void comment_sanitize(VSTRING *comment_string) { diff --git a/postfix/src/smtpd/smtpd_dsn_fix.c b/postfix/src/smtpd/smtpd_dsn_fix.c index 48cb4b4fc..bf37f9c33 100644 --- a/postfix/src/smtpd/smtpd_dsn_fix.c +++ b/postfix/src/smtpd/smtpd_dsn_fix.c @@ -29,7 +29,7 @@ /* same smtpd access map entry or rbl reply template is used /* for both address and non-address information. /* .PP -/* No transformation is done when reporting a non-address DSN +/* A non-address DSN is not transformed /* when reporting sender or recipient address status information, /* as there are many legitimate instances of such usage. /* @@ -96,6 +96,9 @@ const char *smtpd_dsn_fix(const char *status, const char *reply_class) struct dsn_map *dp; const char *result = status; + /* + * Update an address-specific DSN according to what is being rejected. + */ if (ISDIGIT(status[0]) && strncmp(status + 1, ".1.", 3) == 0) { /* @@ -134,7 +137,13 @@ const char *smtpd_dsn_fix(const char *status, const char *reply_class) msg_info("mapping DSN status %s into %s status %c%s", status, reply_class, status[0], result + 1); return (result); - } else { + } + + /* + * Don't update a non-address DSN. There are many legitimate uses for + * these while rejecting address or non-address information. + */ + else { return (status); } } diff --git a/postfix/src/smtpd/smtpd_sasl_glue.c b/postfix/src/smtpd/smtpd_sasl_glue.c index 1869b3c72..cd97b3177 100644 --- a/postfix/src/smtpd/smtpd_sasl_glue.c +++ b/postfix/src/smtpd/smtpd_sasl_glue.c @@ -165,18 +165,36 @@ static int smtpd_sasl_log(void *unused_context, int priority, const char *message) { switch (priority) { - case SASL_LOG_ERR: - case SASL_LOG_WARN: + case SASL_LOG_ERR: + case SASL_LOG_WARN: msg_warn("SASL authentication problem: %s", message); break; case SASL_LOG_NOTE: if (msg_verbose) msg_info("SASL authentication info: %s", message); break; -#if SASL_VERSION_MAJOR >= 2 +#ifdef SASL_LOG_FAIL case SASL_LOG_FAIL: msg_warn("SASL authentication failure: %s", message); break; +#endif +#ifdef SASL_LOG_DEBUG + case SASL_LOG_DEBUG: + if (msg_verbose > 1) + msg_info("SASL authentication debug: %s", message); + break; +#endif +#ifdef SASL_LOG_TRACE + case SASL_LOG_TRACE: + if (msg_verbose > 1) + msg_info("SASL authentication trace: %s", message); + break; +#endif +#ifdef SASL_LOG_PASS + case SASL_LOG_PASS: + if (msg_verbose > 1) + msg_info("SASL authentication pass: %s", message); + break; #endif } return SASL_OK;