blob: ef7d08a67d377e16837a8455dcee5fa8ffa32876 (
plain)
1 #!/bin/sh -
2
3 name=postfix-lmdb
4
5 # owner
6 usr=postfix
7 usrgrp=${usr}
8 # group for mail submission and queue
9 queuegrp=_postfix_queue
10 # Default rights used by the local delivery agent for delivery
11 # to external file, used in absence of a recipient user context.
12 # DO NOT SPECIFY A PRIVILEGED USER OR THE POSTFIX OWNER.
13 defusr=_postfix_xlocal
14 defgrp=${defusr}
15
16 getent group mail >/dev/null || groupadd -r mail
17
18 getent group ${usrgrp} >/dev/null || groupadd -r ${usrgrp}
19 getent passwd ${usr} >/dev/null 2>&1 || {
20 useradd -r -g ${usrgrp} -d /var/spool/${usr} -s /bin/false ${usr}
21 passwd -l ${usr}
22 }
23
24 getent group ${queuegrp} >/dev/null || groupadd -r ${queuegrp}
25
26 getent group ${defgrp} >/dev/null || groupadd -r ${defgrp}
27 getent passwd ${defusr} >/dev/null 2>&1 || {
28 useradd -r -g ${defgrp} -d /var/spool/mail -s /sbin/nologin ${defusr}
29 passwd -l ${defusr}
30 }
31
32 p_i() {
33 /usr/lib/${name}/post-install \
34 install_root= \
35 command_directory=/usr/sbin \
36 config_directory=/etc/${name} \
37 daemon_directory=/usr/lib/${name} \
38 data_directory=/var/lib/${name} \
39 html_directory=no \
40 mail_spool_directory=/var/spool/mail \
41 manpage_directory=/usr/share/man \
42 meta_directory=/etc/${name} \
43 queue_directory=/var/spool/${name} \
44 readme_directory=no \
45 shlib_directory=/usr/lib/${name} \
46 "${@}"
47 }
48
49 p_i create-missing
50 p_i upgrade-permissions
51
52 /usr/sbin/postalias /etc/${name}/aliases
53
54 /usr/sbin/postmap lmdb:/etc/${name}/relay_clientcerts
55
56 /usr/sbin/postmap lmdb:/etc/${name}/client_restrict
57 /usr/sbin/postmap lmdb:/etc/${name}/sender_access
58 /usr/sbin/postmap lmdb:/etc/${name}/sender_restrict
|