mirror of
https://github.com/vdukhovni/postfix
synced 2025-09-01 14:45:32 +00:00
snapshot-20020111
This commit is contained in:
committed by
Viktor Dukhovni
parent
a41bbe4770
commit
1ba55910ce
@@ -5944,6 +5944,11 @@ Apologies for any names omitted.
|
|||||||
non-blocking pipe. File: master/master_flow.c. Report:
|
non-blocking pipe. File: master/master_flow.c. Report:
|
||||||
Hamish Marson.
|
Hamish Marson.
|
||||||
|
|
||||||
|
20020111
|
||||||
|
|
||||||
|
Feedback: feedback, bugfixes, and brain-dead shell workarounds
|
||||||
|
for the install scripts by Victor Duchovny and Simon Mudd.
|
||||||
|
|
||||||
Open problems:
|
Open problems:
|
||||||
|
|
||||||
Low: don't do user@domain and @domain lookups in
|
Low: don't do user@domain and @domain lookups in
|
||||||
|
@@ -1,3 +1,17 @@
|
|||||||
|
Incompatible changes with snapshot-20020111
|
||||||
|
===========================================
|
||||||
|
|
||||||
|
Another revision of installation procedures. The command line
|
||||||
|
interface of the post-install script has changed; see embedded
|
||||||
|
documentation. The postfix-files file with information about
|
||||||
|
Postfix files and directories now contains $name variables rather
|
||||||
|
than directory names, user names and group names. You can now change
|
||||||
|
parameters such as mail_owner and setgid_group after installing
|
||||||
|
Postfix, and apply the correct file/directory ownerships and
|
||||||
|
permissions by executing the post-install script as:
|
||||||
|
|
||||||
|
post-install set-permissions config_directory=/etc/postfix
|
||||||
|
|
||||||
Incompatible changes with snapshot-20020110
|
Incompatible changes with snapshot-20020110
|
||||||
===========================================
|
===========================================
|
||||||
|
|
||||||
@@ -5,10 +19,10 @@ The INSTALL.sh installation procedure is replaced by a postfix-install
|
|||||||
script that either installs Postfix on the local system (as root)
|
script that either installs Postfix on the local system (as root)
|
||||||
or that builds a package (as non-root) for distribution to other
|
or that builds a package (as non-root) for distribution to other
|
||||||
systems. This script creates a file $config_directory/postfix-files
|
systems. This script creates a file $config_directory/postfix-files
|
||||||
with ownership and permissions of Postfix files/directories. The
|
with ownership and permissions of Postfix files/directories. A
|
||||||
$config_directory/post-install script applies the finishing touch:
|
new $config_directory/post-install script applies the finishing
|
||||||
it sets file/directory ownership and permissions, edits existing
|
touch: it sets file/directory ownership and permissions, edits
|
||||||
configuration files, and creates missing queue directories.
|
existing configuration files, and creates missing queue directories.
|
||||||
|
|
||||||
Incompatible changes with snapshot-20020106
|
Incompatible changes with snapshot-20020106
|
||||||
===========================================
|
===========================================
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
# SUMMARY
|
# SUMMARY
|
||||||
# Postfix post-installation script
|
# Postfix post-installation script
|
||||||
# SYNOPSIS
|
# SYNOPSIS
|
||||||
# post-install [options] config_directory
|
# post-install [name=value] command ...
|
||||||
# DESCRIPTION
|
# DESCRIPTION
|
||||||
# The post-install script performs the finishing touch of a Postfix
|
# The post-install script performs the finishing touch of a Postfix
|
||||||
# installation, after the executable programs and configuration
|
# installation, after the executable programs and configuration
|
||||||
@@ -27,47 +27,51 @@
|
|||||||
# create missing queue directories.
|
# create missing queue directories.
|
||||||
# .PP
|
# .PP
|
||||||
# Arguments
|
# Arguments
|
||||||
# .IP -create
|
# .IP create-missing
|
||||||
# Create missing queue directories with ownerships and permissions
|
# Create missing queue directories with ownerships and permissions
|
||||||
# according to the contents of $config_directory/postfix-files.
|
# according to the contents of $config_directory/postfix-files.
|
||||||
#
|
#
|
||||||
# This is required at Postfix start-up time.
|
# This is required at Postfix start-up time.
|
||||||
# .IP -set-permissions
|
# .IP set-permissions
|
||||||
# Set all file/directory ownerships and permissions according to the
|
# Set all file/directory ownerships and permissions according to the
|
||||||
# contents of $config_directory/postfix-files. Implies -create.
|
# contents of $config_directory/postfix-files. Implies create-missing.
|
||||||
#
|
#
|
||||||
# This is required when installing Postfix from a pre-built package.
|
# This is required when installing Postfix from a pre-built package.
|
||||||
# .IP -upgrade-permissions
|
# .IP upgrade-permissions
|
||||||
# Update ownership and permission of selected files/directories as
|
# Update ownership and permission of selected files/directories as
|
||||||
# specified in $config_directory/postfix-files. Implies -create.
|
# specified in $config_directory/postfix-files. Implies create-missing.
|
||||||
#
|
#
|
||||||
# This is required when installing Postfix from source code, while
|
# This is required when installing Postfix from source code, while
|
||||||
# Postfix was already installed on the machine.
|
# Postfix was already installed on the machine.
|
||||||
# .IP -upgrade-configuration
|
# .IP upgrade-configuration
|
||||||
# Edit the installed main.cf and master.cf files, in order to account
|
# Edit the installed main.cf and master.cf files, in order to account
|
||||||
# for missing services and to fix deprecated parameter settings.
|
# for missing services and to fix deprecated parameter settings.
|
||||||
#
|
#
|
||||||
# This is required when Postfix was already installed on the machine.
|
# This is required when Postfix was already installed on the machine.
|
||||||
# .IP -upgrade-source
|
# .IP upgrade-source
|
||||||
# Short-hand for -upgrade-permissions -upgrade-configuration.
|
# Short-hand for upgrade-permissions upgrade-configuration.
|
||||||
#
|
#
|
||||||
# This is recommended when upgrading Postfix from source code.
|
# This is recommended when upgrading Postfix from source code.
|
||||||
# .IP -upgrade-package
|
# .IP upgrade-package
|
||||||
# Short-hand for -set-permissions -upgrade-configuration.
|
# Short-hand for set-permissions upgrade-configuration.
|
||||||
#
|
#
|
||||||
# This is recommended when upgrading Postfix from a pre-built package.
|
# This is recommended when upgrading Postfix from a pre-built package.
|
||||||
# .IP -first-install-reminder
|
# .IP first-install-reminder
|
||||||
# Remind the user that they still need to configure main.cf and the
|
# Remind the user that they still need to configure main.cf and the
|
||||||
# aliases file, and that newaliases needs to be run.
|
# aliases file, and that newaliases needs to be run.
|
||||||
#
|
#
|
||||||
# This is recommended when Postfix is installed for the first time.
|
# This is recommended when Postfix is installed for the first time.
|
||||||
# .IP config_directory
|
# .IP config_directory=pathname
|
||||||
# Directory with Postfix configuration files. This must be an absolute
|
# Absolute pathname of the directory with Postfix configuration files.
|
||||||
# pathname.
|
# This information must be specified if it is not given via the
|
||||||
|
# process environment.
|
||||||
|
# .IP command_directory=pathname
|
||||||
|
# Absolute pathname of the directory with the postconf command.
|
||||||
|
# This information must be specified if it is not given via the
|
||||||
|
# process environment, and if the directory is not a standard
|
||||||
|
# system directory.
|
||||||
# SEE ALSO
|
# SEE ALSO
|
||||||
# postfix-install(1) Postfix primary installation script for installation
|
# postfix-install(1) Postfix primary installation script.
|
||||||
# from source code, or for building a package for distribution to other
|
|
||||||
# systems.
|
|
||||||
# FILES
|
# FILES
|
||||||
# $config_directory/main.cf, Postfix installation configuration.
|
# $config_directory/main.cf, Postfix installation configuration.
|
||||||
# $config_directory/postfix-files, permissions and ownerships.
|
# $config_directory/postfix-files, permissions and ownerships.
|
||||||
@@ -87,32 +91,36 @@ umask 022
|
|||||||
|
|
||||||
PATH=/bin:/usr/bin:/usr/sbin:/usr/etc:/sbin:/etc:/usr/contrib/bin:/usr/gnu/bin:/usr/ucb:/usr/bsd
|
PATH=/bin:/usr/bin:/usr/sbin:/usr/etc:/sbin:/etc:/usr/contrib/bin:/usr/gnu/bin:/usr/ucb:/usr/bsd
|
||||||
SHELL=/bin/sh
|
SHELL=/bin/sh
|
||||||
|
IFS="
|
||||||
|
"
|
||||||
|
|
||||||
USAGE="usage: $0 [options] config_directory
|
USAGE="Usage: $0 [name=value] command
|
||||||
|
create-missing Create missing queue directories.
|
||||||
|
upgrade-source Use when upgrading from source.
|
||||||
|
upgrade-package Use when upgrading from pre-built package.
|
||||||
|
first-install-reminder Remind of mandatory configuration steps.
|
||||||
|
config_directory=path Specify an absolute path name.
|
||||||
|
command_directory=path Specify an absolute path name."
|
||||||
|
|
||||||
-upgrade-source Use when upgrading from source.
|
# Process command-line options and parameter settings. Work around
|
||||||
|
# brain damaged shells. "name=value command" should not make the
|
||||||
|
# name=value setting permanent.
|
||||||
|
|
||||||
-upgrade-package Use when upgrading from pre-built package.
|
create=; set_perms=; upgrade_perms=; upgrade_conf=; first_install_reminder=
|
||||||
|
|
||||||
-first-install-reminder Remind of mandatory configuration steps.
|
|
||||||
|
|
||||||
config_directory Must be an absolute path name."
|
|
||||||
|
|
||||||
# Process command-line settings
|
|
||||||
|
|
||||||
for arg
|
for arg
|
||||||
do
|
do
|
||||||
case $arg in
|
case $arg in
|
||||||
-create) create=1;;
|
*=*) SAVED_IFS="$IFS"; IFS= eval $arg; IFS="$SAVED_IFS";;
|
||||||
-set-perm*) create=1; set_perms=1;;
|
create-missing) create=1;;
|
||||||
-upgrade-perm*) create=1; upgrade_perms=1;;
|
set-perm*) create=1; set_perms=1;;
|
||||||
-upgrade-conf*) upgrade_conf=1;;
|
upgrade-perm*) create=1; upgrade_perms=1;;
|
||||||
-upgrade-source) create=1; upgrade_conf=1; upgrade_perms=1;;
|
upgrade-conf*) upgrade_conf=1;;
|
||||||
-upgrade-package) create=1; upgrade_conf=1; set_perms=1;;
|
upgrade-source) create=1; upgrade_conf=1; upgrade_perms=1;;
|
||||||
-first-install*) first_install_reminder=1;;
|
upgrade-package) create=1; upgrade_conf=1; set_perms=1;;
|
||||||
/*) config_dir=$1;;
|
first-install*) first_install_reminder=1;;
|
||||||
"") break;;
|
"") break;;
|
||||||
*) echo "Error: $USAGE" 1>&2; exit 1;;
|
*) echo "Error: $USAGE" 1>&2; exit 1;;
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
@@ -124,18 +132,19 @@ test -n "$create$upgrade_conf$first_install_reminder" || {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
test -n "$config_dir" || {
|
test -n "$config_directory" || {
|
||||||
echo "Error: $USAGE" 1>&2
|
echo "Error: no config_directory parameter setting." 1>&2
|
||||||
|
echo "$USAGE" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
test -d "$config_dir" || {
|
test -d "$config_directory" || {
|
||||||
echo Error: $config_dir is not a directory. 1>&2
|
echo Error: $config_directory is not a directory. 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
test -f $config_dir/postfix-files || {
|
test -f $config_directory/postfix-files || {
|
||||||
Error: $config_dir/postfix-files is not a file. 1>&2
|
Error: $config_directory/postfix-files is not a file. 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,37 +159,63 @@ else
|
|||||||
CHATTR=echo
|
CHATTR=echo
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Use file/directory status information in $config_dir/postfix-files.
|
# Bootstrapping problem.
|
||||||
|
|
||||||
|
if [ -n "$command_directory" ]
|
||||||
|
then
|
||||||
|
POSTCONF="$command_directory/postconf"
|
||||||
|
else
|
||||||
|
POSTCONF="postconf"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Settings from main.cf must override command line or environment settings.
|
||||||
|
|
||||||
|
for name in daemon_directory command_directory queue_directory mail_owner \
|
||||||
|
setgid_group sendmail_path newaliases_path mailq_path manpage_path
|
||||||
|
do
|
||||||
|
eval $name=\`$POSTCONF -c $config_directory -h $name\` || kill $$
|
||||||
|
done
|
||||||
|
|
||||||
|
POSTCONF="$command_directory/postconf"
|
||||||
|
|
||||||
|
# Use file/directory status information in $config_directory/postfix-files.
|
||||||
|
|
||||||
test -n "$create" && {
|
test -n "$create" && {
|
||||||
IFS=:
|
while IFS=: read path type owner group mode upgrade_flag create_flag junk
|
||||||
while read path type owner group mode upgrade_flag create_flag junk
|
|
||||||
do
|
do
|
||||||
set_permission=
|
set_permission=
|
||||||
case $path in
|
case $path in
|
||||||
/*) # Create missing directories with proper owner/group/mode settings.
|
[$]*) eval path=$path;;
|
||||||
if [ -n "$create" -a "$type" = "d" -a -n "$create_flag" -a ! -d "$path" ]
|
/*) ;;
|
||||||
then
|
*) continue;;
|
||||||
mkdir $path || exit 1
|
|
||||||
$CHATTR $path >/dev/null 2>/dev/null
|
|
||||||
set_permission=1
|
|
||||||
# Update all owner/group/mode settings.
|
|
||||||
elif [ -n "$set_perms" ]
|
|
||||||
then
|
|
||||||
set_permission=1
|
|
||||||
# Update obsolete owner/group/mode settings.
|
|
||||||
elif [ -n "$upgrade_perms" -a -n "$upgrade_flag" ]
|
|
||||||
then
|
|
||||||
set_permission=1
|
|
||||||
fi
|
|
||||||
test -n "$set_permission" && {
|
|
||||||
chown $owner $path || exit 1
|
|
||||||
test -z "$group" || chgrp $group $path || exit 1
|
|
||||||
chmod $mode $path || exit 1
|
|
||||||
}
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
done <$config_dir/postfix-files
|
case $owner in
|
||||||
|
[$]*) eval owner=$owner;;
|
||||||
|
esac
|
||||||
|
case $group in
|
||||||
|
[$]*) eval group=$group;;
|
||||||
|
esac
|
||||||
|
# Create missing directories with proper owner/group/mode settings.
|
||||||
|
if [ -n "$create" -a "$type" = "d" -a -n "$create_flag" -a ! -d "$path" ]
|
||||||
|
then
|
||||||
|
mkdir $path || exit 1
|
||||||
|
$CHATTR $path >/dev/null 2>/dev/null
|
||||||
|
set_permission=1
|
||||||
|
# Update all owner/group/mode settings.
|
||||||
|
elif [ -n "$set_perms" ]
|
||||||
|
then
|
||||||
|
set_permission=1
|
||||||
|
# Update obsolete owner/group/mode settings.
|
||||||
|
elif [ -n "$upgrade_perms" -a -n "$upgrade_flag" ]
|
||||||
|
then
|
||||||
|
set_permission=1
|
||||||
|
fi
|
||||||
|
test -n "$set_permission" && {
|
||||||
|
chown $owner $path || exit 1
|
||||||
|
test -z "$group" || chgrp $group $path || exit 1
|
||||||
|
chmod $mode $path || exit 1
|
||||||
|
}
|
||||||
|
done <$config_directory/postfix-files
|
||||||
}
|
}
|
||||||
|
|
||||||
# Upgrade existing Postfix configuration files if necessary.
|
# Upgrade existing Postfix configuration files if necessary.
|
||||||
@@ -189,9 +224,9 @@ test -n "$upgrade_conf" && {
|
|||||||
|
|
||||||
# Add missing flush service to master.cf.
|
# Add missing flush service to master.cf.
|
||||||
|
|
||||||
grep 'flush.*flush' $config_dir/master.cf >/dev/null || {
|
grep 'flush.*flush' $config_directory/master.cf >/dev/null || {
|
||||||
echo Editing $config_dir/master.cf, adding missing entry for flush service
|
echo Editing $config_directory/master.cf, adding missing entry for flush service
|
||||||
cat >>$config_dir/master.cf <<EOF
|
cat >>$config_directory/master.cf <<EOF
|
||||||
flush unix - - n 1000? 0 flush
|
flush unix - - n 1000? 0 flush
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
@@ -199,9 +234,9 @@ EOF
|
|||||||
# Change privileged pickup service into unprivileged.
|
# Change privileged pickup service into unprivileged.
|
||||||
|
|
||||||
grep "^pickup[ ]*fifo[ ]*n[ ]*n" \
|
grep "^pickup[ ]*fifo[ ]*n[ ]*n" \
|
||||||
$config_dir/master.cf >/dev/null && {
|
$config_directory/master.cf >/dev/null && {
|
||||||
echo Editing $config_dir/master.cf, making the pickup service unprivileged
|
echo Editing $config_directory/master.cf, making the pickup service unprivileged
|
||||||
ed $config_dir/master.cf <<EOF
|
ed $config_directory/master.cf <<EOF
|
||||||
/^pickup[ ]*fifo[ ]*n[ ]*n/
|
/^pickup[ ]*fifo[ ]*n[ ]*n/
|
||||||
s/\(n[ ]*\)n/\1-/
|
s/\(n[ ]*\)n/\1-/
|
||||||
p
|
p
|
||||||
@@ -215,9 +250,9 @@ EOF
|
|||||||
for name in cleanup flush
|
for name in cleanup flush
|
||||||
do
|
do
|
||||||
grep "^$name[ ]*unix[ ]*-" \
|
grep "^$name[ ]*unix[ ]*-" \
|
||||||
$config_dir/master.cf >/dev/null && {
|
$config_directory/master.cf >/dev/null && {
|
||||||
echo Editing $config_dir/master.cf, making the $name service public
|
echo Editing $config_directory/master.cf, making the $name service public
|
||||||
ed $config_dir/master.cf <<EOF
|
ed $config_directory/master.cf <<EOF
|
||||||
/^$name[ ]*unix[ ]*-/
|
/^$name[ ]*unix[ ]*-/
|
||||||
s/-/n/
|
s/-/n/
|
||||||
p
|
p
|
||||||
@@ -236,7 +271,7 @@ EOF
|
|||||||
# If you don't want slow mailq, be sure to hash defer and deferred,
|
# If you don't want slow mailq, be sure to hash defer and deferred,
|
||||||
# because those two directories can contain lots of files.
|
# because those two directories can contain lots of files.
|
||||||
|
|
||||||
found=`bin/postconf -c $config_dir -h hash_queue_names`
|
found=`$POSTCONF -c $config_directory -h hash_queue_names`
|
||||||
missing=
|
missing=
|
||||||
(echo "$found" | grep active >/dev/null) || missing="$missing active"
|
(echo "$found" | grep active >/dev/null) || missing="$missing active"
|
||||||
(echo "$found" | grep bounce >/dev/null) || missing="$missing bounce"
|
(echo "$found" | grep bounce >/dev/null) || missing="$missing bounce"
|
||||||
@@ -246,7 +281,7 @@ EOF
|
|||||||
(echo "$found" | grep deferred>/dev/null)|| missing="$missing deferred"
|
(echo "$found" | grep deferred>/dev/null)|| missing="$missing deferred"
|
||||||
test -n "$missing" && {
|
test -n "$missing" && {
|
||||||
echo fixing main.cf hash_queue_names for missing $missing
|
echo fixing main.cf hash_queue_names for missing $missing
|
||||||
bin/postconf -c $config_dir -e hash_queue_names="$found$missing"
|
$POSTCONF -c $config_directory -e hash_queue_names="$found$missing"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -255,12 +290,12 @@ EOF
|
|||||||
|
|
||||||
test -n "$first_install_reminder" && {
|
test -n "$first_install_reminder" && {
|
||||||
|
|
||||||
ALIASES=`postconf -h alias_database | sed 's/^[^:]*://'`
|
ALIASES=`$POSTCONF -h alias_database | sed 's/^[^:]*://'`
|
||||||
NEWALIASES_PATH=`postconf -h newaliases_path`
|
NEWALIASES_PATH=`$POSTCONF -h newaliases_path`
|
||||||
cat <<EOF 1>&2
|
cat <<EOF 1>&2
|
||||||
|
|
||||||
Warning: you still need to edit myorigin/mydestination/mynetworks
|
Warning: you still need to edit myorigin/mydestination/mynetworks
|
||||||
parameter settings in $config_dir/main.cf.
|
parameter settings in $config_directory/main.cf.
|
||||||
|
|
||||||
See also http://www.postfix.org/faq.html for information about
|
See also http://www.postfix.org/faq.html for information about
|
||||||
dialup sites or about sites inside a firewalled network.
|
dialup sites or about sites inside a firewalled network.
|
||||||
|
@@ -164,7 +164,7 @@ check)
|
|||||||
\( -perm -020 -o -perm -002 \) -type f \
|
\( -perm -020 -o -perm -002 \) -type f \
|
||||||
-exec $WARN group or other writable: {} \;
|
-exec $WARN group or other writable: {} \;
|
||||||
|
|
||||||
$SHELL $config_directory/post-install -create $config_directory || {
|
$SHELL $config_directory/post-install create-missing || {
|
||||||
$WARN unable to create missing queue directories
|
$WARN unable to create missing queue directories
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
@@ -142,13 +142,17 @@
|
|||||||
umask 022
|
umask 022
|
||||||
PATH=/bin:/usr/bin:/usr/sbin:/usr/etc:/sbin:/etc:/usr/contrib/bin:/usr/gnu/bin:/usr/ucb:/usr/bsd
|
PATH=/bin:/usr/bin:/usr/sbin:/usr/etc:/sbin:/etc:/usr/contrib/bin:/usr/gnu/bin:/usr/ucb:/usr/bsd
|
||||||
SHELL=/bin/sh
|
SHELL=/bin/sh
|
||||||
|
IFS="
|
||||||
|
"
|
||||||
|
|
||||||
# Process command-line options and parameter settings.
|
# Process command-line options and parameter settings. Work around
|
||||||
|
# brain damaged shells. "name=value command" should not make the
|
||||||
|
# name=value setting permanent.
|
||||||
|
|
||||||
for arg
|
for arg
|
||||||
do
|
do
|
||||||
case $arg in
|
case $arg in
|
||||||
*=*) IFS= eval $arg;;
|
*=*) SAVED_IFS="$IFS"; IFS= eval $arg; IFS="$SAVED_IFS";;
|
||||||
-non-interactive) non_interactive=1;;
|
-non-interactive) non_interactive=1;;
|
||||||
*) echo Error: usage: $0 [-non-interactive] name=value ... 1>&2
|
*) echo Error: usage: $0 [-non-interactive] name=value ... 1>&2
|
||||||
exit 1;;
|
exit 1;;
|
||||||
@@ -509,26 +513,26 @@ cat <<EOF >$CONFIG_DIRECTORY/postfix-files || exit 1
|
|||||||
# update=update owner/group/mode (upgrade mode).
|
# update=update owner/group/mode (upgrade mode).
|
||||||
# create=create missing directory.
|
# create=create missing directory.
|
||||||
#
|
#
|
||||||
$config_directory:d:root::755:u
|
\$config_directory:d:root::755:u
|
||||||
$daemon_directory:d:root::755:u
|
\$daemon_directory:d:root::755:u
|
||||||
$queue_directory:d:root::755:u
|
\$queue_directory:d:root::755:u:c
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Generate instructions only for queue subdirectories.
|
# Generate instructions only for queue subdirectories.
|
||||||
|
|
||||||
for dir in active bounce corrupt defer deferred flush incoming private saved
|
for dir in active bounce corrupt defer deferred flush incoming private saved
|
||||||
do
|
do
|
||||||
echo $queue_directory/$dir:d:$mail_owner::700:u:c \
|
echo \$queue_directory/$dir:d:\$mail_owner::700:u:c \
|
||||||
>>$CONFIG_DIRECTORY/postfix-files || exit 1
|
>>$CONFIG_DIRECTORY/postfix-files || exit 1
|
||||||
done
|
done
|
||||||
|
|
||||||
echo $queue_directory/maildrop:d:$mail_owner:$setgid_group:730:u:c \
|
echo \$queue_directory/maildrop:d:\$mail_owner:\$setgid_group:730:u:c \
|
||||||
>>$CONFIG_DIRECTORY/postfix-files || exit 1
|
>>$CONFIG_DIRECTORY/postfix-files || exit 1
|
||||||
|
|
||||||
echo $queue_directory/public:d:$mail_owner:$setgid_group:710:u:c \
|
echo \$queue_directory/public:d:\$mail_owner:\$setgid_group:710:u:c \
|
||||||
>>$CONFIG_DIRECTORY/postfix-files || exit 1
|
>>$CONFIG_DIRECTORY/postfix-files || exit 1
|
||||||
|
|
||||||
echo $queue_directory/pid:d:root::755:u:c \
|
echo \$queue_directory/pid:d:root::755:u:c \
|
||||||
>>$CONFIG_DIRECTORY/postfix-files || exit 1
|
>>$CONFIG_DIRECTORY/postfix-files || exit 1
|
||||||
|
|
||||||
# Install daemon programs.
|
# Install daemon programs.
|
||||||
@@ -536,7 +540,7 @@ echo $queue_directory/pid:d:root::755:u:c \
|
|||||||
for file in `censored_ls libexec`
|
for file in `censored_ls libexec`
|
||||||
do
|
do
|
||||||
compare_or_replace $EXE libexec/$file $DAEMON_DIRECTORY/$file || exit 1
|
compare_or_replace $EXE libexec/$file $DAEMON_DIRECTORY/$file || exit 1
|
||||||
echo $daemon_directory/$file:f:root::755 \
|
echo \$daemon_directory/$file:f:root::755 \
|
||||||
>>$CONFIG_DIRECTORY/postfix-files || exit 1
|
>>$CONFIG_DIRECTORY/postfix-files || exit 1
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -545,7 +549,7 @@ done
|
|||||||
for file in `censored_ls bin | grep '^post' | egrep -v '^post(drop|queue)$'`
|
for file in `censored_ls bin | grep '^post' | egrep -v '^post(drop|queue)$'`
|
||||||
do
|
do
|
||||||
compare_or_replace $EXE bin/$file $COMMAND_DIRECTORY/$file || exit 1
|
compare_or_replace $EXE bin/$file $COMMAND_DIRECTORY/$file || exit 1
|
||||||
echo $command_directory/$file:f:root::755 \
|
echo \$command_directory/$file:f:root::755 \
|
||||||
>>$CONFIG_DIRECTORY/postfix-files || exit 1
|
>>$CONFIG_DIRECTORY/postfix-files || exit 1
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -557,7 +561,7 @@ then
|
|||||||
for file in postdrop postqueue
|
for file in postdrop postqueue
|
||||||
do
|
do
|
||||||
compare_or_replace $EXE bin/$file $COMMAND_DIRECTORY/$file || exit 1
|
compare_or_replace $EXE bin/$file $COMMAND_DIRECTORY/$file || exit 1
|
||||||
echo $command_directory/$file:f:root:postdrop:1755 \
|
echo \$command_directory/$file:f:root:\$setgid_group:1755 \
|
||||||
>>$CONFIG_DIRECTORY/postfix-files || exit 1
|
>>$CONFIG_DIRECTORY/postfix-files || exit 1
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
@@ -565,7 +569,7 @@ else
|
|||||||
do
|
do
|
||||||
compare_or_replace 2$EXE bin/$file $COMMAND_DIRECTORY/$file postdrop \
|
compare_or_replace 2$EXE bin/$file $COMMAND_DIRECTORY/$file postdrop \
|
||||||
|| exit 1
|
|| exit 1
|
||||||
echo $command_directory/$file:f:root:postdrop:1755 \
|
echo \$command_directory/$file:f:root:\$setgid_group:1755 \
|
||||||
>>$CONFIG_DIRECTORY/postfix-files || exit 1
|
>>$CONFIG_DIRECTORY/postfix-files || exit 1
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
@@ -577,9 +581,9 @@ test -f bin/sendmail && {
|
|||||||
compare_or_symlink $SENDMAIL_PATH $NEWALIASES_PATH
|
compare_or_symlink $SENDMAIL_PATH $NEWALIASES_PATH
|
||||||
compare_or_symlink $SENDMAIL_PATH $MAILQ_PATH
|
compare_or_symlink $SENDMAIL_PATH $MAILQ_PATH
|
||||||
cat <<EOF >>$CONFIG_DIRECTORY/postfix-files || exit 1
|
cat <<EOF >>$CONFIG_DIRECTORY/postfix-files || exit 1
|
||||||
$sendmail_path:f:root::755
|
\$sendmail_path:f:root::755
|
||||||
$newaliases_path:f:root::755
|
\$newaliases_path:f:root::755
|
||||||
$mailq_path:f:root::755
|
\$mailq_path:f:root::755
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -596,19 +600,19 @@ else
|
|||||||
do
|
do
|
||||||
compare_or_replace 644 conf/$file $CONFIG_DIRECTORY/$file || exit 1
|
compare_or_replace 644 conf/$file $CONFIG_DIRECTORY/$file || exit 1
|
||||||
done
|
done
|
||||||
test -z "$install_root" && need_config="-create -first-install"
|
test -z "$install_root" && need_config="create-missing first-install"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for file in `censored_ls conf | egrep -v 'postfix-script|post-install'`
|
for file in `censored_ls conf | egrep -v 'postfix-script|post-install'`
|
||||||
do
|
do
|
||||||
echo $config_directory/$file:f:root::644 \
|
echo \$config_directory/$file:f:root::644 \
|
||||||
>>$CONFIG_DIRECTORY/postfix-files || exit 1
|
>>$CONFIG_DIRECTORY/postfix-files || exit 1
|
||||||
done
|
done
|
||||||
|
|
||||||
for file in postfix-script post-install
|
for file in postfix-script post-install
|
||||||
do
|
do
|
||||||
compare_or_replace $EXE conf/$file $CONFIG_DIRECTORY/$file || exit 1
|
compare_or_replace $EXE conf/$file $CONFIG_DIRECTORY/$file || exit 1
|
||||||
echo $config_directory/$file:f:root::755 \
|
echo \$config_directory/$file:f:root::755 \
|
||||||
>>$CONFIG_DIRECTORY/postfix-files || exit 1
|
>>$CONFIG_DIRECTORY/postfix-files || exit 1
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -635,7 +639,7 @@ bin/postconf -c $CONFIG_DIRECTORY -e \
|
|||||||
for file in `censored_ls man?/*`
|
for file in `censored_ls man?/*`
|
||||||
do
|
do
|
||||||
compare_or_replace 644 $file $MANPAGE_PATH/$file || exit 1
|
compare_or_replace 644 $file $MANPAGE_PATH/$file || exit 1
|
||||||
echo "$manpage_path/$file:f:root::644" \
|
echo \$manpage_path/$file:f:root::644 \
|
||||||
>>$CONFIG_DIRECTORY/postfix-files || exit 1
|
>>$CONFIG_DIRECTORY/postfix-files || exit 1
|
||||||
done)
|
done)
|
||||||
|
|
||||||
@@ -645,4 +649,6 @@ bin/postconf -c $CONFIG_DIRECTORY -e \
|
|||||||
|
|
||||||
test -n "$install_root" && exit 0
|
test -n "$install_root" && exit 0
|
||||||
|
|
||||||
${SHELL} conf/post-install ${need_config-"-upgrade-source"} $config_directory
|
export command_directory config_directory
|
||||||
|
|
||||||
|
${SHELL} conf/post-install ${need_config-"upgrade-source"}
|
||||||
|
@@ -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-20020110"
|
#define DEF_MAIL_VERSION "Snapshot-20020111"
|
||||||
extern char *var_mail_version;
|
extern char *var_mail_version;
|
||||||
|
|
||||||
/* LICENSE
|
/* LICENSE
|
||||||
|
@@ -44,6 +44,7 @@
|
|||||||
/* System library. */
|
/* System library. */
|
||||||
|
|
||||||
#include <sys_defs.h>
|
#include <sys_defs.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
@@ -68,6 +69,7 @@ int mail_flow_get(int len)
|
|||||||
{
|
{
|
||||||
char *myname = "mail_flow_get";
|
char *myname = "mail_flow_get";
|
||||||
char buf[BUFFER_SIZE];
|
char buf[BUFFER_SIZE];
|
||||||
|
struct stat st;
|
||||||
int count;
|
int count;
|
||||||
int n = 0;
|
int n = 0;
|
||||||
|
|
||||||
@@ -78,8 +80,14 @@ int mail_flow_get(int len)
|
|||||||
msg_panic("%s: bad length %d", myname, len);
|
msg_panic("%s: bad length %d", myname, len);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Read and discard N bytes. XXX AIX read() returns 0 when the pipe is
|
* Silence some wild claims.
|
||||||
* empty.
|
*/
|
||||||
|
if (fstat(MASTER_FLOW_WRITE, &st) < 0)
|
||||||
|
msg_fatal("fstat flow pipe write descriptor: %m");
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Read and discard N bytes. XXX AIX read() can return 0 when an open
|
||||||
|
* pipe is empty.
|
||||||
*/
|
*/
|
||||||
for (count = len; count > 0; count -= n)
|
for (count = len; count > 0; count -= n)
|
||||||
if ((n = read(MASTER_FLOW_READ, buf, count > BUFFER_SIZE ?
|
if ((n = read(MASTER_FLOW_READ, buf, count > BUFFER_SIZE ?
|
||||||
|
Reference in New Issue
Block a user