[CentOS] logrotate: how to email logs with mutt?

Sat Dec 30 09:39:28 UTC 2006
M. Fioretti <mfioretti at mclink.it>


next week I'll install logrotate on a centos 4.4 server via yum.

The man page says that the default mail command is /bin/mail -s, but
there is no such binary on Centos.

I do have mutt installed, however, so I would like to use it. Ideally,
I would like to have logrotate send logs with mutt as attachments like

 mutt me at home.account -a compressed_log_file -s "here are your log files"

ie send the log as attachment, not email body. But the logrotate man page says:

--mail <command>

        Tells logrotate which command to use when mailing
	logs. This command should accept two arguments: 1) the
        subject of the message, and 2) the recipient.
        The command must then read a message on  standard  input  and
        mail it to the recipient.

so I have not clear how to make it use mutt as I want. Is it OK to say

--mail 'mutt me at home.account -a compressed_log_file -s "here are your log files"'

or will logrotate send the log in the email _body_?

I will check myself the first time logrotate runs, but I thought it
would be nice to know if others are already usign mutt with logrotate
and document here on the list the whole setup.