lisenet / clamav-daily

Automate ClamAV to perform daily system scans and send email notifications.
BSD 3-Clause "New" or "Revised" License
38 stars 20 forks source link

Mail commands should use -A. mail: Invalid header: /var/log/rkhunter.log #5

Closed hydrosine closed 7 years ago

hydrosine commented 7 years ago

Hi,

In the scripts you use -a in the mail commands to attach the logfile. This does not function and results in an error that an invalid header is being added to the mail.

Looking in the documentation for the mail command, -a is used for adding headers, while -A is used for attaching files.

  -a, --append=HEADER: VALUE append given header to the message being sent
  -A, --attach=FILE          attach FILE
lisenet commented 7 years ago

What software do you use for it? I have heirloom mailx v12.5, and -a attaches a file:

-a file Attach the given file to the message. I guess it depends on your mail software implementation.

hydrosine commented 7 years ago

I used the ubuntu mailutils package.

Missed the message about heirloom mailx!

mail -V
mail (GNU Mailutils) 2.99.98
Copyright (C) 2010 Free Software Foundation, inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
lisenet commented 7 years ago

I don't use that one so cannot tell much, but as I said, it likely depends on implementation, as these are two different packages. The script uses Heirloom-mailx, so -a is correct from that point of view. If you use some other software, just modify the script appropriately.

hydrosine commented 7 years ago

Thanks, edited the title so it reflects the error.