[Discuss] Mailcheck not showing new mail

Tom Metro tmetro+blu at gmail.com
Mon Aug 11 05:40:54 EDT 2014


Bill Horne wrote:
> Here's the output file after I renamed .mailcheckrc: /etc/mailcheckrc has only comments.
>[...] 
> open("/home/moder8/.mailcheckrc", O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/etc/mailcheckrc", O_RDONLY)      = 3
> fstat(3, {st_mode=S_IFREG|0644, st_size=1446, ...}) = 0
> mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f4dca742000
> read(3, "# mailcheckrc\tDefault configurat"..., 4096) = 1446
> read(3, "", 4096)                       = 0
> close(3)                                = 0
> munmap(0x7f4dca742000, 4096)            = 0
> exit_group(0)                           = ?
> +++ exited with 0 +++

This suggests there is no compiled-in default paths that it checks. If
no config info is loaded, the program is effectively a no-op.


> "strings /usr/bin/mailcheck >/tmp/mailcheck_output.txt"
> ...the output, which does /not/ have "/var" in it.

...and you verified that /var/spool/mail/... (or the other variation) is
not in the binary, further confirming that there aren't compiled-in
default paths.


> ... while .mailcheckrc was absent.

('strings', unlike strace, doesn't execute the binary, so what config
files are present is irrelevant.)


> I didn't get any "new mail" indication until I installed my own
> .mailcheckrc file: prior to that, mailcheck would show "no new mail."
> if there was /any/ email in /var/mail/(my user id), and would give a
> (blank) result if the spool email file was empty.

Give the logs you've shown, I suspect you are mistaken, as the code
doesn't even stat the spool file in the first scenario. It should have
no way of knowing if the file is empty, non-empty, or even if it exists.
The output message should be consistent in all 3 situations. You could
retest to confirm that, if you care. But I think you've resolved your
original problem, and we're just picking nits at this point.

(You might want to file a ticket against the Ubuntu package for
mailcheck suggesting that it should bundle an /etc/mailcheckrc with
reasonable defaults. If mailcheck ignores paths that don't exist, they
could list the few most common spool file/Maildir locations to cover
most of the bases.)

 -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