]> Sergey Matveev's repositories - public-inbox.git/blobdiff - scripts/dc-dlvr
scripts/dc-dlvr: remove catchall account
[public-inbox.git] / scripts / dc-dlvr
index 96009662be123cab42701d5025b424d244991831..2f82ff2a583df3b006434f42bd2c7b140dde192c 100755 (executable)
@@ -1,17 +1,12 @@
 #!/bin/sh
-# Copyright (C) 2008-2013, Eric Wong <e@80x24.org>
-# License: GPLv3 or later
+# 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
 
-# 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 -U /run/spamd.sock'
+spamc='spamc'
 
 # allow plus addressing to train spam filters, $1 is the $EXTENSION
 # which may be "trainspam" or "trainham".  Only allow spam training
@@ -30,11 +25,14 @@ then
        set -e
        cat > $TMPMSG
        DEFAULT_INBOX=$(. ~/.dc-dlvr.pre)
-       if test xINBOX != x"$DEFAULT_INBOX"
-       then
+       case $DEFAULT_INBOX in
+       '') exec rm -f $rm_list ;;
+       INBOX) ;; # do nothing
+       *)
                $DELIVER -m $DEFAULT_INBOX < $TMPMSG
                exec rm -f $rm_list
-       fi
+               ;;
+       esac
        PREMSG=$(mktemp -t dc-dlvr.orig.$USER.XXXXXX || exit 1)
        rm_list="$rm_list $PREMSG"
        set +e