Mutt

Advanced feature discussion, beta programs and unsupported "Labs" features.
9 posts Page 1 of 1
by nhdesign » Sat Mar 03, 2018 10:06 am
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
by scott » Sat Mar 03, 2018 9:03 pm
nhdesign wrote: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
Hi Vic,

This was an error from Dovecot (the IMAP server software) relating to the filename on the mail spool. On our system, the filename caches the size -- if there is a size cached, and it doesn't match the file on disk, Dovecot reports that as an i/o error.

However, it's also supposed to fix the filename on disk to reflect the proper size of the file. If you use mutt again after this, do you still see the same error?

Regarding why the cached size would be different than the actual size of the file, we haven't figured that out yet, but it could be a procmail rule gone awry. I'll dig into that and see if I can find out anything.

-Scott
by nhdesign » Sun Mar 04, 2018 6:07 am
Fetching message headers... 450/517 (87%)

Internal error occurred. Refer to server log for more information. [2018-03-04 06:04:24]

Is there more to change in my muttrc than those two lines?

--
Vic
by nhdesign » Sun Mar 04, 2018 6:12 am
It works.
I kept trying, the fourth or fifth time it worked.
Sending mail is working too.
by nhdesign » Sun Mar 04, 2018 6:29 am
yup, definitely works.
by nhdesign » Sun Mar 04, 2018 10:02 am
#!/bin/sh
#newmail-semaphore
#20180304

# Anyone?
# Little help?
# The script newmail-maildir written by someone a long time ago does not work with imap.
# I have procmail touch $HOME/.mail-semaphore with every mail that arrives.
# Then have this script run every few minutes by crontab and print an alert to the screen.
# It does not work because I don't know what I am doing. Hopefully you see the intent and can fix it.
# Thanks,
# Vic


### check is mail-semaphore has a later timestamp than mail-semaphore-flag

if [[ "$HOME/.mail-semaphore-flag" -lt "$HOME/.mail-semaphore" ]]

then

### printed $HOME/.mail-semaphore to the screen.

cat $HOME/.mail-semaphore > /dev/tty

touch -r $HOME/.mail-semaphore $HOME/.mail-semaphore-flag

fi


### from my .procmailrc
#
# SEMAPHORE=$HOME/.mail-semaphore
#
# :0c
# *
# | head -1 > $SEMAPHORE
#
#
by scott » Sun Mar 04, 2018 2:44 pm
nhdesign wrote:#!/bin/sh
#newmail-semaphore
#20180304

# Anyone?
# Little help?
# The script newmail-maildir written by someone a long time ago does not work with imap.
# I have procmail touch $HOME/.mail-semaphore with every mail that arrives.
# Then have this script run every few minutes by crontab and print an alert to the screen.
# It does not work because I don't know what I am doing. Hopefully you see the intent and can fix it.
# Thanks,
# Vic


### check is mail-semaphore has a later timestamp than mail-semaphore-flag

if [[ "$HOME/.mail-semaphore-flag" -lt "$HOME/.mail-semaphore" ]]

then

### printed $HOME/.mail-semaphore to the screen.

cat $HOME/.mail-semaphore > /dev/tty

touch -r $HOME/.mail-semaphore $HOME/.mail-semaphore-flag

fi


### from my .procmailrc
#
# SEMAPHORE=$HOME/.mail-semaphore
#
# :0c
# *
# | head -1 > $SEMAPHORE
#
#
Hi Vic,

Your script almost works, except it tries to write to the tty associated with the cron job, instead of your login shell. I don't even think cronjobs have terminals attached to them.

I've written a script -- /usr/local/bin/tellme.pl -- which will write whatever is fed to it on stdin to all terminals associated with your login shells. So, whatever you pipe into it should print on your terminal.

Let me know what you think. :)

-Scott
by nhdesign » Mon Mar 05, 2018 4:16 am
No luck yet.

This line fails.
if [[ "$HOME/.mail-semaphore-flag" -lt "$HOME/.mail-semaphore" ]]

sh.sonic.net:nhdesign:/home/n/nhdesign 30 % newmail-semaphore
/home/n/nhdesign/bin/newmail-semaphore: line 20: [[: /home/n/nhdesign/.mail-semaphore-flag: syntax error: operand expected (error token is "/home/n/nhdesign/.mail-semaphore-flag")



Should this work from the command line or only from within cron?

sh.sonic.net:nhdesign:/home/n/nhdesign 31 % cat $HOME/.mail-semaphore > /usr/local/bin/tellme.pl
/usr/local/bin/tellme.pl: Read-only file system.




#!/bin/sh
#newmail-semaphore
#20180305


### check is mail-semaphore has a later timestamp than mail-semaphore-flag

if [[ "$HOME/.mail-semaphore-flag" -lt "$HOME/.mail-semaphore" ]]

then

### printed $HOME/.mail-semaphore to the screen.
# cat $HOME/.mail-semaphore > /dev/tty

cat $HOME/.mail-semaphore > /usr/local/bin/tellme.pl

touch -r $HOME/.mail-semaphore $HOME/.mail-semaphore-flag

fi

### from my .procmailrc
#
# SEMAPHORE=$HOME/.mail-semaphore
#
# :0c
# *
# | head -1 > $SEMAPHORE
#
by scott » Mon Mar 05, 2018 1:35 pm
nhdesign wrote:No luck yet.

This line fails.
if [[ "$HOME/.mail-semaphore-flag" -lt "$HOME/.mail-semaphore" ]]

sh.sonic.net:nhdesign:/home/n/nhdesign 30 % newmail-semaphore
/home/n/nhdesign/bin/newmail-semaphore: line 20: [[: /home/n/nhdesign/.mail-semaphore-flag: syntax error: operand expected (error token is "/home/n/nhdesign/.mail-semaphore-flag")



Should this work from the command line or only from within cron?

sh.sonic.net:nhdesign:/home/n/nhdesign 31 % cat $HOME/.mail-semaphore > /usr/local/bin/tellme.pl
/usr/local/bin/tellme.pl: Read-only file system.




#!/bin/sh
#newmail-semaphore
#20180305


### check is mail-semaphore has a later timestamp than mail-semaphore-flag

if [[ "$HOME/.mail-semaphore-flag" -lt "$HOME/.mail-semaphore" ]]

then

### printed $HOME/.mail-semaphore to the screen.
# cat $HOME/.mail-semaphore > /dev/tty

cat $HOME/.mail-semaphore > /usr/local/bin/tellme.pl

touch -r $HOME/.mail-semaphore $HOME/.mail-semaphore-flag

fi

### from my .procmailrc
#
# SEMAPHORE=$HOME/.mail-semaphore
#
# :0c
# *
# | head -1 > $SEMAPHORE
#
Hi,

I'll have to take a closer look at your script (got a dental appt. coming up right now), but thought I'd mention that you'll want to use the "|" character for pipes, such as:

Code: Select all

cat $HOME/.mail-semaphore | /usr/local/bin/tellme.pl
Hope that helps? :)

-Scott
9 posts Page 1 of 1

Who is online

In total there are 29 users online :: 0 registered, 0 hidden and 29 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 29 guests