commit 7180ae8a1b0c70b0c585cb6c5edc61afb3a000e7
parent 1b377256e1c31263690ccd6dfbcf84dd4a5132b8
Author: Jaromil <jaromil@dyne.org>
Date: Wed, 7 May 2014 00:44:52 +0200
minor after-merge fix
Diffstat:
M | src/zlibs/filters | | | 100 | ++----------------------------------------------------------------------------- |
1 file changed, 2 insertions(+), 98 deletions(-)
diff --git a/src/zlibs/filters b/src/zlibs/filters
@@ -428,88 +428,6 @@ if header :contains "Sender" "bounce" {
# own filters
EOF
-# continue later on while we parse filters
-
-touch "$MAILDIRS/Filters.txt"
-
- ##########
- # PROCMAIL
- ${=mkdir} "$PROCMAILDIR"
- rm -f "$PROCMAILDIR/rc"
- touch "$PROCMAILDIR/rc"
- cat<<EOF >> "$PROCMAILDIR/rc"
-# procmail configuration file generated by Jaro Mail
-MAILDIR=\"$MAILDIRS\"
-JARO=$WORKDIR/bin/jaro
-DEFAULT=\$MAILDIR/unsorted/
-VERBOSE=off
-LOGFILE=\$MAILDIR/logs/procmail.log
-SHELL = /bin/sh # VERY IMPORTANT
-UMASK = 007 # James Bond :-)
-LINEBUF = 8192 # avoid procmail choke
-
-# Using Procmail Module Library http://sf.net/projects/pm-lib
-PMSRC = "$WORKDIR/.procmail"
-# Load the central initial startup code.
-INCLUDERC = \$PMSRC/pm-javar.rc
-PF_DEST = "" # clear these vars
-PF_FROM = ""
-PF_RECURSE = yes
-
-# blacklist filters
-:0 w:
-* ? \$JARO -l blacklist -q isknown
-zz.blacklist/
-
-# if its a mailinglist bounce, save it to zz.bounces
-:0
-* ^Sender: mailman-bounce
-zz.bounces/
-
-# filters generated from Filters.txt
-:0
-* ? test \$PMSRC/pf-chkto.rc
-{
-EOF
-
- #######
- act "compiling rules for mailinglists"
- print "# filters generated from Filters.txt" >> "$PROCMAILDIR/rc"
-
- typeset -alU filter_from
- typeset -alU filter_to
-
- for f in `cat "$MAILDIRS/Filters.txt" | awk '
- /^#/ {next}
- /^./ { print $1 ";" $2 ";" $3 ";" $4 }'`; do
- header="${f[(ws:;:)1]}"
- address="${f[(ws:;:)2]}"
- action="${f[(ws:;:)3]}"
- destination="${f[(ws:;:)4]}"
- case $header in
- to)
- print "ADDR=${address}\tDEST=${destination}/\tINCLUDERC=\$PMSRC/pf-chkto.rc" \
- >> "$PROCMAILDIR/rc"
- func "messages to <${address}> in folder: ${destination}"
- maildirmake "$MAILDIRS/$destination"
- filter_to+=($address)
- ;;
- from)
- print "ADDR=${address}\tDEST=${destination}/\tINCLUDERC=\$PMSRC/pf-check.rc" \
- >> "$PROCMAILDIR/rc"
- func "messages from <${address}> in folder: {$destination}"
- maildirmake "$MAILDIRS/$destination"
- filter_from+=($address)
- ;;
- *)
- error "unsupported filter: $header (skipped)"
- ;;
- esac
- # MUTT (generate mailboxes priority this parser)
- print " \\" >> "$MUTTDIR/mboxes"
- print -n " +${destination} " >> "$MUTTDIR/mboxes"
- done
-
# now do the sieve
{ test ${#filter_to} -gt 0 } && {
cat <<EOF >> "$MAILDIRS/Filters.sieve"
@@ -518,7 +436,7 @@ if header :contains "To" [
EOF
c=${#filter_to}
for f in ${(k)filter_to}; do
- print -n "\"$f\"" >> $sieve
+ print -n "\"$f\"" >> "$MAILDIRS/Filters.sieve"
c=$(( $c - 1 ))
{ test $c != 0 } && { print -n "," >> "$MAILDIRS/Filters.sieve" }
print >> "$MAILDIRS/Filters.sieve"
@@ -537,7 +455,7 @@ if header :contains "From" [
EOF
c=${#filter_from}
for f in ${(k)filter_from}; do
- print -n "\"$f\"" >> $sieve
+ print -n "\"$f\"" >> "$MAILDIRS/Filters.sieve"
c=$(( $c - 1 ))
{ test $c != 0 } && { print -n "," >> "$MAILDIRS/Filters.sieve" }
print >> "$MAILDIRS/Filters.sieve"
@@ -595,20 +513,6 @@ if header :is "X-Spam-Flag" "YES" {
fileinto "unsorted";
EOF
-unlock $sieve
-
-return 0
-
-}
-
-
-
- # conclude sieve
-cat <<EOF >> "$MAILDIRS/Filters.sieve"
-
-fileinto "unsorted";
-EOF
-
unlock "$MAILDIRS/Filters.sieve"
return 0