-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.sh
More file actions
executable file
·74 lines (59 loc) · 1.99 KB
/
init.sh
File metadata and controls
executable file
·74 lines (59 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
echo " RUNNING INIT"
mkdir -p /etc/myssl
mkdir -p /var/vmail
mkdir -p /etc/vmail/mailboxes/
mkdir -p /etc/vmail/sieve/global
mkdir -p /etc/postfix/sql/
mkdir -p /etc/postfix/ptroverride/
mkdir -p /etc/opendkim/keys
#copy static config files
cp /config_files/amavisd-milter.service /etc/systemd/system/amavisd-milter.service
cp /care_scripts/spampipe.sh /etc/vmail/spampipe.sh
cp /config_files/spam-global.sieve /etc/vmail/sieve/global/spam-global.sieve
cp /config_files/opendkim.conf /etc/opendkim.conf
cp /config_files/submission_header_cleanup /etc/postfix/submission_header_cleanup
#create some files
#ptr overrride
touch /etc/postfix/ptroverride/without_ptr
touch /etc/postfix/ptroverride/postscreen_access
touch /var/log/mail.log
adduser --disabled-login --disabled-password --gecos "" --home /etc/vmail/ vmail
#chown/chmod/chgrp
chown -R vmail:vmail /etc/vmail/
chgrp -R vmail /etc/vmail/
chmod -R 770 /etc/vmail/
chmod -R 660 /etc/postfix/sql
chown vmail:vmail /etc/vmail/spampipe.sh
chmod +u+x /etc/vmail/spampipe.sh
chmod +u+x /care_scripts/sa-care.sh
#Install CRON
crontab -l > mycron
echo "@daily FILE=`mktemp` ; openssl dhparam 2048 -out $FILE && mv -f $FILE /etc/myssl/dh2048.pem" >> mycron
echo "@daily /care_scripts/sa-care.sh" >> mycron
crontab mycron
rm mycron
#Execute one time
FILE=`mktemp` ; openssl dhparam 2048 -out $FILE && mv -f $FILE /etc/myssl/dh2048.pem
/care_scripts/sa-care.sh
postmap /etc/postfix/ptroverride/without_ptr
service postfix reload
newaliases
#OPENDKIM
usermod -aG opendkim postfix
#AMAVISD-MILTER COMPILIEREN
#wget 'https://github.com/ThomasLeister/amavisd-milter/archive/master.zip' -O amavisd-milter.zip
#unzip amavisd-milter.zip
#cd amavisd-milter-master
#./configure
#make
#make install
#make clean
#cd ..
#rm -r amavisd-milter-master
#rm amavisd-milter.zip
systemctl enable amavisd-milter
#SPAMASSASSIN
setfacl -m o:--- /etc/mail/spamassassin/local.cf
setfacl -m u:vmail:r /etc/mail/spamassassin/local.cf
setfacl -m u:amavis:r /etc/mail/spamassassin/local.cf