kopano-spamd: Warning in Log when moving mails to "Junk E-Mail"-Folder

Hi,

each time i move an e-mail to the “Junk E-Mail”-Folder the kopano-spamd daemon writes the following warning to its logfile:

2018-05-18 18:47:26,583 - spamd - WARNING - Unable to set ownership: [Errno 1] Operation not permitted: '/var/lib/kopano/spamd/spam/EF548CAE685A4F82A726AACFC69C67C7.eml', entryid 000000001FAAE3D0F015457FB899FD75E0CA336F0100000005000000CA7409CE2FFA442DAFDE72E5D8C9C6FC00000000

The daemon is configured with:

run_as_user = kopano
run_as_group = kopano
pid_file = /var/run/kopano/spamd.pid
server_socket = file:///var/run/kopano/server.sock
log_method = file
log_level = 3
log_file = /var/log/kopano/spamd.log
log_timestamp = 1
log_buffer_size = 0
spam_dir = /var/lib/kopano/spamd/spam
spam_db = /var/lib/kopano/spamd/spam.db
learn_ham = yes
ham_dir = /var/lib/kopano/spamd/ham
sa_group = amavis

The directory “/var/lib/kopano/spamd” is owned by kopano:kopano and the permissions of the file from the warning message are:

-rw-rw-rw- 1 kopano kopano 11032 18. Mai 18:47 /var/lib/kopano/spamd/spam/EF548CAE685A4F82A726AACFC69C67C7.eml

For security reasons i don’t like the file having “rw-rw-rw-” permissions and rather would like to have it “rw-------” or “rw-rw----”, maybe the warning occurrs when the daemon is trying to set new permissions on the file?

The version in question is:

kopano-spamd-8.6.80.45-84.1.x86_64

installed as rpm on CentOS 7.

Any hints on this?

kind regards,

Christoph

Looks like an upgrade to the current nightly build solved this.

Looks like i’ve been a little to hasty - when moving a Junk-Mail to the “Junk E-Mail” folder in the kopano-spamd logfile now this warning is written:

2018-05-23 07:28:21,102 - spamd - ERROR - could not process change for entryid 000000001FAAE3D0F015457FB899FD75E0CA336F0100000005000000C6A850FA6E6642E2A02E1724093A26E500000000 ([SPropValue(0x67110003, 496163L), SPropValue(0x6715000A, 2147746063L), SPropValue(0x0FFA0102, ‘\x1f\xaa\xe3\xd0\xf0\x15E\x7f\xb8\x99\xfdu\xe0\xca3o’)]):
2018-05-23 07:28:21,102 - spamd - ERROR - Traceback (most recent call last):
File “/usr/lib/python2.7/site-packages/kopano/ics.py”, line 118, in ImportMessageChange
self.importer.update(item, flags)
File “/usr/lib/python2.7/site-packages/kopano_spamd/init.py”, line 72, in update
item.header(headertag).upper() != ‘YES’:
NameError: global name ‘headertag’ is not defined

The contents of /etc/kopano/spamd.cfg are:
7:32 AM

run_as_user = kopano
run_as_group = kopano
pid_file = /var/run/kopano/spamd.pid
server_socket = file:///var/run/kopano/server.sock
log_method = file
log_level = 3
log_file = /var/log/kopano/spamd.log
log_timestamp = 1
spam_dir = /var/lib/kopano/spamd/spam
spam_db = /var/lib/kopano/spamd/spam.db
learn_ham = yes
ham_dir = /var/lib/kopano/spamd/ham
sa_group = amavis
header_tag = X-Spam-Flag

Any hints why this is happening?

(The version installed is kopano-spamd-8.6.80.760-90.1.x86_64 on CentOS 7)

Hello happenpappen ,

I see exactly the same errors.
I got rid of the headertag error by reverting the last changes (going back to hardecoded headertag).
But the permission warning is coming up each time a mail is put into spam folder.

Did you solve this problem?

Hi Vogi,

i changed line 72 in file “/usr/lib/python2.7/site-packages/kopano_spamd/__init__.py” to:

item.header(self.headertag).upper() != 'YES':

(added the “self.” before “headertag”) which removed the error message of global name “headertag” not being defined. But then there is the warning message about the permission problem again… so no, i did not solve the problem until now.

Hmm. that sounds strange. I’ve asked one of our developers to take a look at this. Thanks for the notice.