From 495790d81da72c2ac9ca70c31b47c7ae7063df81 Mon Sep 17 00:00:00 2001 From: Joshua Tauberer Date: Sun, 12 Oct 2014 18:04:51 +0000 Subject: [PATCH] still didn't get the permissions right, chmod must follow sa-learn's initial creation of files see #231, #201, b26abc947e8d39d457f6ce098544aa1692de9a56, 7ca54a2bfb12179ffbd8d0c00f44efee7d0e5a4e, dfe0a9f1872dc048ad64301be4c8795bc713dd92 --- setup/spamassassin.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setup/spamassassin.sh b/setup/spamassassin.sh index 0d2541b6..00a687ec 100755 --- a/setup/spamassassin.sh +++ b/setup/spamassassin.sh @@ -49,7 +49,6 @@ tools/editconf.py /etc/spamassassin/local.cf -s \ mkdir -p $STORAGE_ROOT/mail/spamassassin chown -R spampd:spampd $STORAGE_ROOT/mail/spamassassin -chmod -R 775 $STORAGE_ROOT/mail/spamassassin # To mark mail as spam or ham, just drag it in or out of the Spam folder. We'll # use the Dovecot antispam plugin to detect the message move operation and execute @@ -89,8 +88,11 @@ exit 0 EOF chmod a+x /usr/local/bin/sa-learn-pipe.sh -# Create empty bayes training data (if it doesn't exist) owned by spampd. +# Create empty bayes training data (if it doesn't exist). Once the files exist, +# ensure they are group-writable so that the Dovecot process has access. sudo -u spampd /usr/bin/sa-learn --sync 2>/dev/null +chmod -R 660 $STORAGE_ROOT/mail/spamassassin +chmod 770 $STORAGE_ROOT/mail/spamassassin # Initial training? # sa-learn --ham storage/mail/mailboxes/*/*/cur/