I use mailutils , and the confusing part is that to attach the file you need to use the capital parameter A. Below is an example.
echo 'here you put the message body' | mail -A syslogs.tar.gz admin@domain.org
If you want to know if your mail command is from mailutils, just run "mail -V".
root@your-server:~$ 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.
Rooie3000 Aug 23 '17 at 9:28 2017-08-23 09:28
source share