From: Wietse Venema Date: Thu, 26 Apr 2001 05:00:00 +0000 (-0500) Subject: snapshot-20010426 X-Git-Tag: v1.1.0~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63c4531e250cf1480a3cb2b1b833179794ba3c38;p=thirdparty%2Fpostfix.git snapshot-20010426 --- diff --git a/postfix/HISTORY b/postfix/HISTORY index b9fd3d3e9..b0630872e 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -5074,6 +5074,12 @@ Apologies for any names omitted. postalias/postalias.c. Bugfix: with a non-default inet_interfaces setting, the - master daemon ignored host information in explicit host:port - settings in master.cf. Fix by Jun-ichiro itojun Hagino @ - iijlab.net. Files: master/master.h, master/master_ent.c. + master ignored host information in master.cf host:port + settings. Fix by Jun-ichiro itojun Hagino @ iijlab.net. + Files: master/master.h, master/master_ent.c. + +20010426 + + Workaround: the SMTP server did not really parse invalid + addresses such as > well. I + thought this was taken care of years ago. File: smtpd/smtpd.c. diff --git a/postfix/INSTALL b/postfix/INSTALL index f75095ad6..4cf914fe8 100644 --- a/postfix/INSTALL +++ b/postfix/INSTALL @@ -208,6 +208,10 @@ In order to install or upgrade Postfix: # make install (interactive version, first time install) # make install &2 + echo file from a previous Postfix installation. 1>&2 + echo 1>&2 + echo Use interactive installation instead. 1>&2 + exit 1 + } +} # Override default settings. diff --git a/postfix/conf/main.cf b/postfix/conf/main.cf index fb75a55a2..034060318 100644 --- a/postfix/conf/main.cf +++ b/postfix/conf/main.cf @@ -374,6 +374,8 @@ mail_owner = postfix # localpart), $recipient_delimiter. Specify ${name?value} or # ${name:value} to expand value only when $name does (does not) exist. # +# luser_relay works only for the default Postfix local delivery agent. +# # luser_relay = $user@other.host # luser_relay = $local@other.host # luser_relay = admin+$local diff --git a/postfix/conf/master.cf b/postfix/conf/master.cf index e00d7c683..7f3f3038a 100644 --- a/postfix/conf/master.cf +++ b/postfix/conf/master.cf @@ -37,6 +37,7 @@ # Max procs: the maximum number of processes that may execute this # service simultaneously. Default is to use a globally configurable # limit (the default_process_limit configuration parameter in main.cf). +# Specify 0 for no process count limit. # # Command + args: the command to be executed. The command name is # relative to the Postfix program directory (pathname is controlled by diff --git a/postfix/conf/sample-local.cf b/postfix/conf/sample-local.cf index 285ac2448..eab49fd87 100644 --- a/postfix/conf/sample-local.cf +++ b/postfix/conf/sample-local.cf @@ -125,6 +125,8 @@ home_mailbox = # localpart), $recipient_delimiter. Specify ${name?value} or # ${name:value} to expand value only when $name does (does not) exist. # +# luser_relay works only for the default Postfix local delivery agent. +# # luser_relay = $user@other.host # luser_relay = $local@other.host # luser_relay = admin+$local diff --git a/postfix/html/faq.html b/postfix/html/faq.html index 6c0b216b0..892e997fe 100644 --- a/postfix/html/faq.html +++ b/postfix/html/faq.html @@ -90,6 +90,10 @@ virtual domains fails with "mail loops back to myself"
  • Postfix refuses mail for virtual domains with "relay access denied" + +
  • Mail delivery fails with: "unknown +mail transport error" +

    @@ -205,6 +209,9 @@ domains with "relay access denied"

  • What does "fatal: unknown service: smtp/tcp" mean? +
  • Mail delivery fails with: "unknown +mail transport error" +

    Local (non-virtual) delivery

    @@ -237,6 +244,9 @@ distribution list
  • What does "fatal: open database /etc/aliases.db" mean? +
  • Mail delivery fails with: "unknown +mail transport error" +

    Mailing lists

    @@ -946,14 +956,74 @@ delivery agent deals with undeliverable mail.

    What does "fatal: open database /etc/aliases.db" mean?

    -Your aliases database is corrupt or it is missing. Execute the -following command as root: +DB files are maintained by the Berkeley DB library. The above +message means one of the following things: + +

    + +

      + +
    • The existing file does not have the expected file format. +The cause is one of the following: + +

      + +

        + +
      • The file was created by Berkeley DB version 1 and you are using +version 2 or 3 (or vice versa).

        +

      • The file was written in "btree" format and Postfix expects + "hash" format (or vice versa). + +
      + +

      + +To fix the problem for Postfix execute the following command as root: + +

      -    # newaliases
      +    newaliases
       
      +
      + +This creates the aliases.db in the format that Postfix expects. + +

      + +

    • Or the problem could be something completely different. If the +result of running newaliases is a zero-length aliases.db +file, then you probably suffer from the following problem. + +

      + +

        + +
      • Postfix was compiled with #include files for Berkeley DB version +X and was linked against object library files for Berkeley DB +version Y, where X and Y are different versions +of the Berkeley DB library. + +
      + +

      + +The fix for this is to properly install the Berkeley DB library. +For example, RedHat version 7.0 uses the Berkeley DB version 3 +object library by default, but no /usr/include/db.h file is +installed by default. In order to correctly build Postfix you +must install the db3-devel package. + +

      + +On a properly installed system, including the file <db.h> +and linking with -ldb should access files from the same +Berkeley DB library version. + +


    @@ -1881,6 +1951,35 @@ Instructions are given in the source code distribution, in the examples/chroot-setup directory. + +
    + +

    Mail delivery fails with: "unknown +mail transport error"

    + +This is an opportunity to meet your friends egrep and +less. Postfix activity, including progres and failure, is +logged to a logfile, typically named /var/log/maillog. To +find out where Postfix activity is logged on your machine, examine +the /etc/syslog.conf file. + +

    + +To find out the cause for the "unknown mail transport error", type +the following command: + +

    + +egrep '(warning|fatal|panic):' /var/log/maillog | less + +
    + +Pay particular attention to messages that are labeled as fatal +and panic. These describe catastrophic failures that need +to be addressed before Postfix is happy. Problems labeled as +fatal as fixed by adjusting configurations. Problems labeled +as panic are fixed by changing Postfix source code. +

    Root's mail is delivered to nobody

    diff --git a/postfix/makedefs b/postfix/makedefs index 2f110f03f..9623d0410 100644 --- a/postfix/makedefs +++ b/postfix/makedefs @@ -175,6 +175,15 @@ case "$SYSTEM.$RELEASE" in echo "See the RELEASE_NOTES file for more information." 1>&2 exit 1 fi + # See where GDBM's ndbm.h include file sits. XXX verify that + # gdbm links in by default (i.e. NO -lgdbm is needed). + if [ -f /usr/include/gdbm-ndbm.h ] + then + CCARGS="$CCARGS -DHAS_DBM -DPATH_NDBM_H=\\\"\\\"" + elif [ -f /usr/include/gdbm/ndbm.h ] + then + CCARGS="$CCARGS -DHAS_DBM -DPATH_NDBM_H=\\\"\\\"" + fi SYSLIBS="-ldb" for name in nsl resolv do diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 00d908938..0c82392ce 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -15,7 +15,7 @@ * Version of this program. */ #define VAR_MAIL_VERSION "mail_version" -#define DEF_MAIL_VERSION "Snapshot-20010414" +#define DEF_MAIL_VERSION "Snapshot-20010426" extern char *var_mail_version; /* LICENSE diff --git a/postfix/src/local/alias.c b/postfix/src/local/alias.c index 69e0b4e79..2fc36e91d 100644 --- a/postfix/src/local/alias.c +++ b/postfix/src/local/alias.c @@ -135,7 +135,8 @@ int deliver_alias(LOCAL_STATE state, USER_ATTR usr_attr, struct mypasswd *alias_pwd; VSTRING *canon_owner; DICT *dict; - const char *owner_rhs; /* owner alias, RHS */ + const char *owner_rhs; /* owner alias, RHS */ + int alias_count; /* * Make verbose logging easier to understand. @@ -171,7 +172,7 @@ int deliver_alias(LOCAL_STATE state, USER_ATTR usr_attr, if (state.level > 100) { msg_warn("possible alias database loop for %s", name); *statusp = bounce_append(BOUNCE_FLAG_KEEP, BOUNCE_ATTR(state.msg_attr), - "possible alias database loop for %s", name); + "possible alias database loop for %s", name); return (YES); } state.msg_attr.exp_from = name; @@ -271,11 +272,17 @@ int deliver_alias(LOCAL_STATE state, USER_ATTR usr_attr, /* * Deliver. */ + alias_count = 0; *statusp = (dict_errno ? defer_append(BOUNCE_FLAG_KEEP, BOUNCE_ATTR(state.msg_attr), "alias database unavailable") : - deliver_token_string(state, usr_attr, expansion, (int *) 0)); + deliver_token_string(state, usr_attr, expansion, &alias_count)); +#if 0 + if (state.msg_attr.owner == 0 && alias_count > 10) + msg_warn("mailing list \"%s\" needs an \"owner-%s\" alias", + name, name); +#endif myfree(expansion); if (owner) myfree(owner); diff --git a/postfix/src/master/master.c b/postfix/src/master/master.c index c7dead391..4299424f1 100644 --- a/postfix/src/master/master.c +++ b/postfix/src/master/master.c @@ -5,7 +5,8 @@ /* Postfix master process /* SYNOPSIS /* .fi -/* \fBmaster\fR [\fB-c \fIconfig_dir\fR] [\fB-D\fR] [\fB-t\fR] [\fB-v\fR] +/* \fBmaster\fR [\fB-c \fIconfig_dir\fR] [\fB-e \fIexit_time\fR] +/* [\fB-D\fR] [\fB-t\fR] [\fB-v\fR] /* DESCRIPTION /* The \fBmaster\fR daemon is the resident process that runs Postfix /* daemons on demand: daemons to send or receive messages via the @@ -28,6 +29,9 @@ /* .IP "\fB-c \fIconfig_dir\fR" /* Read the \fBmain.cf\fR and \fBmaster.cf\fR configuration files in /* the named directory instead of the default configuration directory. +/* .IP "\fB-e \fIexit_time\fR" +/* Terminate the master process after \fIexit_time\fR seconds. Child +/* processes terminate at their convenience. /* .IP \fB-D\fR /* After initialization, run a debugger on the master process. The /* debugging command is specified with the \fBdebugger_command\fR in @@ -163,6 +167,16 @@ #include "master.h" +/* master_exit_event - exit for memory leak testing purposes */ + +static void master_exit_event(int unused_event, char *unused_context) +{ + msg_info("master exit time has arrived"); + exit(0); +} + +/* main - main program */ + int main(int argc, char **argv) { static VSTREAM *lock_fp; @@ -251,12 +265,15 @@ int main(int argc, char **argv) /* * Process JCL. */ - while ((ch = GETOPT(argc, argv, "c:Dtv")) > 0) { + while ((ch = GETOPT(argc, argv, "c:e:Dtv")) > 0) { switch (ch) { case 'c': if (setenv(CONF_ENV_PATH, optarg, 1) < 0) msg_fatal("out of memory"); break; + case 'e': + event_request_timer(master_exit_event, (char *) 0, atoi(optarg)); + break; case 'D': debug_me = 1; break; @@ -267,7 +284,7 @@ int main(int argc, char **argv) msg_verbose++; break; default: - msg_fatal("usage: %s [-D] [-t] [-v]", argv[0]); + msg_fatal("usage: %s [-c config_dir] [-e exit_time] [-D (debug)] [-t (test)] [-v]", argv[0]); /* NOTREACHED */ } } @@ -282,8 +299,7 @@ int main(int argc, char **argv) /* * Environment import filter, to enforce consistent behavior whether - * Postfix is started by hand, or at system boot time. The argument list - * specifies what environment parameters to preserve. + * Postfix is started by hand, or at system boot time. */ import_env = argv_split(var_import_environ, ", \t\r\n"); clean_env(import_env->argv); diff --git a/postfix/src/master/master_ent.c b/postfix/src/master/master_ent.c index fd05bc2b6..6a6e976f3 100644 --- a/postfix/src/master/master_ent.c +++ b/postfix/src/master/master_ent.c @@ -277,9 +277,9 @@ MASTER_SERV *get_master_ent() serv->type = MASTER_SERV_TYPE_INET; atmp = inet_parse(name, &host, &port); if (host && *host) { - serv->flags |= MASTER_FLAG_INETHOST; + serv->flags |= MASTER_FLAG_INETHOST;/* host:port */ serv->addr_list.inet = - (INET_ADDR_LIST *) mymalloc(sizeof(*serv->addr_list_buf.inet)); + (INET_ADDR_LIST *) mymalloc(sizeof(*serv->addr_list.inet)); inet_addr_list_init(serv->addr_list.inet); inet_addr_host(serv->addr_list.inet, host); serv->listen_fd_count = serv->addr_list.inet->used; diff --git a/postfix/src/smtpd/smtpd.c b/postfix/src/smtpd/smtpd.c index 6822cd1a4..5dc4b13d8 100644 --- a/postfix/src/smtpd/smtpd.c +++ b/postfix/src/smtpd/smtpd.c @@ -523,6 +523,7 @@ static char *extract_addr(SMTPD_STATE *state, SMTPD_TOKEN *arg, int naddr; int non_addr; char *err = 0; + char *junk; /* * Special case. @@ -544,7 +545,13 @@ static char *extract_addr(SMTPD_STATE *state, SMTPD_TOKEN *arg, */ if (msg_verbose) msg_info("%s: input: %s", myname, STR(arg->vstrval)); - tree = tok822_parse(STR(arg->vstrval)); + if (STR(arg->vstrval)[0] == '<' + && STR(arg->vstrval)[LEN(arg->vstrval) - 1] == '>') { + junk = mystrndup(STR(arg->vstrval) + 1, LEN(arg->vstrval) - 2); + tree = tok822_parse(junk); + myfree(junk); + } else + tree = tok822_parse(STR(arg->vstrval)); /* * Find trouble.