space vs tab
Bill Williamson <[email protected]> Wed, 06 Oct 2004 15:38:42 +1000
| Newsgroups | gmane.mail.ifile.general |
|---|---|
| Message-ID | <[email protected]> |
This is a MIME-formatted message. If you see this text it means that your
E-mail software does not support MIME-formatted messages.
--=_sumo.knightsofmars.com-32060-1097040578-0001-2
Content-Type: text/plain; charset=iso-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
I am using ifile in a "crazy style" auto-filter arrangement on my
courier imap server (with procmail). I have folders with spaces in
their name, and currently do some odd substitution tricks to get it changed.
Attached is my procmailrc and my ifile.sh "autolearn" file which runs
once every 15 minutes from cron. Any suggestions on de-crazifying this
would be helpful as well.
--=_sumo.knightsofmars.com-32060-1097040578-0001-2
Content-Type: text/plain; name="ifile.sh"; charset=iso-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="ifile.sh"
#!/bin/bash
IFS="
"
for mail in $(find /home/batkiwi/Maildir -cmin -15 -path '*cur*' -type f | grep -v 'Trash' | grep -v 'Sent' | grep -v 'Spam' )
do
if [ -f $mail ]
then
folder=`echo $mail | sed 's/.*Maildir\/\(.*\)\/.*/\1/'`
if [ "$folder" = "cur" ]
then
folder="INBOX"
else
folder=`echo $folder | sed 's/\.\(.*\)\/cur/\1/' | sed 's/ /:/g'`
fi
oldfolder=`cat "$mail" | formail -z -x X-IFile-Guess | sed 's/ /:/g'`
subject=`cat "$mail" | formail -z -x Subject`
if [ "$oldfolder" = "$folder" ]
then
#echo "$oldfolder already correct for $subject"
blah="blah"
elif [ "$oldfolder" = "" ]
then
echo "old folder empty, new folder $folder for $subject"
grep -E "^[-[:alnum:]]*: " "$mail" | /home/batkiwi/ifile -i "$folder"
else
echo "$oldfolder to $folder for $subject"
grep -E "^[-[:alnum:]]*: " "$mail" | /home/batkiwi/ifile -d "$oldfolder" -i "$folder"
fi
fi
done
--=_sumo.knightsofmars.com-32060-1097040578-0001-2
Content-Type: text/plain; name=".procmailrc"; charset=iso-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename=".procmailrc"
#Preliminaries
SHELL=/bin/sh #Use the Bourne shell (check your path!)
MAILDIR=${HOME}/Maildir/ #First check what your mail directory is!
DEFAULT=${MAILDIR}
LOGFILE=${MAILDIR}/procmail.log
LOG="--- Logging ${LOGFILE} for ${LOGNAME}, "
IFILE=/home/batkiwi/ifile
#pass to spamc
:0fw
| spamc
#test ifile
:0wh
IFILECAT=| ${IFILE} -c -q
#IFILECAT=| grep -E "^[-[:alnum:]]*: " | ${IFILE} -c -q
IFILECAT=`/bin/echo ${IFILECAT} | /bin/sed 's/:/ /g'`
:0fw
| formail -A "X-IFile-Guess: ${IFILECAT}"
IFILECAT=`/bin/echo ${IFILECAT} | /bin/sed 's/ /\\ /g'`
#get rid of hella-spam, 8 or more stars
:0:
* ^X-Spam-Level: \*\*\*\*\*\*\*\*
/dev/null
#filter out me spam, mateys!
:0:
* ^X-Spam-Flag:.*YES
.Trash/
:0:
* ^X-IFile-Guess: INBOX
${MAILDIR}
:0:
".${IFILECAT}/"
# Accept all the rest to your default mailbox
# should never hit this one
:0:
${MAILDIR}
--=_sumo.knightsofmars.com-32060-1097040578-0001-2
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Ifile-discuss mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/ifile-discuss
--=_sumo.knightsofmars.com-32060-1097040578-0001-2--