Browse Source

spamassasin: fix sa-update.sh and ensure service is started and enabled

alert5-minifirewall-restart
Victor Laborie 1 year ago
parent
commit
c1d727bb5d
3 changed files with 13 additions and 4 deletions
  1. +1
    -0
      CHANGELOG.md
  2. +4
    -4
      spamassasin/files/sa-update.sh
  3. +8
    -0
      spamassasin/tasks/main.yml

+ 1
- 0
CHANGELOG.md View File

@@ -15,6 +15,7 @@ The **patch** part changes incrementally at each release.
### Changed

### Fixed
* spamassasin: fix sa-update.sh and ensure service is started and enabled

### Security



+ 4
- 4
spamassasin/files/sa-update.sh View File

@@ -12,7 +12,7 @@ test -x /etc/init.d/spamassassin || exit 0
# of spamassassin --lint (which will typically get emailed to root)
# and abort.
die_with_lint() {
su debian-spamd -c "spamassassin --lint -D 2>&1"
su - debian-spamd -c "spamassassin --lint -D 2>&1"
exit 1
}

@@ -20,7 +20,7 @@ do_compile() {
# Compile, if rules have previously been compiled, and it's possible
if [ -x /usr/bin/re2c -a -x /usr/bin/sa-compile \
-a -d /var/lib/spamassassin/compiled ]; then
su debian-spamd -c "sa-compile --quiet"
su - debian-spamd -c "sa-compile --quiet"
# Fixup perms -- group and other should be able to
# read and execute, but never write. Works around
# sa-compile's failure to obey umask.
@@ -43,12 +43,12 @@ reload() {

# Update
umask 022
su debian-spamd -c "sa-update --gpghomedir /var/lib/spamassassin/sa-update-keys"
su - debian-spamd -c "sa-update --gpghomedir /var/lib/spamassassin/sa-update-keys"

case $? in
0)
# got updates!
su debian-spamd -c "spamassassin --lint" || die_with_lint
su - debian-spamd -c "spamassassin --lint" || die_with_lint
do_compile
reload
echo -e "Les règles SpamAsassin ont été mises à jour. Merci de reporter toute anomalie." | \


+ 8
- 0
spamassasin/tasks/main.yml View File

@@ -71,3 +71,11 @@
changed_when: false
tags:
- spamassassin

- name: ensure SpamAssasin is started and enabled
systemd:
name: spamassassin
state: started
enabled: True
tags:
- spamassassin

Loading…
Cancel
Save