You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Mark de Bruijn e06a39d434 Drop zarafa support 4 years ago
.gitignore Initial commit 6 years ago
LICENSE Initial commit 6 years ago
README.md Drop zarafa support 4 years ago
kopano-scan-attachments.py Drop zarafa support 4 years ago

README.md

kopano-scan-attachments.py

Python program to scan all attachments of a Kopano user with ClamAV and if required remove them if infected.

Python Requirements

  • clamd
  • six
  • python-kopano

System Requirements

  • clamav-daemon

Command line options

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

Some Examples

Run only scanning user kato

$ 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]

Run for user kato and autoremove any infected items

$ 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]

Todo's

  • None at the moment, suggestions are welcomed