README.md 1.94 KB
Newer Older
Markus Kötter's avatar
Markus Kötter committed
1
2
3
4
## MailSignatureValidator

POC: diagnostic autoresponder for smime multipart/signed

5
6
7
8
9
10
11
12
### Installation
#### Requirements
  * Python3 (>= 3.5 probably)
  * M2Crypto
  * asn1crypto
  * OpenSSL
  * cryptography
  * jinja2
Markus Kötter's avatar
Markus Kötter committed
13

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
###
```commandline
python3.5 -m venv ~/venv-msv/
~/venv-msv/bin/pip install --upgrade pip
# apt-get build-dep m2crypto
# apt-get install python3-dev libpython3-dev
~/venv-msv/bin/pip --requirement requirements.txt

```

### Configuration
```commandline
cp conf/example.ini conf/msv.ini
chmod 0600 conf/msv.conf
# edit conf/msv.ini

```

#### Running
Markus Kötter's avatar
Markus Kötter committed
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

##### debug
```commandline
mailsignaturevalidator.py -c conf/msv.ini debug /tmp/themail.eml

2019-11-21 14:07:18,179 root      WARNING Invalid Signature
hash ✔️ 

signature ✔️ 

cert ❌ 
    Signaturgeber:
            S: C=DE/ST=Niedersachsen/L=Hannover/O=Leibniz Universitaet Hannover/OU=LUIS/CN=GRP: prn-1210-002-b219-3 print
            I: C=DE/O=Verein zur Foerderung eines Deutschen Forschungsnetzes e. V./OU=DFN-PKI/CN=DFN-Verein Global Issuing CA

    In der Signatur beinhaltete Zertifikate:
        unvollständig
            S: C=DE/ST=Niedersachsen/L=Hannover/O=Leibniz Universitaet Hannover/OU=LUIS/CN=GRP: prn-1210-002-b219-3 print
            I: C=DE/O=Verein zur Foerderung eines Deutschen Forschungsnetzes e. V./OU=DFN-PKI/CN=DFN-Verein Global Issuing CA

        unvollständig
            S: C=DE/O=Verein zur Foerderung eines Deutschen Forschungsnetzes e. V./OU=DFN-PKI/CN=DFN-Verein Global Issuing CA
            I: C=DE/O=Verein zur Foerderung eines Deutschen Forschungsnetzes e. V./OU=DFN-PKI/CN=DFN-Verein Certification Authority 2
```

##### run
```commandline
mailsignaturevalidator.py -c conf/msv.ini run
2019-11-21 14:26:19,648 root      INFO Processing 2019-11-21 14:26:07 "Markus Koetter <koetter@luis.uni-hannover.de>" "XXX@luis.uni-hannover.de" "Bitte validieren"
2019-11-21 14:26:19,652 root      INFO Valid signature
2019-11-21 14:26:19,749 root      DEBUG Marked as Seen
```