-
Notifications
You must be signed in to change notification settings - Fork 14
/
.travis.yml
126 lines (121 loc) · 4.81 KB
/
.travis.yml
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
language: phyton
python:
- "2.7"
before_install:
- sudo apt-get update -qq
- sudo apt-get install -y -qq postfix libmilter-dev libmilter1.0.1 sendemail mutt
# install dependencies
- sudo pip install oletools
- sudo pip install pymilter
- sudo pip install configparser
- sudo pip install olefile
- sudo pip install email
before_script:
- sudo service postfix stop
- sudo postconf -e smtpd_milters=inet:127.0.0.1:10025
- sudo postconf -e milter_default_action=accept
- sudo postconf -e default_privs=travis
- sudo postconf
- sudo service postfix start
- sudo iptables -I INPUT -s 127.0.0.1 -j ACCEPT
- sudo iptables -I OUTPUT -s 127.0.0.1 -j ACCEPT
# install macromilter
- sudo mkdir /etc/macromilter/
- sudo mkdir -p /var/log/macromilter/
- sudo cp ./macromilter/macromilter.py /usr/bin/
- sudo cp ./travis/MacroMilter.conf /etc/init/
- sudo init-checkconf /etc/init/MacroMilter.conf
- sudo initctl log-priority debug
- sudo initctl reload-configuration
- sudo chown postfix:postfix -R /etc/macromilter
- sudo chown postfix:postfix -R /var/log/macromilter
- sudo chown postfix:postfix /usr/bin/macromilter.py
- sudo chmod +x /usr/bin/macromilter.py
- sudo cat /etc/init/MacroMilter.conf
- sudo /bin/bash ./travis/mailalias.sh
- sudo ls -la ./travis
# start tests
jobs:
include:
# Default config
- stage: Testing
script:
- sudo cp ./travis/config_1.ini /etc/macromilter/config.ini
- sudo cat /etc/macromilter/config.ini
- sudo service MacroMilter start
- sleep 10
- sudo service MacroMilter status
- /bin/bash ./travis/tests.sh
- sudo tail -n 100 /var/log/mail.log
- sudo tail -n 100 /home/travis/macromilter.log
# Zip test
- stage: Testing
script:
- sudo cp ./travis/config_1.ini /etc/macromilter/config.ini
- sudo cat /etc/macromilter/config.ini
- sudo service MacroMilter restart
- sleep 10
- sudo service MacroMilter status
- /bin/bash ./travis/tests_zip.sh
- sudo tail -n 100 /var/log/mail.log
- sudo tail -n 100 /home/travis/macromilter.log
# encrypted zip
- stage: Testing
script:
- sudo cp ./travis/config_1.ini /etc/macromilter/config.ini
- sudo cat /etc/macromilter/config.ini
- sudo service MacroMilter restart
- sleep 10
- sudo service MacroMilter status
- sendemail -f travis@localhost -t test@localhost -m "test" -s localhost -u "test" -a ./test_mails/encrypted.zip -v
- sudo tail -n 100 /var/log/mail.log
- sudo tail -n 100 /home/travis/macromilter.log
# Macro wihtelist
- stage: Testing
script:
- sudo cp ./travis/config_2.ini /etc/macromilter/config.ini
- sudo cat /etc/macromilter/config.ini
- sudo service MacroMilter restart
- sleep 10
- sudo service MacroMilter status
- sendemail -f travis@localhost -t test@localhost -m "test" -s localhost -u "test" -a ./test_mails/Test_Dock_Block.doc -v
- sudo tail -n 100 /var/log/mail.log
- sudo tail -n 100 /home/travis/macromilter.log
- sudo cat ./travis/mail.txt
# Reject no
- stage: Testing
script:
- sudo cp ./travis/config_3.ini /etc/macromilter/config.ini
- sudo cat /etc/macromilter/config.ini
- sudo service MacroMilter restart
- sleep 10
- sudo service MacroMilter status
- sendemail -f travis@localhost -t test@localhost -m "test" -s localhost -u "test" -a ./test_mails/Test_Dock_Block.doc -v
- sudo tail -n 100 /var/log/mail.log
- sudo tail -n 100 /home/travis/macromilter.log
- sudo cat ./travis/mail.txt
# Reject no and blacklist
- stage: Testing
script:
- sudo cp ./travis/config_3.ini /etc/macromilter/config.ini
- sudo cat /etc/macromilter/config.ini
- sudo service MacroMilter restart
- sleep 10
- sudo service MacroMilter status
- sendemail -f travis@localhost -t test@localhost -m "test" -s localhost -u "test" -a ./test_mails/Test_Dock_Block.doc -v
- sendemail -f travis@localhost -t test@localhost -m "test" -s localhost -u "test" -a ./test_mails/Test_Dock_Block.doc -v
- sudo tail -n 100 /var/log/mail.log
- sudo tail -n 100 /home/travis/macromilter.log
- sudo cat ./travis/mail.txt
# Normal mail without attachment
- stage: Testing
script:
- sudo cp ./travis/config_3.ini /etc/macromilter/config.ini
- sudo cat /etc/macromilter/config.ini
- sudo service MacroMilter restart
- sleep 10
- sudo service MacroMilter status
- sendemail -f travis@localhost -t test@localhost -m "test" -s localhost -u "test" -v
- sudo tail -n 100 /var/log/mail.log
- sudo tail -n 100 /home/travis/macromilter.log
- sudo cat ./travis/mail.txt