[Discuss] Mailcheck not showing new mail

Tom Metro tmetro+blu at gmail.com
Sun Aug 10 17:01:56 EDT 2014


Bill Horne wrote:
> The result of running "mailcheck -cs" without a local .mailcheckrc is
> "no new mail." when there is mail in the mailbox, and no output when the
> mailbox is empty. It *is* paying attention to the mail spool, albeit not
> in the way I want. What's up with that?
> 
> ...why it would be able to tell the difference between a spool file
> with <anything> in it, or <nothing> in it, but not signal if the file
> has new mail?

With Maildir detecting new mail is simply a matter of looking for the
presence of files in a 'new' subdirectory. If I recall, with mbox files
the file has to be parsed and the headers of each message examined.
There needs to be coordination between how the MUA marks messages as
read and the mail checking tool. Maybe there is a disagreement between
mailcheck and your MUA.

The documentation on mailcheck seems sparse. It doesn't even state what
the default behavior is if there are no config files. To understand what
it is doing would require using strace and/or examining the source.

(I'd try running "strace -o/tmp/mailcheck ..." then grep /tmp/mailcheck
for /var to see what spool files it is accessing. If you spot an open()
syscall, it'll return a file descriptor, and then you can look for
subsequent syscalls (like read() and stat()) on that descriptor to see
what it is doing with the file.)


>> Also check to see if /etc/mailcheckrc exists and see what it points to.
> 
> Another puzzle: on Ubuntu 14.04 LTS, it's all commented out. There is an
> entry that looks like
> 
> #/var/spool/mail/$(USER)

By convention, a commented out config line often will indicate the
compiled-in defaults. (You can confirm that by running something like
"strings /usr/bin/mailcheck | fgrep /var" and see if it spits out a
similar looking path.)

That would imply it should work as expected without altering
/etc/mailcheckrc or adding an rc file. But you're saying you didn't get
the expected behavior until you added "/var/mail/moder8" to .mailcheckrc?

 -Tom

-- 
Tom Metro
The Perl Shop, Newton, MA, USA
"Predictable On-demand Perl Consulting."
http://www.theperlshop.com/



More information about the Discuss mailing list