On my newly built system, logcheck won't function and gives errors like the following: sendmail: account default not found: no configuration file available Error closing sendmail: non-zero exit (78) at /usr/bin/mime-construct line 559 The root of this issue is two fold: - By default the logs I'm using are with root-only read permissions (/var/log/messages is 0600) - The /etc/msmtprc file is also too restrictive for this tool to make use of (0600) My solution: -- Add the logcheck user to the 'adm' group in /etc/group -- chmod 0640 /etc/msmtprc and /var/log/messages -- chgrp adm /etc/msmtprc and /var/log/messages -- Modify /etc/syslog-ng.conf to add permissions to have it set the permissions itself: destination messages { file("/var/log/messages" perm(0640) group(adm)); }; I only mention this as it took a lot of trial and error to figure this out. As a minimum, it would be great if the ebuild printed a message along these lines, or at best if the system had a group and appropriate permissions for logcheck to hook into.
(In reply to Eddie Parker from comment #0) > sendmail: account default not found: no configuration file available > Error closing sendmail: non-zero exit (78) at /usr/bin/mime-construct line > 559 That is from mail-mta/msmtp, which suggests (in einfo messages): "Please edit /etc/msmtprc before first use. In addition, per user configuration files can be placed as '~/.msmtprc'. See the msmtprc-user.example file under /usr/share/doc/${PF}/ for an example." So you should set msmtp up properly system-wide and per-user, perhaps? Or if the system-wide runtime configuration works for all users, make it world-readable? > The root of this issue is two fold: One, then. The other issue (if there is one) is in mail-mta/msmtp. > - By default the logs I'm using are with root-only read permissions > (/var/log/messages is 0600)
(In reply to Jeroen Roovers from comment #1) > (In reply to Eddie Parker from comment #0) > > sendmail: account default not found: no configuration file available > > Error closing sendmail: non-zero exit (78) at /usr/bin/mime-construct line > > 559 > > That is from mail-mta/msmtp, which suggests (in einfo messages): > > "Please edit /etc/msmtprc before first use. > In addition, per user configuration files can be placed > as '~/.msmtprc'. See the msmtprc-user.example file under > /usr/share/doc/${PF}/ for an example." > > So you should set msmtp up properly system-wide and per-user, perhaps? Or if > the system-wide runtime configuration works for all users, make it > world-readable? Thanks for replying Jeroen. I suppose that's likely a better way of doing it: having a ~/.msmtprc for each user: however logcheck runs under a user with no home directory, so their ~/.msmtprc would be under /.msmtprc, I imagine? I've gone ahead and made the default /etc/msmtprc readable by it's "group" and changed the group to "adm", which logcheck is now a part of, and the e-mail portion works fine. > > The root of this issue is two fold: > > One, then. The other issue (if there is one) is in mail-mta/msmtp. Agreed, but they need to play nicely together (The logcheck user needs to be in the same group and have read permissions to /etc/msmtprc).
As far as I can see this should be covered by http://www.gentoo.org/doc/en/logcheck.xml Please let me know if I'm missing something.