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 <first last <user@domain>> well. I
+ thought this was taken care of years ago. File: smtpd/smtpd.c.
# make install (interactive version, first time install)
# make install </dev/null (non-interactive version, for upgrades)
+ The non-interactive version needs the /etc/postfix/install.cf
+ file from a previous installation. If the file does not exist,
+ use interactive installation instead.
+
The INSTALL.sh script offers suggestions for pathnames that you
can override, either by editing INSTALL.sh or by specifying your
preferences interactively. INSTALL.sh stores your preferences in
done
}
-test -f $CONFIG_DIRECTORY/install.cf && . $CONFIG_DIRECTORY/install.cf
+test -f $CONFIG_DIRECTORY/install.cf && . $CONFIG_DIRECTORY/install.cf || {
+ test -t 0 || {
+ echo Non-interactive install needs the $CONFIG_DIRECTORY/install.cf 1>&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.
# 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
# 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
# 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
<li><a href="#virtual_relay">Postfix refuses mail for virtual
domains with "relay access denied"</a>
+
+<li><a href="#broken_transport">Mail delivery fails with: "unknown
+mail transport error"</a>
+
</ul>
<p>
<li><a href="#noservice">What does "fatal: unknown service: smtp/tcp" mean?</a>
+<li><a href="#broken_transport">Mail delivery fails with: "unknown
+mail transport error"</a>
+
</ul>
<a name="local_delivery"><h3>Local (non-virtual) delivery</h3>
<li><a href="#noalias">What does "fatal: open database /etc/aliases.db" mean?</a>
+<li><a href="#broken_transport">Mail delivery fails with: "unknown
+mail transport error"</a>
+
</ul>
<a name="mailing_lists"><h3>Mailing lists</h3>
<a name="noalias"><h3>What does "fatal: open database /etc/aliases.db" mean?</h3></a>
-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:
+
+<p>
+
+<ul>
+
+<li> The existing file does not have the expected file format.
+The cause is one of the following:
+
+<p>
+
+<ul>
+
+<li>The file was created by Berkeley DB version 1 and you are using
+version 2 or 3 (or vice versa).
<p>
+<li> The file was written in "btree" format and Postfix expects
+ "hash" format (or vice versa).
+
+</ul>
+
+<p>
+
+To fix the problem for Postfix execute the following command as root:
+
+<blockquote>
<pre>
- # newaliases
+ newaliases
</pre>
+</blockquote>
+
+This creates the aliases.db in the format that Postfix expects.
+
+<p>
+
+<li>Or the problem could be something completely different. If the
+result of running <tt>newaliases</tt> is a zero-length aliases.db
+file, then you probably suffer from the following problem.
+
+<p>
+
+<ul>
+
+<li>Postfix was compiled with #include files for Berkeley DB version
+<i>X</i> and was linked against object library files for Berkeley DB
+version <i>Y</i>, where <i>X</i> and <i>Y</i> are different versions
+of the Berkeley DB library.
+
+</ul>
+
+<p>
+
+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.
+
+<p>
+
+On a properly installed system, including the file <b><db.h></b>
+and linking with <b>-ldb</b> should access files from the same
+Berkeley DB library version.
+
+</ul>
<hr>
<b>examples/chroot-setup</b> directory.
</ul>
+
+<hr>
+
+<a name="broken_transport"><h3>Mail delivery fails with: "unknown
+mail transport error"</h3>
+
+This is an opportunity to meet your friends <b>egrep</b> and
+<b>less</b>. Postfix activity, including progres and failure, is
+logged to a logfile, typically named <b>/var/log/maillog</b>. To
+find out where Postfix activity is logged on your machine, examine
+the <b>/etc/syslog.conf</b> file.
+
+<p>
+
+To find out the cause for the "unknown mail transport error", type
+the following command:
+
+<blockquote>
+
+<tt>egrep '(warning|fatal|panic):' /var/log/maillog | less</tt>
+
+</blockquote>
+
+Pay particular attention to messages that are labeled as <b>fatal</b>
+and <b>panic</b>. These describe catastrophic failures that need
+to be addressed before Postfix is happy. Problems labeled as
+<b>fatal</b> as fixed by adjusting configurations. Problems labeled
+as <b>panic</b> are fixed by changing Postfix source code.
+
<hr>
<a name="root"> <h3>Root's mail is delivered to nobody</h3>
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=\\\"<gdbm-ndbm.h>\\\""
+ elif [ -f /usr/include/gdbm/ndbm.h ]
+ then
+ CCARGS="$CCARGS -DHAS_DBM -DPATH_NDBM_H=\\\"<gdbm/ndbm.h>\\\""
+ fi
SYSLIBS="-ldb"
for name in nsl resolv
do
* 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
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.
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;
/*
* 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);
/* 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
/* .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
#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;
/*
* 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;
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 */
}
}
/*
* 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);
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;
int naddr;
int non_addr;
char *err = 0;
+ char *junk;
/*
* Special case.
*/
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.