Commit 036dfefb authored by Vladimir Bashkirtsev's avatar Vladimir Bashkirtsev

/run is not safe to store unix sockets - use /var/lib/cyrus/socket instead

parent bb3a21c9
...@@ -35,13 +35,12 @@ all: cyrus-config imapd-config cyrus-imapd-service services ...@@ -35,13 +35,12 @@ all: cyrus-config imapd-config cyrus-imapd-service services
chown cyrus:mail /var/lib/cyrus/server.pem chown cyrus:mail /var/lib/cyrus/server.pem
sudo -u cyrus cyrus-imapd-3.2.3/tools/mkimap sudo -u cyrus cyrus-imapd-3.2.3/tools/mkimap
@echo "d /run/cyrus 755 cyrus mail -" > /usr/lib/tmpfiles.d/cyrus.conf @echo "d /run/cyrus 755 cyrus mail -" > /usr/lib/tmpfiles.d/cyrus.conf
@echo "d /run/cyrus/socket 750 cyrus mail -" > /usr/lib/tmpfiles.d/cyrus-socket.conf
@echo "$$CYRUS_IMAPD_SERVICE" > /lib/systemd/system/cyrus-imapd.service @echo "$$CYRUS_IMAPD_SERVICE" > /lib/systemd/system/cyrus-imapd.service
systemctl enable cyrus-imapd.service systemctl enable cyrus-imapd.service
if [ -f "/etc/mail/sendmail.mc" ]; then \ if [ -f "/etc/mail/sendmail.mc" ]; then \
cd /etc/mail ; \ cd /etc/mail ; \
sed -i "x;/./{x;b};x;/^MAILER(/h;//idefine(\`confLOCAL_MAILER', \`cyrusv2')dnl" sendmail.mc ; \ sed -i "x;/./{x;b};x;/^MAILER(/h;//idefine(\`confLOCAL_MAILER', \`cyrusv2')dnl" sendmail.mc ; \
sed -i "x;/./{x;b};x;/^MAILER(/h;//idefine(\`CYRUSV2_MAILER_ARGS',\`FILE /run/cyrus/socket/lmtp')dnl" sendmail.mc ; \ sed -i "x;/./{x;b};x;/^MAILER(/h;//idefine(\`CYRUSV2_MAILER_ARGS',\`FILE /var/lib/cyrus/socket/lmtp')dnl" sendmail.mc ; \
echo "MAILER(\`cyrusv2')dnl" >> sendmail.mc ; \ echo "MAILER(\`cyrusv2')dnl" >> sendmail.mc ; \
m4 m4/cf.m4 sendmail.mc > sendmail.cf ; \ m4 m4/cf.m4 sendmail.mc > sendmail.cf ; \
fi fi
...@@ -56,7 +55,7 @@ START { ...@@ -56,7 +55,7 @@ START {
recover cmd="ctl_cyrusdb -r" recover cmd="ctl_cyrusdb -r"
} }
# UNIX sockets start with a slash and are put into /run/cyrus/socket # UNIX sockets start with a slash and are put into /var/lib/cyrus/socket
SERVICES { SERVICES {
# add or remove based on preferences # add or remove based on preferences
imap cmd="imapd" listen="imap" prefork=0 imap cmd="imapd" listen="imap" prefork=0
...@@ -75,13 +74,13 @@ SERVICES { ...@@ -75,13 +74,13 @@ SERVICES {
# at least one LMTP is required for delivery # at least one LMTP is required for delivery
# lmtp cmd="lmtpd" listen="lmtp" prefork=0 # lmtp cmd="lmtpd" listen="lmtp" prefork=0
lmtpunix cmd="lmtpd" listen="/run/cyrus/socket/lmtp" prefork=0 lmtpunix cmd="lmtpd" listen="/var/lib/cyrus/socket/lmtp" prefork=0
# this is requied if using socketmap # this is requied if using socketmap
# smmap cmd="smmapd" listen="/run/cyrus/socket/smmap" prefork=0 # smmap cmd="smmapd" listen="/var/lib/cyrus/socket/smmap" prefork=0
# this is required if using notifications # this is required if using notifications
# notify cmd="notifyd" listen="/run/cyrus/socket/notify" proto="udp" prefork=1 # notify cmd="notifyd" listen="/var/lib/cyrus/socket/notify" proto="udp" prefork=1
} }
EVENTS { EVENTS {
...@@ -153,9 +152,9 @@ sievedir: /var/spool/sieve ...@@ -153,9 +152,9 @@ sievedir: /var/spool/sieve
## Important: KEEP THESE IN SYNC WITH cyrus.conf ## Important: KEEP THESE IN SYNC WITH cyrus.conf
################################################################### ###################################################################
lmtpsocket: /run/cyrus/socket/lmtp lmtpsocket: /var/lib/cyrus/socket/lmtp
idlesocket: /run/cyrus/socket/idle idlesocket: /var/lib/cyrus/socket/idle
notifysocket: /run/cyrus/socket/notify notifysocket: /var/lib/cyrus/socket/notify
# Syslog prefix. Defaults to cyrus (so logging is done as cyrus/imap # Syslog prefix. Defaults to cyrus (so logging is done as cyrus/imap
# etc.) # etc.)
......
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