amavis permissions error /var/spool/spamassassin #3

Open
opened 2022-02-19 04:39:10 +00:00 by jon_nfc · 3 comments
jon_nfc commented 2022-02-19 04:39:10 +00:00 (Migrated from gitlab.com)

📝 Summary

to bypass a permissions error, folder /var/spool/spamassassin had to have its mask set to 777 so that amavis could do spam bayes checks.

even with mask 770 and amavis bieng part of group vmail, amavis still could not check the spam bayes.

Debug output

email header:

X-Spam-Status: No, score=-1 tagged_above=-999 required=6.31
	tests=[ALL_TRUSTED=-1] autolearn=unavailable autolearn_force=no

when autolearn=unavailable there is a file permission error on /var/spool/spamassassin

syslog error

Feb 19 01:41:47 test amavis[414]: (00414-01) _WARN: plugin: eval failed: bayes: (in learn) locker: safe_lock: cannot create tmp lockfile /var/spool/spamassassin/bayes.lock.test.nodomain.org.414 for /var/spool/spamassassin/bayes.lock: Permission denied

even when ensuring that amavis is part of vmail group and a file mask of 770 amavis still produces the above syslog error.

folder permissions


root@test:/# ls -la /var/spool/
total 36
drwxr-xr-x 1 root root  4096 Feb 19 01:33 .
drwxr-xr-x 1 root root  4096 Jan 25 00:00 ..
drwxr-xr-x 3 root root  4096 Feb 17 02:33 cron
lrwxrwxrwx 1 root root     7 Jan 25 00:00 mail -> ../mail
drwxr-xr-x 1 root root  4096 Feb 19 01:41 postfix
drwx------ 2 root root  4096 Feb 17  2021 rsyslog
drwxrwxrwx 2 root vmail 4096 Feb 19 01:46 spamassassin
root@test:/# 

root@test:/# ls -la /var/spool/spamassassin
total 656
drwxrwxrwx 2 root         vmail   4096 Feb 19 01:46 .
drwxr-xr-x 1 root         root    4096 Feb 19 01:33 ..
-rw-rw-rw- 1 debian-spamd vmail  90112 Feb 19 01:46 bayes_seen
-rw-rw-rw- 1 debian-spamd vmail 675840 Feb 19 01:46 bayes_toks
root@test:/# 
  • discovered during work on !9

🚧 Tasks

  • figure out what the permissions should be without being world writable
## :memo: Summary to bypass a permissions error, folder `/var/spool/spamassassin` had to have its mask set to `777` so that amavis could do spam bayes checks. even with mask `770` and amavis bieng part of group vmail, amavis still could not check the spam bayes. ### Debug output email header: ```text X-Spam-Status: No, score=-1 tagged_above=-999 required=6.31 tests=[ALL_TRUSTED=-1] autolearn=unavailable autolearn_force=no ``` when `autolearn=unavailable` there is a file permission error on `/var/spool/spamassassin` syslog error ``` text Feb 19 01:41:47 test amavis[414]: (00414-01) _WARN: plugin: eval failed: bayes: (in learn) locker: safe_lock: cannot create tmp lockfile /var/spool/spamassassin/bayes.lock.test.nodomain.org.414 for /var/spool/spamassassin/bayes.lock: Permission denied ``` even when ensuring that amavis is part of `vmail` group and a file mask of `770` amavis still produces the above syslog error. folder permissions ``` bash root@test:/# ls -la /var/spool/ total 36 drwxr-xr-x 1 root root 4096 Feb 19 01:33 . drwxr-xr-x 1 root root 4096 Jan 25 00:00 .. drwxr-xr-x 3 root root 4096 Feb 17 02:33 cron lrwxrwxrwx 1 root root 7 Jan 25 00:00 mail -> ../mail drwxr-xr-x 1 root root 4096 Feb 19 01:41 postfix drwx------ 2 root root 4096 Feb 17 2021 rsyslog drwxrwxrwx 2 root vmail 4096 Feb 19 01:46 spamassassin root@test:/# root@test:/# ls -la /var/spool/spamassassin total 656 drwxrwxrwx 2 root vmail 4096 Feb 19 01:46 . drwxr-xr-x 1 root root 4096 Feb 19 01:33 .. -rw-rw-rw- 1 debian-spamd vmail 90112 Feb 19 01:46 bayes_seen -rw-rw-rw- 1 debian-spamd vmail 675840 Feb 19 01:46 bayes_toks root@test:/# ``` ### :link: Reference - discovered during work on !9 ### :construction: Tasks - [ ] figure out what the permissions should be without being world writable
jon_nfc commented 2022-02-19 04:40:18 +00:00 (Migrated from gitlab.com)

mentioned in merge request !9

mentioned in merge request !9
nfc_bot commented 2022-08-26 01:12:52 +00:00 (Migrated from gitlab.com)

mentioned in issue nofusscomputing/ops#55

mentioned in issue nofusscomputing/ops#55
nfc_bot commented 2022-09-26 00:31:13 +00:00 (Migrated from gitlab.com)

mentioned in issue nofusscomputing/ops#67

mentioned in issue nofusscomputing/ops#67
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: docker/docker-mail#3
No description provided.