From a574a48aa6b46cc5fadd4d2fc783a6f73495d3b1 Mon Sep 17 00:00:00 2001
From: Zhang Huangbin
Date: Tue, 21 May 2019 13:11:47 +0800
Subject: [PATCH] Mention different amavisd daemon user name in BSD systems.
---
en_US/howto/dovecot.imapsieve.md | 11 ++++++++++-
html/dovecot.imapsieve.html | 11 ++++++++++-
2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/en_US/howto/dovecot.imapsieve.md b/en_US/howto/dovecot.imapsieve.md
index abd14f2e..6ce0aa6d 100644
--- a/en_US/howto/dovecot.imapsieve.md
+++ b/en_US/howto/dovecot.imapsieve.md
@@ -182,6 +182,11 @@ a shell script to call SpamAssassin to actually learn spam/ham periodly.
Create script `/etc/dovecot/sieve/scan_reported_mails.sh` with content below,
it's used to call `sa-learn` command to learn reported spam/ham emails:
+!!! attention
+
+ If you're running FreeBSD or OpenBSD, please change the Amavisd daemon
+ user name in variable `AMAVISD_USER` below.
+
```
#!/usr/bin/env bash
# Author: Zhang Huangbin
@@ -193,6 +198,10 @@ export PATH="/bin:/usr/bin:/usr/local/bin:$PATH"
export OWNER="vmail"
export GROUP="vmail"
+# The Amavisd daemon user.
+# Note: on OpenBSD, it's "_vscan". On FreeBSD, it's "vscan".
+export AMAVISD_USER='amavis'
+
# Kernel name, in upper cases.
export KERNEL_NAME="$(uname -s | tr '[a-z]' '[A-Z]')"
@@ -203,7 +212,7 @@ export LOCK_FILE='/tmp/scan_reported_mails.lock'
export LOG='logger -p local5.info -t scan_reported_mails'
# `sa-learn` command, with optional arguments.
-export SA_LEARN='sa-learn -u amavis'
+export SA_LEARN="sa-learn -u ${AMAVISD_USER}"
# Spool directory.
# Must be owned by vmail:vmail.
diff --git a/html/dovecot.imapsieve.html b/html/dovecot.imapsieve.html
index f3535d8e..728a9e6b 100644
--- a/html/dovecot.imapsieve.html
+++ b/html/dovecot.imapsieve.html
@@ -201,6 +201,11 @@ chmod 0700 /var/vmail/sieve/report_spam.sieve \
a shell script to call SpamAssassin to actually learn spam/ham periodly.
Create script /etc/dovecot/sieve/scan_reported_mails.sh
with content below,
it's used to call sa-learn
command to learn reported spam/ham emails:
+
+
Attention
+
If you're running FreeBSD or OpenBSD, please change the Amavisd daemon
+user name in variable AMAVISD_USER
below.
+
#!/usr/bin/env bash
# Author: Zhang Huangbin <zhb@iredmail.org>
# Purpose: Copy spam/ham to another directory and call sa-learn to learn.
@@ -211,6 +216,10 @@ export PATH="/bin:/usr/bin:/usr/local/bin:$PATH"
export OWNER="vmail"
export GROUP="vmail"
+# The Amavisd daemon user.
+# Note: on OpenBSD, it's "_vscan". On FreeBSD, it's "vscan".
+export AMAVISD_USER='amavis'
+
# Kernel name, in upper cases.
export KERNEL_NAME="$(uname -s | tr '[a-z]' '[A-Z]')"
@@ -221,7 +230,7 @@ export LOCK_FILE='/tmp/scan_reported_mails.lock'
export LOG='logger -p local5.info -t scan_reported_mails'
# `sa-learn` command, with optional arguments.
-export SA_LEARN='sa-learn -u amavis'
+export SA_LEARN="sa-learn -u ${AMAVISD_USER}"
# Spool directory.
# Must be owned by vmail:vmail.