mirror of
https://github.com/vdukhovni/postfix
synced 2025-08-30 05:38:06 +00:00
snapshot-20000919
This commit is contained in:
parent
5a94b2d36d
commit
b76629d29b
@ -4206,3 +4206,11 @@ Apologies for any names omitted.
|
|||||||
Gross hack: prevent looping a bad recipient by always
|
Gross hack: prevent looping a bad recipient by always
|
||||||
forwarding recipients in :include: files, even when
|
forwarding recipients in :include: files, even when
|
||||||
owner-listname is not set. File: local/recipient.c.
|
owner-listname is not set. File: local/recipient.c.
|
||||||
|
|
||||||
|
20000919
|
||||||
|
|
||||||
|
Convenience: INSTALL.sh now imports default settings from
|
||||||
|
the process environment, in order to make scripting easier.
|
||||||
|
|
||||||
|
Portability: another fix for NEXTSTEP (Masaki MURASE).
|
||||||
|
File: util/spawn_command.h.
|
||||||
|
@ -45,6 +45,10 @@ EOF
|
|||||||
# the time that a file does not exist, and avoid copying over programs
|
# the time that a file does not exist, and avoid copying over programs
|
||||||
# in order to not disturb running programs.
|
# in order to not disturb running programs.
|
||||||
|
|
||||||
|
censored_ls() {
|
||||||
|
ls "$@" | egrep -v '^\.|/\.|CVS|RCS|SCCS'
|
||||||
|
}
|
||||||
|
|
||||||
compare_or_replace() {
|
compare_or_replace() {
|
||||||
(cmp $2 $3 >/dev/null 2>&1 && echo Skipping $3...) || {
|
(cmp $2 $3 >/dev/null 2>&1 && echo Skipping $3...) || {
|
||||||
echo Updating $3...
|
echo Updating $3...
|
||||||
@ -102,21 +106,21 @@ esac
|
|||||||
|
|
||||||
# Default settings. Most are clobbered by remembered settings.
|
# Default settings. Most are clobbered by remembered settings.
|
||||||
|
|
||||||
install_root=/
|
: ${install_root=/}
|
||||||
tempdir=`pwd`
|
: ${tempdir=`pwd`}
|
||||||
config_directory=/etc/postfix
|
: ${config_directory=/etc/postfix}
|
||||||
daemon_directory=/usr/libexec/postfix
|
: ${daemon_directory=/usr/libexec/postfix}
|
||||||
command_directory=/usr/sbin
|
: ${command_directory=/usr/sbin}
|
||||||
queue_directory=/var/spool/postfix
|
: ${queue_directory=/var/spool/postfix}
|
||||||
if [ -f /usr/lib/sendmail ]
|
if [ -f /usr/lib/sendmail ]
|
||||||
then sendmail_path=/usr/lib/sendmail
|
then : ${sendmail_path=/usr/lib/sendmail}
|
||||||
else sendmail_path=/usr/sbin/sendmail
|
else : ${sendmail_path=/usr/sbin/sendmail}
|
||||||
fi
|
fi
|
||||||
newaliases_path=/usr/bin/newaliases
|
: ${newaliases_path=/usr/bin/newaliases}
|
||||||
mailq_path=/usr/bin/mailq
|
: ${mailq_path=/usr/bin/mailq}
|
||||||
mail_owner=postfix
|
: ${mail_owner=postfix}
|
||||||
setgid=no
|
: ${setgid=no}
|
||||||
manpages=/usr/local/man
|
: ${manpages=/usr/local/man}
|
||||||
|
|
||||||
# Find out the location of configuration files.
|
# Find out the location of configuration files.
|
||||||
|
|
||||||
@ -245,12 +249,12 @@ done
|
|||||||
|
|
||||||
# Install files. Be careful to not copy over running programs.
|
# Install files. Be careful to not copy over running programs.
|
||||||
|
|
||||||
for file in `ls libexec | grep -v '^\.'`
|
for file in `censored_ls libexec`
|
||||||
do
|
do
|
||||||
compare_or_replace a+x,go-w libexec/$file $DAEMON_DIRECTORY/$file || exit 1
|
compare_or_replace a+x,go-w libexec/$file $DAEMON_DIRECTORY/$file || exit 1
|
||||||
done
|
done
|
||||||
|
|
||||||
for file in `ls bin | grep '^post'`
|
for file in `censored_ls bin | grep '^post'`
|
||||||
do
|
do
|
||||||
compare_or_replace a+x,go-w bin/$file $COMMAND_DIRECTORY/$file || exit 1
|
compare_or_replace a+x,go-w bin/$file $COMMAND_DIRECTORY/$file || exit 1
|
||||||
done
|
done
|
||||||
@ -263,12 +267,12 @@ test -f bin/sendmail && {
|
|||||||
|
|
||||||
if [ -f $CONFIG_DIRECTORY/main.cf ]
|
if [ -f $CONFIG_DIRECTORY/main.cf ]
|
||||||
then
|
then
|
||||||
for file in LICENSE `cd conf; echo sample*` main.cf.default
|
for file in LICENSE `cd conf; censored_ls sample*` main.cf.default
|
||||||
do
|
do
|
||||||
compare_or_replace a+r,go-w conf/$file $CONFIG_DIRECTORY/$file || exit 1
|
compare_or_replace a+r,go-w conf/$file $CONFIG_DIRECTORY/$file || exit 1
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
cp conf/* $CONFIG_DIRECTORY || exit 1
|
cp `censored_ls conf/*` $CONFIG_DIRECTORY || exit 1
|
||||||
chmod a+r,go-w $CONFIG_DIRECTORY/* || exit 1
|
chmod a+r,go-w $CONFIG_DIRECTORY/* || exit 1
|
||||||
|
|
||||||
test -z "$install_root" && {
|
test -z "$install_root" && {
|
||||||
@ -332,7 +336,7 @@ no) ;;
|
|||||||
for dir in man?
|
for dir in man?
|
||||||
do test -d $MANPAGES/$dir || mkdir -p $MANPAGES/$dir || exit 1
|
do test -d $MANPAGES/$dir || mkdir -p $MANPAGES/$dir || exit 1
|
||||||
done
|
done
|
||||||
for file in man?/*
|
for file in `censored_ls man?/*`
|
||||||
do
|
do
|
||||||
(test -f $MANPAGES/$file && cmp -s $file $MANPAGES/$file &&
|
(test -f $MANPAGES/$file && cmp -s $file $MANPAGES/$file &&
|
||||||
echo Skipping $MANPAGES/$file...) || {
|
echo Skipping $MANPAGES/$file...) || {
|
||||||
|
@ -4,7 +4,7 @@ OPTS = "CC=$(CC)"
|
|||||||
DIRS = util global dns master postfix smtpstone sendmail error \
|
DIRS = util global dns master postfix smtpstone sendmail error \
|
||||||
pickup cleanup smtpd local lmtp trivial-rewrite qmgr smtp bounce pipe \
|
pickup cleanup smtpd local lmtp trivial-rewrite qmgr smtp bounce pipe \
|
||||||
showq postalias postcat postconf postdrop postkick postlock postlog \
|
showq postalias postcat postconf postdrop postkick postlock postlog \
|
||||||
postmap postsuper nqmgr # spawn base64 proto man html
|
postmap postsuper nqmgr spawn # base64 proto man html
|
||||||
|
|
||||||
default: update
|
default: update
|
||||||
|
|
||||||
|
@ -1,4 +1,27 @@
|
|||||||
Incompatible changes with snapshot-20000625
|
Incompatible changes with snapshot-20000919
|
||||||
|
===========================================
|
||||||
|
|
||||||
|
The queue manager to delivery agent protocol has changed. This does
|
||||||
|
not affect the format of queue files, but means that you cannot
|
||||||
|
use this software with queue managers or delivery agents of prior
|
||||||
|
Postfix versions.
|
||||||
|
|
||||||
|
Change in address rewriting: Errors-To:, Reply-To: and Return-Receipt:
|
||||||
|
are now rewritten as a sender address (was: recipient).
|
||||||
|
|
||||||
|
Major changes with snapshot-20000919
|
||||||
|
====================================
|
||||||
|
|
||||||
|
Postfix now strips out the Content-Length: header to avoid confusion
|
||||||
|
with mail user agents.
|
||||||
|
|
||||||
|
The header_checks and body_checks features can now be used to strip
|
||||||
|
out unwanted data. Specify IGNORE and the data will go disappear.
|
||||||
|
|
||||||
|
Postfix no longer inserts a Sender: message header when the
|
||||||
|
From: address differs from the envelope sender address.
|
||||||
|
|
||||||
|
Incompatible changes with snapshot-20000625 (never released)
|
||||||
===========================================
|
===========================================
|
||||||
|
|
||||||
The local delivery agent no longer appends a blank line to mail
|
The local delivery agent no longer appends a blank line to mail
|
||||||
|
Binary file not shown.
Binary file not shown.
@ -15,7 +15,7 @@
|
|||||||
* Version of this program.
|
* Version of this program.
|
||||||
*/
|
*/
|
||||||
#define VAR_MAIL_VERSION "mail_version"
|
#define VAR_MAIL_VERSION "mail_version"
|
||||||
#define DEF_MAIL_VERSION "Snapshot-20000918"
|
#define DEF_MAIL_VERSION "Snapshot-20000919"
|
||||||
extern char *var_mail_version;
|
extern char *var_mail_version;
|
||||||
|
|
||||||
/* LICENSE
|
/* LICENSE
|
||||||
|
@ -64,7 +64,6 @@
|
|||||||
#include <vstream.h>
|
#include <vstream.h>
|
||||||
#include <htable.h>
|
#include <htable.h>
|
||||||
#include <open_as.h>
|
#include <open_as.h>
|
||||||
#include <stat_as.h>
|
|
||||||
#include <lstat_as.h>
|
#include <lstat_as.h>
|
||||||
#include <iostuff.h>
|
#include <iostuff.h>
|
||||||
#include <stringops.h>
|
#include <stringops.h>
|
||||||
@ -79,7 +78,6 @@
|
|||||||
#include <mail_params.h>
|
#include <mail_params.h>
|
||||||
#include <mail_conf.h>
|
#include <mail_conf.h>
|
||||||
#include <ext_prop.h>
|
#include <ext_prop.h>
|
||||||
#include <defer.h>
|
|
||||||
|
|
||||||
/* Application-specific. */
|
/* Application-specific. */
|
||||||
|
|
||||||
@ -114,36 +112,18 @@ int deliver_dotforward(LOCAL_STATE state, USER_ATTR usr_attr, int *statusp)
|
|||||||
if (msg_verbose)
|
if (msg_verbose)
|
||||||
MSG_LOG_STATE(myname, state);
|
MSG_LOG_STATE(myname, state);
|
||||||
|
|
||||||
/*
|
|
||||||
* Skip non-existing users. The mailbox delivery routine will catch the
|
|
||||||
* error.
|
|
||||||
*
|
|
||||||
* Defer delivery to recipients whose home directory is not accessible.
|
|
||||||
*
|
|
||||||
* XXX This code should be one level up. The caller should pass the
|
|
||||||
* recipient's password file info along with the call.
|
|
||||||
*
|
|
||||||
* XXX This code should also be executed for \user deliveries that bypass
|
|
||||||
* aliasing and .forward processing. Said code is currently broken after
|
|
||||||
* a revision of the RFC822 address parser.
|
|
||||||
*/
|
|
||||||
if ((mypwd = mypwnam(state.msg_attr.user)) == 0)
|
|
||||||
return (NO);
|
|
||||||
if (var_stat_home_dir
|
|
||||||
&& stat_as(mypwd->pw_dir, &st, mypwd->pw_uid, mypwd->pw_gid) < 0) {
|
|
||||||
*statusp = defer_append(BOUNCE_FLAG_KEEP,
|
|
||||||
BOUNCE_ATTR(state.msg_attr),
|
|
||||||
"cannot access %s home directory %s: %m",
|
|
||||||
mypwd->pw_name, mypwd->pw_dir);
|
|
||||||
return (YES);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Skip this module if per-user forwarding is disabled.
|
* Skip this module if per-user forwarding is disabled.
|
||||||
*/
|
*/
|
||||||
if (*var_forward_path == 0)
|
if (*var_forward_path == 0)
|
||||||
return (NO);
|
return (NO);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Skip non-existing users. The mailbox delivery routine will catch the
|
||||||
|
* error.
|
||||||
|
*/
|
||||||
|
if ((mypwd = mypwnam(state.msg_attr.user)) == 0)
|
||||||
|
return (NO);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* From here on no early returns or we have a memory leak.
|
* From here on no early returns or we have a memory leak.
|
||||||
|
@ -60,6 +60,7 @@
|
|||||||
/* System library. */
|
/* System library. */
|
||||||
|
|
||||||
#include <sys_defs.h>
|
#include <sys_defs.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@ -75,13 +76,16 @@
|
|||||||
#include <split_at.h>
|
#include <split_at.h>
|
||||||
#include <stringops.h>
|
#include <stringops.h>
|
||||||
#include <dict.h>
|
#include <dict.h>
|
||||||
|
#include <stat_as.h>
|
||||||
|
|
||||||
/* Global library. */
|
/* Global library. */
|
||||||
|
|
||||||
#include <bounce.h>
|
#include <bounce.h>
|
||||||
|
#include <defer.h>
|
||||||
#include <mail_params.h>
|
#include <mail_params.h>
|
||||||
#include <split_addr.h>
|
#include <split_addr.h>
|
||||||
#include <ext_prop.h>
|
#include <ext_prop.h>
|
||||||
|
#include <mypwd.h>
|
||||||
|
|
||||||
/* Application-specific. */
|
/* Application-specific. */
|
||||||
|
|
||||||
@ -93,6 +97,8 @@ static int deliver_switch(LOCAL_STATE state, USER_ATTR usr_attr)
|
|||||||
{
|
{
|
||||||
char *myname = "deliver_switch";
|
char *myname = "deliver_switch";
|
||||||
int status = 0;
|
int status = 0;
|
||||||
|
struct stat st;
|
||||||
|
struct mypasswd *mypwd;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Make verbose logging easier to understand.
|
* Make verbose logging easier to understand.
|
||||||
@ -108,6 +114,8 @@ static int deliver_switch(LOCAL_STATE state, USER_ATTR usr_attr)
|
|||||||
* XXX This code currently does not work due to revision of the RFC822
|
* XXX This code currently does not work due to revision of the RFC822
|
||||||
* address parser. \user should be permitted only in locally specified
|
* address parser. \user should be permitted only in locally specified
|
||||||
* aliases, includes or forward files.
|
* aliases, includes or forward files.
|
||||||
|
*
|
||||||
|
* XXX Should test for presence of user home directory.
|
||||||
*/
|
*/
|
||||||
if (state.msg_attr.recipient[0] == '\\') {
|
if (state.msg_attr.recipient[0] == '\\') {
|
||||||
state.msg_attr.recipient++, state.msg_attr.local++, state.msg_attr.user++;
|
state.msg_attr.recipient++, state.msg_attr.local++, state.msg_attr.user++;
|
||||||
@ -161,13 +169,22 @@ static int deliver_switch(LOCAL_STATE state, USER_ATTR usr_attr)
|
|||||||
/*
|
/*
|
||||||
* Always forward recipients in :include: files.
|
* Always forward recipients in :include: files.
|
||||||
*/
|
*/
|
||||||
if (state.msg_attr.exp_type = EXPAND_TYPE_INCL)
|
if (state.msg_attr.exp_type == EXPAND_TYPE_INCL)
|
||||||
return (deliver_indirect(state));
|
return (deliver_indirect(state));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Delivery to local user. First try expansion of the recipient's
|
* Delivery to local user. First try expansion of the recipient's
|
||||||
* $HOME/.forward file, then mailbox delivery.
|
* $HOME/.forward file, then mailbox delivery. Back off when the user's
|
||||||
|
* home directory does not exist.
|
||||||
*/
|
*/
|
||||||
|
if ((mypwd = mypwnam(state.msg_attr.user)) == 0)
|
||||||
|
return (deliver_unknown(state, usr_attr));
|
||||||
|
if (var_stat_home_dir
|
||||||
|
&& stat_as(mypwd->pw_dir, &st, mypwd->pw_uid, mypwd->pw_gid) < 0)
|
||||||
|
return (defer_append(BOUNCE_FLAG_KEEP,
|
||||||
|
BOUNCE_ATTR(state.msg_attr),
|
||||||
|
"cannot access home directory %s: %m",
|
||||||
|
mypwd->pw_dir));
|
||||||
if (deliver_dotforward(state, usr_attr, &status) == 0
|
if (deliver_dotforward(state, usr_attr, &status) == 0
|
||||||
&& deliver_mailbox(state, usr_attr, &status) == 0)
|
&& deliver_mailbox(state, usr_attr, &status) == 0)
|
||||||
status = deliver_unknown(state, usr_attr);
|
status = deliver_unknown(state, usr_attr);
|
||||||
|
@ -626,10 +626,15 @@ static int deliver_message(DELIVER_REQUEST *request, char *service, char **argv)
|
|||||||
RECIPIENT_LIST *rcpt_list = &request->rcpt_list;
|
RECIPIENT_LIST *rcpt_list = &request->rcpt_list;
|
||||||
VSTRING *why = vstring_alloc(100);
|
VSTRING *why = vstring_alloc(100);
|
||||||
VSTRING *buf;
|
VSTRING *buf;
|
||||||
ARGV *expanded_argv;
|
ARGV *expanded_argv = 0;
|
||||||
int deliver_status;
|
int deliver_status;
|
||||||
int command_status;
|
int command_status;
|
||||||
|
|
||||||
|
#define DELIVER_MSG_CLEANUP() { \
|
||||||
|
vstring_free(why); \
|
||||||
|
if (expanded_argv) argv_free(expanded_argv); \
|
||||||
|
}
|
||||||
|
|
||||||
if (msg_verbose)
|
if (msg_verbose)
|
||||||
msg_info("%s: from <%s>", myname, request->sender);
|
msg_info("%s: from <%s>", myname, request->sender);
|
||||||
|
|
||||||
@ -674,6 +679,7 @@ static int deliver_message(DELIVER_REQUEST *request, char *service, char **argv)
|
|||||||
|
|
||||||
deliver_status = eval_command_status(PIPE_STAT_BOUNCE, service,
|
deliver_status = eval_command_status(PIPE_STAT_BOUNCE, service,
|
||||||
request, request->fp, "message too large");
|
request, request->fp, "message too large");
|
||||||
|
DELIVER_MSG_CLEANUP();
|
||||||
return (deliver_status);
|
return (deliver_status);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -706,8 +712,7 @@ static int deliver_message(DELIVER_REQUEST *request, char *service, char **argv)
|
|||||||
/*
|
/*
|
||||||
* Clean up.
|
* Clean up.
|
||||||
*/
|
*/
|
||||||
vstring_free(why);
|
DELIVER_MSG_CLEANUP();
|
||||||
argv_free(expanded_argv);
|
|
||||||
|
|
||||||
return (deliver_status);
|
return (deliver_status);
|
||||||
}
|
}
|
||||||
|
@ -281,7 +281,7 @@ static int postmap_delete(const char *map_type, const char *map_name,
|
|||||||
dict = dict_open3(map_type, map_name, O_RDWR, DICT_FLAG_LOCK);
|
dict = dict_open3(map_type, map_name, O_RDWR, DICT_FLAG_LOCK);
|
||||||
status = dict_del(dict, key);
|
status = dict_del(dict, key);
|
||||||
dict_close(dict);
|
dict_close(dict);
|
||||||
return (status);
|
return (status == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* usage - explain */
|
/* usage - explain */
|
||||||
|
@ -286,8 +286,8 @@ WAIT_STATUS_T spawn_command(int key,...)
|
|||||||
*/
|
*/
|
||||||
if ((err = timed_waitpid(pid, &wait_status, 0, args.time_limit)) < 0
|
if ((err = timed_waitpid(pid, &wait_status, 0, args.time_limit)) < 0
|
||||||
&& errno == ETIMEDOUT) {
|
&& errno == ETIMEDOUT) {
|
||||||
msg_warn("%s: process id %d: command time limit exceeded",
|
msg_warn("%s: process id %lu: command time limit exceeded",
|
||||||
args.command, pid);
|
args.command, (unsigned long) pid);
|
||||||
kill(-pid, SIGKILL);
|
kill(-pid, SIGKILL);
|
||||||
err = waitpid(pid, &wait_status, 0);
|
err = waitpid(pid, &wait_status, 0);
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#define SPAWN_CMD_ENV 9 /* extra environment */
|
#define SPAWN_CMD_ENV 9 /* extra environment */
|
||||||
#define SPAWN_CMD_SHELL 10 /* alternative shell */
|
#define SPAWN_CMD_SHELL 10 /* alternative shell */
|
||||||
|
|
||||||
extern int spawn_command(int,...);
|
extern WAIT_STATUS_T spawn_command(int,...);
|
||||||
|
|
||||||
/* LICENSE
|
/* LICENSE
|
||||||
/* .ad
|
/* .ad
|
||||||
|
Loading…
x
Reference in New Issue
Block a user