commit 38e9e2e4ff767975bd7b05a845b1b8f507829974
parent 5bc601fdfc8e7946a8fc18883bd28307257be79d
Author: Jaromil <jaromil@dyne.org>
Date: Mon, 25 Jun 2012 20:10:02 +0200
better filtering, mailman-bounces in zz
Diffstat:
5 files changed, 19 insertions(+), 10 deletions(-)
diff --git a/TODO b/TODO
@@ -22,8 +22,12 @@
write down a mail from commandline and send it right away (if online)
doesn't uses Mutt to generate the mail body
but might read Mutt.txt configuration for headers and such
-
+
+* Filtering
+ filter out bounces in some zz.bounces - header:
+: Sender: mailman-bounces@
* DONE Maildirs
+ Remove duplicates from maildirs (garbage collection)
+ Backup system with expiration date
+
diff --git a/src/zlibs/addressbook b/src/zlibs/addressbook
@@ -116,7 +116,7 @@ query() {
learn() {
{ test ! -r ${WORKDIR}/addressbook } && { create_addressbook }
tmp=$TMPDIR/learn.$datestamp.$RANDOM
- from="`tee $tmp | formail -xFrom: | sed -e 's/\"//g'`"
+ from="`tee -i $tmp | formail -xFrom: | sed -e 's/\"//g'`"
if [ -z ${PARAM[1]} ]; then
email="`cat $tmp | ${WORKDIR}/bin/fetchaddr| awk '{print $1}'`"
else
diff --git a/src/zlibs/filters b/src/zlibs/filters
@@ -57,10 +57,10 @@ set spoolfile = $MAILDIRS/known/
set record = $MAILDIRS/sent/
set postponed= $MAILDIRS/postponed/
set tmpdir = $WORKDIR/cache
-set sendmail = "$WORKDIR/bin/jaro queue"
+set sendmail = "$WORKDIR/bin/jaro -q queue"
set header_cache= $WORKDIR/cache
set maildir_header_cache_verify=no
-set editor = "$WORKDIR/bin/jaro edit"
+set editor = "$WORKDIR/bin/jaro -q edit"
set mailcap_path = "$WORKDIR/.mutt/mailcap:$WORKDIR/mailcap:$HOME/.mailcap:/etc/mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap"
# Little Brother Database
@@ -215,6 +215,11 @@ EOF
* ? test \$PMSRC/pf-save.rc
{ INCLUDERC=\$PMSRC/pf-save.rc }
+# if its a mailinglist bounce, save it to zz.bounces
+:0
+* ^Sender: mailman-bounce@
+zz.bounces/
+
# if its an unknown mailinglist, save it into unsorted.ml
:0
* ^(List-Id|X-(Mailing-)?List):
diff --git a/src/zlibs/maildirs b/src/zlibs/maildirs
@@ -59,6 +59,7 @@ maildirmake() {
}
+# fills up all maildirs array
list_maildirs() {
maildirs=()
for m in `find $MAILDIRS -type d`; do
diff --git a/src/zlibs/search b/src/zlibs/search
@@ -103,11 +103,10 @@ EOF
####################################################
else # no folder specified on commandline, search all
# make index if no params given
- c=0
- for i in `ls $MAILDIRS`; do
- # is it a maildir?
- { maildircheck $MAILDIRS/${i} } && {
- c=`expr $c + 1`; ml="$ml:$i" }
+ list_maildirs
+ for i in ${maildirs}; do
+ # exclude zz. trash from search
+ { test ${i[1,2]} != 'zz' } && { ml="$ml:$i" }
done
fi
@@ -120,7 +119,7 @@ mformat=maildir
EOF
# just index
{ test ${#PARAM} = 0 } && {
- act "Indexing $c maildirs for search"
+ act "Indexing ${#maildirs} maildirs for search"
act "please be patient..."
mairix -F -f $rc
rm -f $rc