59 lines
1.6 KiB
Bash
59 lines
1.6 KiB
Bash
#!/bin/sh -
|
|
|
|
name=postfix-lmdb
|
|
|
|
# owner
|
|
usr=postfix
|
|
usrgrp=${usr}
|
|
# group for mail submission and queue
|
|
queuegrp=_postfix_queue
|
|
# Default rights used by the local delivery agent for delivery
|
|
# to external file, used in absence of a recipient user context.
|
|
# DO NOT SPECIFY A PRIVILEGED USER OR THE POSTFIX OWNER.
|
|
defusr=_postfix_xlocal
|
|
defgrp=${defusr}
|
|
|
|
getent group mail >/dev/null || groupadd -r mail
|
|
|
|
getent group ${usrgrp} >/dev/null || groupadd -r ${usrgrp}
|
|
getent passwd ${usr} >/dev/null 2>&1 || {
|
|
useradd -r -g ${usrgrp} -d /var/spool/${name} -s /bin/false ${usr}
|
|
passwd -l ${usr}
|
|
}
|
|
|
|
getent group ${queuegrp} >/dev/null || groupadd -r ${queuegrp}
|
|
|
|
getent group ${defgrp} >/dev/null || groupadd -r ${defgrp}
|
|
getent passwd ${defusr} >/dev/null 2>&1 || {
|
|
useradd -r -g ${defgrp} -d /var/spool/mail -s /sbin/nologin ${defusr}
|
|
passwd -l ${defusr}
|
|
}
|
|
|
|
p_i() {
|
|
/usr/lib/${name}/post-install \
|
|
install_root= \
|
|
command_directory=/usr/sbin \
|
|
config_directory=/etc/${name} \
|
|
daemon_directory=/usr/lib/${name} \
|
|
data_directory=/var/lib/${name} \
|
|
html_directory=no \
|
|
mail_spool_directory=/var/spool/mail \
|
|
manpage_directory=/usr/share/man \
|
|
meta_directory=/etc/${name} \
|
|
queue_directory=/var/spool/${name} \
|
|
readme_directory=no \
|
|
shlib_directory=/usr/lib/${name} \
|
|
"${@}"
|
|
}
|
|
|
|
p_i create-missing
|
|
p_i upgrade-permissions
|
|
|
|
/usr/sbin/postalias /etc/${name}/aliases
|
|
|
|
/usr/sbin/postmap lmdb:/etc/${name}/relay_clientcerts
|
|
|
|
/usr/sbin/postmap lmdb:/etc/${name}/client_restrict
|
|
/usr/sbin/postmap lmdb:/etc/${name}/sender_access
|
|
/usr/sbin/postmap lmdb:/etc/${name}/sender_restrict
|