[Postfix] Create ham/spam mailboxes @ localhost

master
André 2018-07-25 01:05:51 +02:00
parent 76c747041d
commit 63ce1ba2d6
1 changed files with 6 additions and 4 deletions

View File

@ -3,10 +3,12 @@
trap "postfix stop" EXIT
[[ ! -d /opt/postfix/conf/sql/ ]] && mkdir -p /opt/postfix/conf/sql/
if [[ -z $(grep null /etc/aliases) ]]; then
echo null: /dev/null >> /etc/aliases;
newaliases;
fi
cat /dev/null > /etc/aliases;
echo "null: /dev/null" >> /etc/aliases;
echo "ham: '|/usr/bin/curl -s --data-binary @- --unix-socket /rspamd-sock/rspamd.sock http://rspamd/learnham'" >> /etc/aliases;
echo "spam: '|/usr/bin/curl -s --data-binary @- --unix-socket /rspamd-sock/rspamd.sock http://rspamd/learnspam'" >> /etc/aliases;
newaliases;
cat <<EOF > /opt/postfix/conf/sql/mysql_relay_recipient_maps.cf
user = ${DBUSER}