jaromail

a commandline tool to easily and privately handle your e-mail
git clone git://parazyd.org/jaromail.git
Log | Files | Refs | Submodules | README

commit 4bf024b1003be096a16c49a3cfaad959da9ba81e
parent 4b3f89bc8a017a0c007a9ad6eed7d07b1b4510f1
Author: Jaromil <jaromil@dyne.org>
Date:   Sun,  3 Jun 2012 10:25:03 +0200

fixed whitelisting

Diffstat:
Msrc/jaro | 54++++++++++++++++++++++++++++++++----------------------
1 file changed, 32 insertions(+), 22 deletions(-)

diff --git a/src/jaro b/src/jaro @@ -843,50 +843,60 @@ EOF echo -n " +${destination} " >> $MUTTDIR/mboxes done - ####### - echo "# filters generated from Accounts" >> $PROCMAILDIR/rc + # if the sender is known (ldbd recognizes it) then put mail in high priority 'known' + cat <<EOF >> $PROCMAILDIR/rc +} +# whitelisting filters using lbdb +:0 w: +* ? formail -x"From:" | head -n1 | tr 'A-Z' 'a-z' | sed 's/.*\W\([0-9a-z_.-]\+@[0-9a-z_.-]\+\).*/\1/' | xargs \$JARO -q query +known/ +EOF + + ####### +cat <<EOF >> $PROCMAILDIR/rc +# filters generated from Accounts +:0 +* ? test \$PMSRC/pf-chkto.rc +{ +EOF typeset -al accts for f in `cat $WORKDIR/Accounts/* | awk '/^email/ { print $2 }'`; do echo "ADDR=${f}\tDEST=priv/\tINCLUDERC=\$PMSRC/pf-chkto.rc" >> $PROCMAILDIR/rc act "private account: <${f}>" done - echo " \\" >> $MUTTDIR/mboxes - echo " +ml.unsorted +unsorted" >> $MUTTDIR/mboxes - - uniq $MUTTDIR/mboxes > $WORKDIR/tmp/mboxes - mv $WORKDIR/tmp/mboxes $MUTTDIR/mboxes - rm -f $WORKDIR/tmp/mboxes - cat <<EOF >> $PROCMAILDIR/rc } -# save the mails -:0 -* PF_DEST ?? . -* ? test \$PMSRC/pf-save.rc -{ INCLUDERC=\$PMSRC/pf-save.rc } - -# if the sender is known (ldbd recognizes it) then put mail in high priority 'known' -:0 w: -* ? formail -x"From:" | head -n1 | tr 'A-Z' 'a-z' | sed 's/.*\W\([0-9a-z_.-]\+@[0-9a-z_.-]\+\).*/\1/' | xargs \$JARO -q query -known/ - # if its an unknown mailinglist, save it into ml.unsorted :0 * ^(List-Id|X-(Mailing-)?List): ml.unsorted/ +EOF -# if got here, go to unsorted + # MUTT (generate mailboxes priority this parser) + echo " \\" >> $MUTTDIR/mboxes + echo " +ml.unsorted +unsorted" >> $MUTTDIR/mboxes + + uniq $MUTTDIR/mboxes > $WORKDIR/tmp/mboxes + mv $WORKDIR/tmp/mboxes $MUTTDIR/mboxes + rm -f $WORKDIR/tmp/mboxes -# save the mails + # conclude + cat <<EOF >> $PROCMAILDIR/rc + +# if got here, go to unsorted +# the command below actually save the mails :0 * PF_DEST ?? . * ? test \$PMSRC/pf-save.rc { INCLUDERC=\$PMSRC/pf-save.rc } +# +# End of generated procmail rc +# EOF return 0 } # end of update()