mutt on sh.sonic.net

General discussions and other topics.
4 posts Page 1 of 1
by nhdesign » Thu Mar 01, 2018 6:00 pm
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;
by kgc » Fri Mar 02, 2018 10:15 am
Vic, this kind of setup cannot work as written in the new environment. If you're dependent on this behavior and just running mutt in a second terminal on your desktop isn't an option, the best thought I'd have would be to have procmail touch a file in your home directory every time you received a message. You could then compare the timestamp on that file to the last time you checked in and generate the new message notification. This should work for the foreseeable future.

Code: Select all

SEMAPHORE=~/.mail-semaphore

#copy message to rule, printing first line of the message into the semaphore
:0c
* 
| head -1 > $SEMAPHORE

Kelsey Cummings
System Architect, Sonic.net, Inc.
by nhdesign » Fri Mar 02, 2018 1:20 pm
Got it, thanks,
by nhdesign » Fri Mar 02, 2018 1:46 pm
Hi,

Per mutt_hep.sh I added to my muttrc

set spoolfile="imaps://nhdesign@imap.sonic.net/INBOX"
set folder="imaps://nhdesign@imap.sonic.net/INBOX"

After I enter my passwd the following flashes by

Internal error occurred. Refer to server log for more information. [2018-03-02 13:42:27]

After which mutt opens without any mail and this error across the bottom
Error opening mailbox

Thanks,
Vic
4 posts Page 1 of 1

Who is online

In total there are 104 users online :: 0 registered, 0 hidden and 104 guests (based on users active over the past 5 minutes)
Most users ever online was 999 on Mon May 10, 2021 1:02 am

Users browsing this forum: No registered users and 104 guests