kopano antispam and antivirus



i Installed the module

pip3 install inotify
Requirement already satisfied: inotify in /usr/local/lib/python3.6/site-packages (0.2.10)
Requirement already satisfied: nose in /usr/local/lib/python3.6/site-packages (from inotify) (1.3.7)

[root@kopano inotify-spamlearn]# python3 inotify-spamlearn.py
Traceback (most recent call last):
File “inotify-spamlearn.py”, line 11, in <module>
import inotify.adapters
ImportError: No module named ‘inotify’

if i do a normal python run it tels me its missing an other module.

[root@kopano inotify-spamlearn]# python inotify-spamlearn.py
Traceback (most recent call last):
File “inotify-spamlearn.py”, line 5, in <module>
import configparser
ImportError: No module named configparser


i am a little bit further. now i can get no module error.

python3.6 inontify-spamlearn.py

however now i get this error:


the path folders exist.


As I can see from your prompt it seems you are in a directory named inotify-spamlearn and the config is also placed there. However, the script is always looking for the config file in /etc/kopano/. Make sure that the file is placed there (as described in the readme).


that is indeed the problem. tonight i willl reinstall rspamd and see i f it works. thank you!


Sorry, i dont have it all on paper jet. but its not that hard to setup.
Just setup spamassassin to use sql database on both servers.

my mailscanner (spamassassin) sql db is located on the kopano server.

Basicly this, but configured on 2 servers.

I also did see some rspamd replies, these are on my test list also.
Its bit what you preffer.

This post is deleted!


hi i have it all installed now and working as far as is. however what group should we use in kopano-spamd for rspamd? i did

sa_group = _rspamd

but i get the following error when moving mails to my spam folder:

2019-01-09 22:58:55,186 - spamd - ERROR - Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/kopano/log.py", line 103, in log_exc
    try: yield
  File "/usr/lib/python2.7/site-packages/kopano_spamd/__init__.py", line 83, in update
    self.learn(item, searchkey, True)
  File "/usr/lib/python2.7/site-packages/kopano_spamd/__init__.py", line 106, in learn
    os.chown(emlfilename, uid, gid)
OSError: [Errno 1] Operation not permitted: '/var/lib/kopano/spamd/spam/D6FDC3AACE8847D0A2A521D0A5300EC3.eml'

and the second question if spam is denied where is the mail stored then? how can we if its a false positive send the mail?

The group should be ok. Maybe your issue is related with the issue discussed in this thread: https://forum.kopano.io/topic/2027/kopano-spamd-error-permissionerror-errno-1-operation-not-permitted. However, in your case spamd seems to be running with python2.7…



I am starting it with python3.6



Yes, you’re starting inotify-spamlearn with python3.6 but I was talking about spamd.