Boston Linux & UNIX was originally founded in 1994 as part of The Boston Computer Society. We meet on the third Wednesday of each month at the Massachusetts Institute of Technology, in Building E51.

BLU Discuss list archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss] Mailcheck not showing new mail

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 Metro
The Perl Shop, Newton, MA, USA
"Predictable On-demand Perl Consulting."

BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!

Boston Linux & Unix /