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

Fix shm permission problem of rspamd on DragonFly #727

Merged
merged 1 commit into from
Jan 6, 2017

Conversation

mneumann
Copy link
Contributor

@mneumann mneumann commented Jan 6, 2017

Rspamd tried to call shm_open(3) with a path in the root filesystem
(e.g. /rhm.3f0fd440d46fac91e1b4). Obviously, this fails due to wrong
permissions, and in effect this makes rspamd very slow and probably it
cannot perform it's job (spam filtering) at all.

Lots of lines like the following were found in
/var/log/rspamd/rspamd.log before this patch:

rspamd_shmem_mkstemp: /usr/obj/dports/mail/rspamd/rspamd-1.4.1/src
  /libutil/util.c:1970: failed to create temp shmem
  /rhm.3f0fd440d46fac91e1b4: Permission denied

This patch fixes the problem by creating the shm files in /tmp. With
this patch applied, these lines are gone from the log.

Rspamd tried to call shm_open(3) with a path in the root filesystem
(e.g. /rhm.3f0fd440d46fac91e1b4). Obviously, this fails due to wrong
permissions, and in effect this makes rspamd very slow and probably it
cannot perform it's job (spam filtering) at all.

Lots of lines like the following were found in
/var/log/rspamd/rspamd.log before this patch:

    rspamd_shmem_mkstemp: /usr/obj/dports/mail/rspamd/rspamd-1.4.1/src
      /libutil/util.c:1970: failed to create temp shmem
      /rhm.3f0fd440d46fac91e1b4: Permission denied

This patch fixes the problem by creating the shm files in /tmp. With
this patch applied, these lines are gone from the log.
vstakhov pushed a commit to rspamd/rspamd that referenced this pull request Jan 6, 2017
Rspamd tried to call shm_open(3) with a path in the root filesystem
(e.g. /rhm.3f0fd440d46fac91e1b4). But DragonFly uses regular files
for shm. Obviously, this fails, because rspamd has no permissions
to create files in the root (/).

Lots of lines like the following were found in
/var/log/rspamd/rspamd.log before this patch:

    rspamd_shmem_mkstemp: /usr/obj/dports/mail/rspamd/rspamd-1.4.1/src
      /libutil/util.c:1970: failed to create temp shmem
      /rhm.3f0fd440d46fac91e1b4: Permission denied

Also, rspamd made the receiving of mail very slow, when used
in the pre-accept rmilter setting, due to these errors. Even
worse, it just didn't filter emails at all.

This patch fixes the problem by creating the shm files in /tmp
for DragonFly. With this patch applied, these lines are gone from
the log and emails now correctly contain the X-Spamd-Result header,
AND receiving mails is now much much faster.

For rspamd 1.4.1, we will fix it in dports:

    DragonFlyBSD/DeltaPorts#727
@jrmarino jrmarino merged commit 63b0bc3 into DragonFlyBSD:master Jan 6, 2017
@mneumann mneumann deleted the mail-rspamd-fix-shm branch January 6, 2017 21:18
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

Successfully merging this pull request may close these issues.

None yet

2 participants