X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FConfig%2FNix.git;a=blobdiff_plain;f=modules%2Fprivate%2Fmail%2Fscan_reported_mails;fp=modules%2Fprivate%2Fmail%2Fscan_reported_mails;h=0000000000000000000000000000000000000000;hp=fe9f4d695a6540a15a6eda44ce9269f65b056dfb;hb=1a64deeb894dc95e2645a75771732c6cc53a79ad;hpb=fa25ffd4583cc362075cd5e1b4130f33306103f0 diff --git a/modules/private/mail/scan_reported_mails b/modules/private/mail/scan_reported_mails deleted file mode 100755 index fe9f4d6..0000000 --- a/modules/private/mail/scan_reported_mails +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash - -( flock -n 9 || exit 1 -shopt -s nullglob -for spool in /var/lib/vhost/.rspamd/*/pending; do - rspamd_folder=$(dirname $spool) - mail_user=$(basename $rspamd_folder) - mv $rspamd_folder/pending $rspamd_folder/processing - - for mtype in ham spam; do - if [ -d $rspamd_folder/processing/$mtype ]; then - output="$(rspamc -h /run/rspamd/worker-controller.sock -c bayes -d $mail_user learn_$mtype $rspamd_folder/processing/$mtype/*)" - echo "[$mtype: $mail_user]" ${output} >> /var/lib/vhost/.rspamd/rspamd.log - mkdir -p $rspamd_folder/processed/$mtype - cp $rspamd_folder/processing/$mtype/* $rspamd_folder/processed/$mtype/ - fi - done - - rm -rf $rspamd_folder/processing -done -) 9>/var/lib/vhost/scan_reported_mails.lock