Ajout : etc/sv/sympa/ .
[lhc/ateliers.git] / etc / sv / postfix / configure.sh
1 local hint="run vm_remote postfix_key_send before"
2 assert "test -f /etc/postfix/$vm_domainname/smtpd/x509/key.pem" hint
3 #warn "lors de l'installation Debian, ne sélectionner aucune configuration pour postfix"
4 sudo debconf-set-selections <<-EOF
5 postfix postfix/main_mailer_type select No configuration
6 EOF
7 #rule apt_get_install postfix procmail
8 rule insserv_remove postfix
9 sudo install -m 640 -o root -g root /dev/stdin /etc/postfix/.gitignore <<-EOF
10 *.db
11 EOF
12 sudo install -d -m 771 -o root -g root \
13 /etc/postfix/ \
14 /etc/postfix/$vm_domainname/ \
15 /etc/postfix/$vm_domainname/smtp \
16 /etc/postfix/$vm_domainname/smtp/x509 \
17 /etc/postfix/$vm_domainname/smtp/x509/ca \
18 /etc/postfix/$vm_domainname/smtpd \
19 /etc/postfix/$vm_domainname/smtpd/x509 \
20 /etc/postfix/$vm_domainname/smtpd/x509/ca
21 sudo ln -fns \
22 ../crt+crl.self-signed.pem \
23 /etc/postfix/$vm_domainname/smtpd/x509/ca/crt.pem
24 sudo install -m 400 -o root -g root \
25 "$tool"/var/pub/x509/smtpd.$vm_domainname/crt+crl.self-signed.pem \
26 /etc/postfix/$vm_domainname/smtpd/x509/crt+crl.self-signed.pem
27 sudo install -m 400 -o root -g root \
28 "$tool"/var/pub/x509/smtpd.$vm_domainname/crt.pem \
29 /etc/postfix/$vm_domainname/smtpd/x509/crt.pem
30 sudo install -m 400 -o root -g root \
31 "$tool"/var/pub/x509/smtpd.$vm_domainname/crt+ca.pem \
32 /etc/postfix/$vm_domainname/smtpd/x509/crt+ca.pem
33 sudo install -m 400 -o root -g root \
34 "$tool"/var/pub/x509/smtpd.$vm_domainname/crt+crl.self-signed.pem \
35 /etc/postfix/$vm_domainname/smtpd/x509/crt+crl.self-signed.pem
36 sudo install -m 640 -o root -g root \
37 "$tool"/etc/postfix/$vm_domainname/header_checks \
38 /etc/postfix/$vm_domainname/header_checks
39 m4 <"$tool"/etc/postfix/aliases.m4 |
40 sudo install -m 644 -o root -g root /dev/stdin \
41 /etc/postfix/aliases
42 sudo newaliases -oA/etc/postfix/aliases
43 sudo ln -fns \
44 /etc/postfix/aliases \
45 /etc/aliases
46 cat /dev/stdin "$tool"/etc/postfix/main.cf <<-EOF |
47 mydomain = $vm_domainname
48 myorigin = \$mydomain
49 myhostname = $vm_hostname.\$mydomain
50 mail_name = \$myhostname
51 mydestination = $vm_hostname \$myhostname \$myorigin
52 EOF
53 sudo install -m 644 -o root -g root /dev/stdin \
54 /etc/postfix/main.cf
55 sudo install -m 640 -o root -g root \
56 "$tool"/etc/postfix/master.cf \
57 /etc/postfix/master.cf
58 sudo install -m 640 -o root -g root \
59 "$tool"/etc/postfix/$vm_domainname/smtp/x509/policy \
60 /etc/postfix/$vm_domainname/smtp/x509/policy
61 sudo postmap hash:/etc/postfix/$vm_domainname/smtp/x509/policy
62 sudo install -m 640 -o root -g root \
63 "$tool"/etc/postfix/$vm_domainname/smtp/header_checks \
64 /etc/postfix/$vm_domainname/smtp/header_checks
65 sudo install -m 640 -o root -g root \
66 "$tool"/etc/postfix/$vm_domainname/smtpd/sender_access \
67 /etc/postfix/$vm_domainname/smtpd/sender_access
68 sudo postmap hash:/etc/postfix/$vm_domainname/smtpd/sender_access
69 sudo install -m 640 -o root -g root \
70 "$tool"/etc/postfix/$vm_domainname/smtpd/client_blacklist \
71 /etc/postfix/$vm_domainname/smtpd/client_blacklist
72 sudo postmap hash:/etc/postfix/$vm_domainname/smtpd/client_blacklist
73 sudo install -m 640 -o root -g root \
74 "$tool"/etc/postfix/$vm_domainname/smtpd/relay_clientcerts \
75 /etc/postfix/$vm_domainname/smtpd/relay_clientcerts
76 sudo postmap hash:/etc/postfix/$vm_domainname/smtpd/relay_clientcerts
77 sudo install -m 640 -o root -g root \
78 "$tool"/etc/postfix/$vm_domainname/transport \
79 /etc/postfix/$vm_domainname/transport
80 sudo postmap hash:/etc/postfix/$vm_domainname/transport
81 sudo install -m 640 -o root -g root \
82 "$tool"/etc/postfix/$vm_domainname/virtual_alias \
83 /etc/postfix/$vm_domainname/virtual_alias
84 sudo postmap hash:/etc/postfix/$vm_domainname/virtual_alias
85 sudo install -d -m 770 -o root -g root \
86 /etc/skel/etc/mail \
87 /etc/skel/var/cache/mail \
88 /etc/skel/var/log/mail \
89 /etc/skel/var/mail
90 sudo install -m 660 -o root -g root \
91 "$tool"/etc/skel/etc/mail/delivery.procmailrc \
92 /etc/skel/etc/mail/delivery.procmailrc