* [PATCH 3/3] scripts/dc-dlvr: ClamAV support via clamdscan
2016-06-17 0:44 7% [PATCH 0/3] dc-dlvr updates Eric Wong
@ 2016-06-17 0:44 6% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2016-06-17 0:44 UTC (permalink / raw)
To: meta
SpamAssassin often misses messages which contain viruses,
so ClamAV should fill that gap nicely.
---
scripts/dc-dlvr | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/scripts/dc-dlvr b/scripts/dc-dlvr
index 2f82ff2..5ebca3f 100755
--- a/scripts/dc-dlvr
+++ b/scripts/dc-dlvr
@@ -4,6 +4,7 @@
# This is installed as /etc/dc-dcvr on my system
# to use with postfix main.cf: mailbox_command = /etc/dc-dlvr "$EXTENSION"
DELIVER=/usr/lib/dovecot/deliver
+CLAMDSCAN=clamdscan
# change if your spamc/spamd listens elsewhere
spamc='spamc'
@@ -17,19 +18,27 @@ trainham,) exec $spamc -L ham > /dev/null 2>&1 ;;
esac
TMPMSG=$(mktemp -t dc-dlvr.orig.$USER.XXXXXX || exit 1)
-rm_list=$TMPMSG
+CDMSG=$(mktemp -t dc-dlvr.orig.$USER.XXXXXX || exit 1)
+rm_list="$TMPMSG $CDMSG"
+
+cat >$CDMSG
+$CLAMDSCAN --quiet - <$CDMSG
+if test $? -eq 1
+then
+ exec $DELIVER -m INBOX.spam <$CDMSG
+fi
# pre-filter, for infrequently read lists which do their own spam filtering:
if test -r ~/.dc-dlvr.pre
then
set -e
- cat > $TMPMSG
+ mv -f $CDMSG $TMPMSG
DEFAULT_INBOX=$(. ~/.dc-dlvr.pre)
case $DEFAULT_INBOX in
'') exec rm -f $rm_list ;;
INBOX) ;; # do nothing
*)
- $DELIVER -m $DEFAULT_INBOX < $TMPMSG
+ $DELIVER -m $DEFAULT_INBOX <$TMPMSG
exec rm -f $rm_list
;;
esac
@@ -37,9 +46,9 @@ then
rm_list="$rm_list $PREMSG"
set +e
mv -f $TMPMSG $PREMSG
- $spamc -E --headers < $PREMSG > $TMPMSG
+ $spamc -E --headers <$PREMSG >$TMPMSG
else
- $spamc -E --headers > $TMPMSG
+ $spamc -E --headers <$CDMSG >$TMPMSG
fi
err=$?
^ permalink raw reply related [relevance 6%]
* [PATCH 0/3] dc-dlvr updates
@ 2016-06-17 0:44 7% Eric Wong
2016-06-17 0:44 6% ` [PATCH 3/3] scripts/dc-dlvr: ClamAV support via clamdscan Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2016-06-17 0:44 UTC (permalink / raw)
To: meta
Eric Wong (3):
scripts/dc-dlvr: update copyright
scripts/dc-dlvr: remove catchall account
scripts/dc-dlvr: ClamAV support via clamdscan
scripts/dc-dlvr | 29 ++++++++++++++++-------------
1 file changed, 16 insertions(+), 13 deletions(-)
^ permalink raw reply [relevance 7%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2016-06-17 0:44 7% [PATCH 0/3] dc-dlvr updates Eric Wong
2016-06-17 0:44 6% ` [PATCH 3/3] scripts/dc-dlvr: ClamAV support via clamdscan Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).