9
9
# Provides: postfix mail-transport-agent
10
10
# Required-Start: $local_fs $remote_fs $syslog $named $network $time
11
11
# Required-Stop: $local_fs $remote_fs $syslog $named $network
12
# Should-Start: postgresql mysql clamav-daemon postgrey spamassassin
13
# Should-Stop: postgresql mysql clamav-daemon postgrey spamassassin
12
# Should-Start: postgresql mysql clamav-daemon postgrey spamassassin saslauthd dovecot
13
# Should-Stop: postgresql mysql clamav-daemon postgrey spamassassin saslauthd dovecot
14
14
# Default-Start: 2 3 4 5
15
15
# Default-Stop: 0 1 6
16
16
# Short-Description: start and stop the Postfix Mail Transport Agent
72
72
# Make sure that the chroot environment is set up correctly.
75
cd $(postconf -h queue_directory)
77
# if we're using tls, then we need to add etc/ssl/certs/ca-certificates.crt.
78
if [ -f "/etc/ssl/certs/ca-certificates.crt" ]; then
79
smtp_use_tls=$(postconf -h smtp_use_tls)
80
smtp_enforce_tls=$(postconf -h smtp_enforce_tls)
81
smtpd_use_tls=$(postconf -h smtpd_use_tls)
82
smtpd_enforce_tls=$(postconf -h smtpd_use_tls)
83
case :$smtp_use_tls:$smtp_enforce_tls:$smtpd_use_tls:$smtpd_enforce_tls: in
85
mkdir -p etc/ssl/certs
86
cp /etc/ssl/certs/ca-certificates.crt etc/ssl/certs/
75
queue_dir=$(postconf -h queue_directory)
78
# copy the CA path if specified
79
ca_path=$(postconf -h smtp_tls_CApath)
82
$queue_dir/*) :;; # skip stuff already in chroot
84
if test -d "$ca_path"; then
85
dest_dir="$queue_dir/${ca_path#/}" new=0
86
if test -d "$dest_dir"
87
# write to a new directory ...
88
then dest_dir="$dest_dir.NEW" && new=1
89
else mkdir --parent ${dest_dir%/*}
91
# handle files in subdirectories
92
find "$ca_path" -print0 | cpio -0pdL "$dest_dir"
93
if [ "$new" = 1 ]; then
94
# and replace the old directory
95
rm -r "${dest_dir%.NEW}"
96
mv "$dest_dir" "${dest_dir%.NEW}"
102
# if there is a CA file, copy it
103
ca_file=$(postconf -h smtp_tls_CAfile)
105
$queue_dir/*) :;; # skip stuff already in chroot
107
# or copy the bundle to preserve functionality
108
ca_bundle=/etc/ssl/certs/ca-certificates.crt
109
if [ -f $ca_bundle ]; then
110
mkdir --parent ${ca_bundle%/*}
111
cp -L "$ca_bundle" "$queue_dir/${ca_bundle%/*}"
115
if test -f "$ca_file"; then
116
dest_dir="$queue_dir/${ca_path#/}"
117
mkdir --parent "$dest_dir"
118
cp -L "$ca_file" "$dest_dir"
90
123
# if we're using unix:passwd.byname, then we need to add etc/passwd.
91
124
local_maps=$(postconf -h local_recipient_maps)
92
125
if [ "X$local_maps" != "X${local_maps#*unix:passwd.byname}" ]; then