Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Antispam: rspamd, the learn-hamorspam socket write error #380

Open
diffway opened this issue Dec 28, 2024 · 0 comments
Open

Antispam: rspamd, the learn-hamorspam socket write error #380

diffway opened this issue Dec 28, 2024 · 0 comments

Comments

@diffway
Copy link
Contributor

diffway commented Dec 28, 2024

Problem description

The feature of ham or spam learning by moving in and out of the Junk folder is claimed, but in fact is not working, at least for me.

How to reproduce

  1. (Optional) Enable dovecot debug
  2. In any mail client move mail message to /Junk folder
  3. On the server, watch /var/log/syslog, there will be line:
...
... learn-hamorspam: Cannot open socket file for writing, tried with <UID>
...
... Error: sieve: report-spam: line 23: execute action: failed to execute to program `learn-hamorspam.sh': refer to server log for more information. [<ISO DATETIME>]
...

What expected

No errors in syslog

What I did

I found that in 90-sieve-extprograms.conf template of dovecot role there is mail_users group

Privileges in both service sieve-pipe-script { and service sieve-execute-action { blocks are the same:

...
    user = dovecot
    group = mail_users
    mode = 0660
...

While in worker-controller template of rspamd role there is _rspamd group.

...
bind_socket = "/run/rspamd/controller.sock mode=0660 owner=_rspamd group=_rspamd";
...

What i tried

  • Set group of rspamd socket to be mail_users
  • Change dovecot config to the group _rspamd

Both of my attempts didn't resolve the socket write error problem.

Kind of solution

So far, only chmod others privileges to rw for rspamd socket helps.

If someone knows better way write comment here.

Disclaimer:

Never open sockets on production systems, this can potentially lead to vulnerabilities.

# chmod -c o+rw /run/rspamd/controller.sock
mode of '/run/rspamd/controller.sock' changed from 0660 (rw-rw----) to 0666 (rw-rw-rw-)

See attachment for details:
learn-hamorspam-error.log

@diffway diffway changed the title Antispam: rspamd, the learn-hamorspam script error Antispam: rspamd, the learn-hamorspam socket write error Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant