Discussion:
Xbiff that works with maildir folders
Clint Olsen
2002-03-27 19:27:20 UTC
Permalink
I was looking up how to write a nice test (in sh) for new mail delivery to
my spoolfile so that xbiff would work correctly. My guess is that someone
has done this already. Anyone care to share? There aren't any simple
tests(1) for directory modification.

Thanks,

-Clint

To Unsubscribe: send mail to ***@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Matthew D. Fuller
2002-03-28 15:55:20 UTC
Permalink
On Wed, Mar 27, 2002 at 11:27:20AM -0800 I heard the voice of
Post by Clint Olsen
I was looking up how to write a nice test (in sh) for new mail delivery to
my spoolfile so that xbiff would work correctly. My guess is that someone
has done this already. Anyone care to share? There aren't any simple
tests(1) for directory modification.
Obvious hacks possible for differing Maildir locations. Note that it
doesn't QUITE duplicate the mbox behavior exactly (it tries to, but for
reasons I never cared enough about to really dig into, it doesn't), but
it's nearly the same. It doesn't very well handle monitoring more than
one Maildir/ (or being invoked by more than one process) per user; you'd
need to hack it further for that. I just use xbiff for my inbox, and use
xbuffy (which has native Maildir support) for the rest.

If you didn't care to try and figure out why the "non-new but unread"
case isn't working, you could theoretically make it more efficient
(especially when you get 4 digits or so of new/ messages) by using a
/bin/ls -f instead of the -lT.

<ramble>


#!/bin/sh
# Quick check of Maildir/ for new mail
# Author: Matthew Fuller
# <***@over-yonder.net> <http://www.over-yonder.net/~fullermd>

CURFILE="$HOME/.maildircheck/cur"
PREVFILE="$HOME/.maildircheck/prev"

/bin/mkdir -p $HOME/.maildircheck
/bin/ls -lT $HOME/Maildir/new/ > $CURFILE
if [ "`wc -l $CURFILE | awk '{print $1}'`" != "0" ]; then
if [ -f $PREVFILE ]; then
if(!(cmp -s $CURFILE $PREVFILE)); then
mv $CURFILE $PREVFILE
# New and unread messages
exit 0
fi
# Non-new but unread
mv $CURFILE $PREVFILE
exit 1
fi
mv $CURFILE $PREVFILE
exit 0
fi
mv $CURFILE $PREVFILE
# No messages
exit 2
--
Matthew Fuller (MF4839) | ***@over-yonder.net
Unix Systems Administrator | ***@futuresouth.com
Specializing in FreeBSD | http://www.over-yonder.net/

"The only reason I'm burning my candle at both ends, is because I
haven't figured out how to light the middle yet"

To Unsubscribe: send mail to ***@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Jeff Lawton
2002-03-28 16:08:39 UTC
Permalink
Check this bill out. Please help support the freedom of information.

http://www.wired.com/news/politics/0,1283,51274,00.html

Please write your senators and let them know what you think. It is referred
to Senate bill S 2048

Jeff





To Unsubscribe: send mail to ***@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Sam Suh
2002-03-28 16:17:26 UTC
Permalink
If this becomes law ... Man, I don't even want to think about that
possibility.

To Unsubscribe: send mail to ***@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Marco Radzinschi
2002-03-28 20:41:02 UTC
Permalink
If it passes, it seems a likely candidate for the Supreme Court once the
first violation is prosecuted.

Marco Radzinschi

E-Mail: ***@radzinschi.com
AOL IM: CrackedBoy
Post by Jeff Lawton
Check this bill out. Please help support the freedom of information.
http://www.wired.com/news/politics/0,1283,51274,00.html
Please write your senators and let them know what you think. It is referred
to Senate bill S 2048
Jeff
To Unsubscribe: send mail to ***@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message

Loading...