mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[fix] Use rmilter as a socket-activated service
This commit is contained in:
parent
d2c393ea5a
commit
4b4d91c6d3
3 changed files with 24 additions and 13 deletions
|
@ -18,9 +18,12 @@ cd /usr/share/yunohost/templates/rmilter
|
||||||
# Copy Rmilter configuration
|
# Copy Rmilter configuration
|
||||||
safe_copy rmilter.conf /etc/rmilter.conf
|
safe_copy rmilter.conf /etc/rmilter.conf
|
||||||
|
|
||||||
|
# Override socket configuration
|
||||||
|
safe_copy rmilter.socket /etc/systemd/system/rmilter.socket
|
||||||
|
|
||||||
# Create the PID directory
|
# Create the PID directory
|
||||||
sudo mkdir -p /var/run/rmilter
|
sudo mkdir -p /run/rmilter
|
||||||
sudo chown _rmilter: /var/run/rmilter
|
sudo chown -hR _rmilter: /run/rmilter
|
||||||
|
|
||||||
# Create DKIM key for each YunoHost domain
|
# Create DKIM key for each YunoHost domain
|
||||||
sudo mkdir -p /etc/dkim
|
sudo mkdir -p /etc/dkim
|
||||||
|
@ -38,4 +41,7 @@ for domain in $domain_list; do
|
||||||
sudo chmod 400 /etc/dkim/$domain.mail.key
|
sudo chmod 400 /etc/dkim/$domain.mail.key
|
||||||
done
|
done
|
||||||
|
|
||||||
sudo service rmilter restart
|
# Reload systemd daemon and stop rmilter service to take into account the
|
||||||
|
# new configuration. It will be started again by the socket as needed.
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
sudo systemctl stop rmilter.service 2>&1 || true
|
||||||
|
|
|
@ -2,17 +2,17 @@
|
||||||
|
|
||||||
.include /etc/rmilter.conf.common
|
.include /etc/rmilter.conf.common
|
||||||
|
|
||||||
pidfile = /var/run/rmilter/rmilter.pid;
|
# pidfile - path to pid file
|
||||||
|
pidfile = /run/rmilter/rmilter.pid;
|
||||||
|
|
||||||
# listen on TCP socket
|
# rmilter is socket-activated under systemd
|
||||||
bind_socket = inet:11000@localhost;
|
bind_socket = fd:3;
|
||||||
|
|
||||||
# DKIM signing
|
# DKIM signing
|
||||||
dkim {
|
dkim {
|
||||||
domain {
|
domain {
|
||||||
key = /etc/dkim;
|
key = /etc/dkim;
|
||||||
domain = "*";
|
domain = "*";
|
||||||
selector = "mail";
|
selector = "mail";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
5
data/templates/rmilter/rmilter.socket
Normal file
5
data/templates/rmilter/rmilter.socket
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
.include /lib/systemd/system/rmilter.socket
|
||||||
|
|
||||||
|
[Socket]
|
||||||
|
ListenStream=
|
||||||
|
ListenStream=127.0.0.1:11000
|
Loading…
Add table
Reference in a new issue