<commit_before># Mail Scanner
-------------------
by <EMAIL>

## Dependency
```bsh
$ pip install oletools
```

## Configure files
**[example]**
```bsh
$ vim config
```

config
```config
smtp_server=smtp.gmail.com
imap_server=imap.gmail.com
username=<EMAIL>
password=<PASSWORD>
```

## Usage
**scan mode** : scanning all mails in the mailbox 'INBOX'
```bsh
$ ./scan_mail.py scan

Congrats! There is no suspicious mail in your mailbox!
```
**monitor mode** : monitor mailbox 'INBOX' and scan all new-coming mails.
```bsh
$ ./scan_mail.py monitor

Waiting for new mails ...


[New mail] 哈哈哈ㄏ... scanning  ... safe
```
**combo mode** : execute scan mode first and then monitor mode.
```bsh
$ ./scan_mail.py combo
```

## TODO
* check if virus mail detection works or not.
* refine README.txt
* refactoring
* remove redundant code<commit_msg>Add something to README.md<commit_after>Mail Scanner
-------------------
by <EMAIL>

## Dependency
```bsh
$ pip install oletools
```

## Configure files
**[example]**
```bsh
$ vim config
```

config
```config
smtp_server=smtp.gmail.com
imap_server=imap.gmail.com
username=<EMAIL>
password=<PASSWORD>
```

## Usage
**scan mode** : scanning all mails in the mailbox 'INBOX'
```bsh
$ ./scan_mail.py scan

[Suspicious Mail Found] uid=36; subject="新的"; suspicious_files="SCAN_Invoice_austin.sun.doc"
```
**monitor mode** : monitor mailbox 'INBOX' and scan all new-coming mails.
```bsh
$ ./scan_mail.py monitor

Waiting for new mails ...


[New mail] subject : "dasa"; from : "<EMAIL>"; result : SAFE
```
**combo mode** : execute scan mode first and then monitor mode.
```bsh
$ ./scan_mail.py combo
```

## TODO
* add more checks in class IMAPClient and other functions to prevent from crash
* refine README.md
* decompose scan_mail.py to multiple files
* refactoring
* remove redundant code
{'fraction_non_alphanumeric': 0.16520307354555433, 'fraction_numerical': 0.0010976948408342481, 'mean_word_length': 4.063888888888889, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4054756', 'n_tokens_mistral': 670, 'n_tokens_neox': 623, 'n_words': 199}