* [PATCH 0/3] dc-dlvr updates
@ 2016-06-17 0:44 Eric Wong
2016-06-17 0:44 ` [PATCH 1/3] scripts/dc-dlvr: update copyright Eric Wong
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
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 [flat|nested] 4+ messages in thread
* [PATCH 1/3] scripts/dc-dlvr: update copyright
2016-06-17 0:44 [PATCH 0/3] dc-dlvr updates Eric Wong
@ 2016-06-17 0:44 ` Eric Wong
2016-06-17 0:44 ` [PATCH 2/3] scripts/dc-dlvr: remove catchall account Eric Wong
2016-06-17 0:44 ` [PATCH 3/3] scripts/dc-dlvr: ClamAV support via clamdscan Eric Wong
2 siblings, 0 replies; 4+ messages in thread
From: Eric Wong @ 2016-06-17 0:44 UTC (permalink / raw)
To: meta
---
scripts/dc-dlvr | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/dc-dlvr b/scripts/dc-dlvr
index ca64505..e0f3210 100755
--- a/scripts/dc-dlvr
+++ b/scripts/dc-dlvr
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright (C) 2008-2013, Eric Wong <e@80x24.org>
-# License: GPLv3 or later <http://www.gnu.org/licenses/gpl-3.0.txt>
+# Copyright (C) 2008-2016 all contributors <meta@public-inbox.org>
+# License: GPL-3.0+ <http://www.gnu.org/licenses/gpl-3.0.txt>
# 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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/3] scripts/dc-dlvr: remove catchall account
2016-06-17 0:44 [PATCH 0/3] dc-dlvr updates Eric Wong
2016-06-17 0:44 ` [PATCH 1/3] scripts/dc-dlvr: update copyright Eric Wong
@ 2016-06-17 0:44 ` Eric Wong
2016-06-17 0:44 ` [PATCH 3/3] scripts/dc-dlvr: ClamAV support via clamdscan Eric Wong
2 siblings, 0 replies; 4+ messages in thread
From: Eric Wong @ 2016-06-17 0:44 UTC (permalink / raw)
To: meta
Unfortunately, people screw up addresses enough and
for this to be a real problem.
---
scripts/dc-dlvr | 6 ------
1 file changed, 6 deletions(-)
diff --git a/scripts/dc-dlvr b/scripts/dc-dlvr
index e0f3210..2f82ff2 100755
--- a/scripts/dc-dlvr
+++ b/scripts/dc-dlvr
@@ -5,12 +5,6 @@
# to use with postfix main.cf: mailbox_command = /etc/dc-dlvr "$EXTENSION"
DELIVER=/usr/lib/dovecot/deliver
-# my personal preference is to use a catchall account to avoid generating
-# backscatter, as invalid emails are usually spam
-case $USER in
-catchall) exec $DELIVER ;;
-esac
-
# change if your spamc/spamd listens elsewhere
spamc='spamc'
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 3/3] scripts/dc-dlvr: ClamAV support via clamdscan
2016-06-17 0:44 [PATCH 0/3] dc-dlvr updates Eric Wong
2016-06-17 0:44 ` [PATCH 1/3] scripts/dc-dlvr: update copyright Eric Wong
2016-06-17 0:44 ` [PATCH 2/3] scripts/dc-dlvr: remove catchall account Eric Wong
@ 2016-06-17 0:44 ` Eric Wong
2 siblings, 0 replies; 4+ messages in thread
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 [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-06-17 0:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-17 0:44 [PATCH 0/3] dc-dlvr updates Eric Wong
2016-06-17 0:44 ` [PATCH 1/3] scripts/dc-dlvr: update copyright Eric Wong
2016-06-17 0:44 ` [PATCH 2/3] scripts/dc-dlvr: remove catchall account Eric Wong
2016-06-17 0:44 ` [PATCH 3/3] scripts/dc-dlvr: ClamAV support via clamdscan Eric Wong
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).