Python program to scan all attachments of a Kopano user with ClamAV and if required remove them if infected.
- clamd
- six
- python-kopano
- clamav-daemon
Options:
-h, --help show this help message and exit
-c FILE, --config=FILE load settings from FILE
-s SOCKET, --server-socket=SOCKET connect to server SOCKET
-k FILE, --ssl-key=FILE SSL key file
-p PASS, --ssl-pass=PASS SSL key password
-C NAME, --company=NAME run program for specific company
-u NAME, --user=NAME run program for specific user
-b DATE, --period-begin=DATE run program for specific period
-e DATE, --period-end=DATE run program for specific period
--all run program for all users
--autoremove remove infected attachments
$ python kopano-scan-attachments.py -u kato
Scanning user [kato]
Scanning folder [Suggested Contacts]
Scanning folder [Quick Step Settings]
Scanning folder [Conversation Action Settings]
Scanning folder [RSS Feeds]
Scanning folder [Junk E-mail]
Scanning folder [Tasks]
Scanning folder [Notes]
Scanning folder [Journal]
Scanning folder [Drafts]
Scanning folder [Calendar]
Virus found: [Meet Dr. Frikandel] [FOUND] [Eicar-Test-Signature]
Scanning folder [Contacts]
Virus found: [Piet Frikandel] [FOUND] [Eicar-Test-Signature]
Scanning folder [Sent Items]
Scanning folder [Deleted Items]
Scanning folder [Outbox]
Scanning folder [Inbox]
Virus found: [Introduction to Dr Frikandel] [FOUND] [Eicar-Test-Signature]
$ python kopano-scan-attachments -u kato --autoremove
Scanning user [kato]
Scanning folder [Suggested Contacts]
Scanning folder [Quick Step Settings]
Scanning folder [Conversation Action Settings]
Scanning folder [RSS Feeds]
Scanning folder [Junk E-mail]
Scanning folder [Tasks]
Scanning folder [Notes]
Scanning folder [Journal]
Scanning folder [Drafts]
Scanning folder [Calendar]
Virus found: [Meet Dr. Frikandel] [FOUND] [Eicar-Test-Signature]
Autoremoving attachment: [Meet Dr. Frikandel] [eicar.com]
Scanning folder [Contacts]
Virus found: [Piet Frikandel] [FOUND] [Eicar-Test-Signature]
Autoremoving attachment: [Piet Frikandel] [eicar.com]
Scanning folder [Sent Items]
Scanning folder [Deleted Items]
Scanning folder [Outbox]
Scanning folder [Inbox]
Virus found: [Introduction to Dr Frikandel] [FOUND] [Eicar-Test-Signature]
Autoremoving attachment: [Introduction to Dr Frikandel] [eicar.com]
- None at the moment, suggestions are welcomed