Commit af2d84f1 authored by benedikt.kroening's avatar benedikt.kroening
Browse files

fixed dovecot script and config

parent 0e0b5460
#service auth {
# unix_listener auth-userdb {
# mode = 0666
# user = vmail
# group = vmail
# }
#}
service stats {
unix_listener stats-writer {
user = vmail
}
unix_listener stats-reader {
user = vmail
}
}
\ No newline at end of file
......@@ -130,34 +130,27 @@ if [ ! -f ${INIT_STATE_FILE} ]; then
useradd -u 5000 -g 5000 -m -d /home/vmail -s /bin/false vmail || true
#adduser dovecot vmail
usermod -a -G vmail dovecot
# Create log dir and adjust permissions
# Create direcotries
mkdir -p /var/log/dovecot
chown -R vmail:dovecot /var/log/dovecot*
echo "Creating directory for dovecot acl informations"
mkdir -p /var/lib/dovecot/db
chmod 0770 /var/lib/dovecot
echo "Creating dictionary for shared namespace"
touch /var/lib/dovecot/db/shared-mailboxes.db
echo "Creating virtual directories"
mkdir -p /var/lib/dovecot/virtual/all
chmod -R 700 /var/lib/dovecot/virtual
echo "*
-INBOX/Trash
-INBOX/Trash/*
-INBOX/Spam
-INBOX/Spam/*
all" > /var/lib/dovecot/virtual/all/dovecot-virtual
chown -R vmail:vmail /var/lib/dovecot
LDA_PATH="/usr/lib/dovecot/dovecot-lda"
echo "dovecot unix - n n - - pipe" >> /etc/postfix/master.cf
echo " flags=DRhu user=vmail:vmail argv=${LDA_PATH} -f \${sender} -d \${user}" >> /etc/postfix/master.cf
echo "$(date)" > ${INIT_STATE_FILE}
touch /var/lib/dovecot/db/shared-mailboxes.db
fi
echo "*
-INBOX/Trash
-INBOX/Trash/*
-INBOX/Spam
-INBOX/Spam/*
all" > /var/lib/dovecot/virtual/all/dovecot-virtual
LDA_PATH="/usr/lib/dovecot/dovecot-lda"
echo "dovecot unix - n n - - pipe" >> /etc/postfix/master.cf
echo " flags=DRhu user=vmail:vmail argv=${LDA_PATH} -f \${sender} -d \${user}" >> /etc/postfix/master.cf
echo "$(date)" > ${INIT_STATE_FILE}
echo "Re-configure postfix main.cf"
postconf -e "myhostname = dovecot"
postconf -e "smtpd_use_tls = no"
......@@ -173,6 +166,13 @@ postconf -e "myorigin = \$mydomain"
postconf -e "mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 ${ENV_SUBNET}"
# set home permissions every time ...
chown -R vmail:vmail /home/vmail
chown -R vmail:vmail /var/lib/dovecot
chown -R vmail:vmail /var/log/dovecot*
chown -R vmail:vmail /var/run/dovecot/stats-*
chmod 2770 /home/vmail
chmod 0770 /var/lib/dovecot
chmod -R 700 /var/lib/dovecot/virtual
restartService postfix
restartService dovecot
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment