Files
extra/opendkim/opendkim.install
2025-06-22 20:39:04 -05:00

27 lines
635 B
Plaintext

post_upgrade() {
if ! getent passwd opendkim &>/dev/null; then
useradd -r -g mail -G adm -d / -s /bin/nologin opendkim >/dev/null
fi
if ! groups opendkim | grep adm &>/dev/null; then
gpasswd -a opendkim adm >/dev/null
fi
opendkim_shell=$(getent passwd opendkim | cut -d: -f7)
if [ "$opendkim_shell" != '/bin/nologin' ]; then
chsh -s /bin/nologin opendkim &>/dev/null
fi
}
post_install() {
post_upgrade
chown -R opendkim:mail etc/opendkim
cat <<EOF
>>> Check and modify /etc/opendkim/opendkim.conf before starting
EOF
}
post_remove() {
if getent passwd opendkim &>/dev/null; then
userdel opendkim >/dev/null
fi
}