[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: exmh and procmail filtering



"Oliver Elphick" wrote:
  >Erik van der Meulen wrote:
  > ...
  >  >Could anyone send me an example of a .procmail file for use with exmh?
  >
  >This is my ~/.procmailrc:
  >
  >MAILDIR=$HOME/Mail
  >LOCKFILE=$HOME/procmail/lock
  >LOGFILE=$HOME/procmail/new
  >LOGABSTRACT=all
  >TRAP=$HOME/procmail/postprocess

I forgot to add the postprocess file, whose job is to update the unseen
sequence so that exmh will highlight messages you haven't read yet:

#! /bin/bash

# Update the unseen sequence in MH
cd $HOME/procmail
mpaths=`awk '/Folder:/{print $2}' new`
for mpath in $mpaths
do
    mpos=`echo $mpath | awk -F/ '{print NF-1}'`
    folder=`echo $mpath | cut -d/ -f1-$mpos`
    msgno=`echo $mpath | awk -F/ '{print $NF}'`
    seqf=$HOME/Mail/$folder/.mh_sequences
    newseqf=$HOME/Mail/$folder/.mh_sequences_new
    touch $seqf

    if grep unseen: $seqf >/dev/null
    then
	    sed "/^unseen:/s/\$/ $msgno/" <$seqf >$newseqf
	    mv $newseqf $seqf
    else
	    echo unseen: $msgno >>$seqf
    fi
done

cat new >> log
rm new

-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver

PGP key from public servers; key ID 32B8FAA1



--
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: