mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Merge pull request #226 from YunoHost/fix-645-conf-regen-hook-rspamd-fail-on-postinstall
[fix] new rspamd version replace rspamd.socket with rspamd.service
This commit is contained in:
commit
8e7cf7d086
5 changed files with 17 additions and 20 deletions
|
@ -9,7 +9,9 @@ do_pre_regen() {
|
||||||
|
|
||||||
install -D -m 644 rmilter.conf \
|
install -D -m 644 rmilter.conf \
|
||||||
"${pending_dir}/etc/rmilter.conf"
|
"${pending_dir}/etc/rmilter.conf"
|
||||||
install -D -m 644 rmilter.socket \
|
# Remove old socket file (we stopped using it, since rspamd 1.3.1)
|
||||||
|
# Regen-conf system need an empty file to delete it
|
||||||
|
install -D -m 644 /dev/null \
|
||||||
"${pending_dir}/etc/systemd/system/rmilter.socket"
|
"${pending_dir}/etc/systemd/system/rmilter.socket"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,17 +39,19 @@ do_post_regen() {
|
||||||
sudo chown _rmilter /etc/dkim/*.mail.key
|
sudo chown _rmilter /etc/dkim/*.mail.key
|
||||||
sudo chmod 400 /etc/dkim/*.mail.key
|
sudo chmod 400 /etc/dkim/*.mail.key
|
||||||
|
|
||||||
|
# fix rmilter socket permission (postfix is chrooted in /var/spool/postfix )
|
||||||
|
sudo mkdir -p /var/spool/postfix/run/rmilter
|
||||||
|
sudo chown -R postfix:_rmilter /var/spool/postfix/run/rmilter
|
||||||
|
sudo chmod g+w /var/spool/postfix/run/rmilter
|
||||||
|
|
||||||
[ -z "$regen_conf_files" ] && exit 0
|
[ -z "$regen_conf_files" ] && exit 0
|
||||||
|
|
||||||
# reload systemd daemon
|
# reload systemd daemon
|
||||||
[[ "$regen_conf_files" =~ rmilter\.socket ]] && {
|
sudo systemctl -q daemon-reload
|
||||||
sudo systemctl -q daemon-reload
|
|
||||||
}
|
|
||||||
|
|
||||||
# ensure that the socket is listening and stop the service - it will be
|
# Restart rmilter due to the rspamd update
|
||||||
# started again by the socket as needed
|
# https://rspamd.com/announce/2016/08/01/rspamd-1.3.1.html
|
||||||
sudo systemctl -q start rmilter.socket
|
sudo systemctl -q restart rmilter.service
|
||||||
sudo systemctl -q stop rmilter.service 2>&1 || true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FORCE=${2:-0}
|
FORCE=${2:-0}
|
||||||
|
|
|
@ -25,10 +25,9 @@ do_post_regen() {
|
||||||
sudo systemctl restart dovecot
|
sudo systemctl restart dovecot
|
||||||
}
|
}
|
||||||
|
|
||||||
# ensure that the socket is listening and stop the service - it will be
|
# Restart rspamd due to the upgrade
|
||||||
# started again by the socket as needed
|
# https://rspamd.com/announce/2016/08/01/rspamd-1.3.1.html
|
||||||
sudo systemctl -q start rspamd.socket
|
sudo systemctl -q restart rspamd.service
|
||||||
sudo systemctl -q stop rspamd.service 2>&1 || true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FORCE=${2:-0}
|
FORCE=${2:-0}
|
||||||
|
|
|
@ -141,7 +141,7 @@ smtp_reply_filter = pcre:/etc/postfix/smtp_reply_filter
|
||||||
# Rmilter
|
# Rmilter
|
||||||
milter_mail_macros = i {mail_addr} {client_addr} {client_name} {auth_authen}
|
milter_mail_macros = i {mail_addr} {client_addr} {client_name} {auth_authen}
|
||||||
milter_protocol = 6
|
milter_protocol = 6
|
||||||
smtpd_milters = inet:localhost:11000
|
smtpd_milters = unix:/run/rmilter/rmilter.sock
|
||||||
|
|
||||||
# Skip email without checking if milter has died
|
# Skip email without checking if milter has died
|
||||||
milter_default_action = accept
|
milter_default_action = accept
|
||||||
|
|
|
@ -5,8 +5,7 @@
|
||||||
# pidfile - path to pid file
|
# pidfile - path to pid file
|
||||||
pidfile = /run/rmilter/rmilter.pid;
|
pidfile = /run/rmilter/rmilter.pid;
|
||||||
|
|
||||||
# rmilter is socket-activated under systemd
|
bind_socket = unix:/var/spool/postfix/run/rmilter/rmilter.sock;
|
||||||
bind_socket = fd:3;
|
|
||||||
|
|
||||||
# DKIM signing
|
# DKIM signing
|
||||||
dkim {
|
dkim {
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
.include /lib/systemd/system/rmilter.socket
|
|
||||||
|
|
||||||
[Socket]
|
|
||||||
ListenStream=
|
|
||||||
ListenStream=127.0.0.1:11000
|
|
Loading…
Add table
Reference in a new issue