Hi,
The following script running in background works well on bolt to notify when new email arrives.
Does not work on the new server.
Anyone out there have a replacement or uprev to work on sh.sonic.net?
From my .login
nonewmail # stop recursive newmail invocations
newmail-maildir & # notify when there is new mail
Thanks,
Vic
#!/bin/sh
#newmail-maildir
#kentrak@sonic.net
#20030910
# From: Kevan Benson <kentrak@sonic.net>
# Subject: Re: newmail, would this work?
# Newsgroups: sonic.os.unix
# Date: Tue, 09 Sep 2003 20:36:27 GMT
#
# I just put a little hacked up script in /usr/local/bin called
# newmail-maildir.
#
# Run it with an & so it's backgrounded, and set your checking interval with
# the shell variable NM_SLEEP (in seconds).
#
# Oh, and if anyone knows how to delay until the user hits enter, that would
# make this better. I'm thinking maybe setting the shell prompt, but that's
# probably too bash specific.
#
# Note: This is a slightly modified version of a script to allow xbiff to
# check for new mail in maildir spools from the contributed 3rd party
# software section of the qmail site.
if [ $NM_SLEEP ]; then
echo Checking for new mail every $NM_SLEEP seconds.
else
NM_SLEEP=60;
fi
while [ 0 ]; do
ls $MAIL/new > $HOME/.curmail
if [ "`wc -l $HOME/.curmail | colrm 8`" != " 0" ]; then
if [ -f $HOME/.prevmail ]; then
if [ "`diff --brief $HOME/.curmail $HOME/.prevmail`" ]; then
mv $HOME/.curmail $HOME/.prevmail
echo
echo
echo "You have new mail."
echo
fi
else
mv $HOME/.curmail $HOME/.prevmail
echo "You have new mail."
fi
fi
chmod 600 $HOME/.curmail > /dev/null 2>&1
chmod 600 $HOME/.prevmail > /dev/null 2>&1
sleep $NM_SLEEP
done;
The following script running in background works well on bolt to notify when new email arrives.
Does not work on the new server.
Anyone out there have a replacement or uprev to work on sh.sonic.net?
From my .login
nonewmail # stop recursive newmail invocations
newmail-maildir & # notify when there is new mail
Thanks,
Vic
#!/bin/sh
#newmail-maildir
#kentrak@sonic.net
#20030910
# From: Kevan Benson <kentrak@sonic.net>
# Subject: Re: newmail, would this work?
# Newsgroups: sonic.os.unix
# Date: Tue, 09 Sep 2003 20:36:27 GMT
#
# I just put a little hacked up script in /usr/local/bin called
# newmail-maildir.
#
# Run it with an & so it's backgrounded, and set your checking interval with
# the shell variable NM_SLEEP (in seconds).
#
# Oh, and if anyone knows how to delay until the user hits enter, that would
# make this better. I'm thinking maybe setting the shell prompt, but that's
# probably too bash specific.
#
# Note: This is a slightly modified version of a script to allow xbiff to
# check for new mail in maildir spools from the contributed 3rd party
# software section of the qmail site.
if [ $NM_SLEEP ]; then
echo Checking for new mail every $NM_SLEEP seconds.
else
NM_SLEEP=60;
fi
while [ 0 ]; do
ls $MAIL/new > $HOME/.curmail
if [ "`wc -l $HOME/.curmail | colrm 8`" != " 0" ]; then
if [ -f $HOME/.prevmail ]; then
if [ "`diff --brief $HOME/.curmail $HOME/.prevmail`" ]; then
mv $HOME/.curmail $HOME/.prevmail
echo
echo
echo "You have new mail."
echo
fi
else
mv $HOME/.curmail $HOME/.prevmail
echo "You have new mail."
fi
fi
chmod 600 $HOME/.curmail > /dev/null 2>&1
chmod 600 $HOME/.prevmail > /dev/null 2>&1
sleep $NM_SLEEP
done;