Browse Source

Added Dovecot init.d script and Set the permission for dovcot/postfix key file

bugfixes
gau1991 10 years ago
parent
commit
6945d6ada9
  1. 3
      src/modules/stack/install/mail/ee_mod_setup_dovecot.sh
  2. 2
      src/modules/stack/install/mail/ee_mod_setup_postfix.sh
  3. 72
      templates/mail/dovecot

3
src/modules/stack/install/mail/ee_mod_setup_dovecot.sh

@ -57,4 +57,7 @@ function ee_mod_setup_dovecot()
sed -i "s'/etc/dovecot/private/dovecot.pem'/etc/ssl/private/dovecot.pem'" /etc/dovecot/conf.d/10-ssl.conf \
|| ee_lib_error "Unable to setup Dovecot SSL certificate path, exit status = " $?
# Setting Dovecot init.d script
cp -v /usr/share/easyengine/mail/dovecot /etc/init.d/dovecot &>> $EE_COMMAND_LOG \
}

2
src/modules/stack/install/mail/ee_mod_setup_postfix.sh

@ -53,6 +53,8 @@ function ee_mod_setup_postfix()
# Configure self signed SSL for Postfix
ee_lib_echo "Generating self signed certificate for Postfix, please wait..."
openssl req -new -x509 -days 3650 -nodes -subj /commonName=${EE_HOSTNAME}/emailAddress=${EE_EMAIL} -out /etc/ssl/certs/postfix.pem -keyout /etc/ssl/private/postfix.pem &>> $EE_COMMAND_LOG
chmod 0600 /etc/ssl/private/postfix.pem
postconf -e smtpd_tls_cert_file=/etc/ssl/certs/postfix.pem
postconf -e smtpd_tls_key_file=/etc/ssl/private/postfix.pem

72
templates/mail/dovecot

@ -0,0 +1,72 @@
### BEGIN INIT INFO
# Provides: dovecot
# Required-Start: $local_fs $remote_fs $network $syslog $time
# Required-Stop: $local_fs $remote_fs $network $syslog
# Should-Start: postgresql mysql slapd winbind
# Should-Stop: postgresql mysql slapd winbind
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Dovecot init script
# Description: Init script for dovecot services
### END INIT INFO
# Example /etc/init.d/dovecot script. Change DAEMON if necessary.
# License is public domain.
DAEMON=/usr/sbin/dovecot
# Uncomment to allow Dovecot daemons to produce core dumps.
#ulimit -c unlimited
test -x $DAEMON || exit 1
set -e
base_dir=`$DAEMON config -h base_dir`
pidfile=$base_dir/master.pid
if test -f $pidfile; then
running=yes
else
running=no
fi
case "$1" in
start)
echo -n "Starting Dovecot"
$DAEMON
echo "."
;;
stop)
if test $running = yes; then
echo "Stopping Dovecot"
kill `cat $pidfile`
echo "."
else
echo "Dovecot is already stopped."
fi
;;
reload)
if test $running = yes; then
echo -n "Reloading Dovecot configuration"
kill -HUP `cat $pidfile`
echo "."
else
echo "Dovecot isn't running."
fi
;;
restart|force-reload)
echo -n "Restarting Dovecot"
if test $running = yes; then
kill `cat $pidfile`
sleep 1
fi
$DAEMON
echo "."
;;
*)
echo "Usage: /etc/init.d/dovecot {start|stop|reload|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
Loading…
Cancel
Save