-1

I have this bash script that prepares and sends an email using SSMTP. The line that sends the message looks like this:

/usr/local/sbin/ssmtp -vvvv $recipients < $mail_file

$recipients: the recipient list $mail_file: the mail file

How would I attach a "/var/logs/foo.log to this mail? NB: An SSMTP-only solution is needed.

SCilek
  • 1
  • 1
  • If you can't change the script, replace `/usr/local/sbin/ssmtp` with a link to a proper MIME-aware mailer. – roaima Feb 10 '19 at 15:42
  • I love the simplicity of SSMTP and I guess I have found an answer. Thank you. – SCilek Feb 10 '19 at 15:47

1 Answers1

-1

Well... It turned out that this works just fine:

cat $mail_file | (cat - && uuencode /var/log/foo.log foo.log) | /usr/local/sbin/ssmtp -vvvv $recipients
SCilek
  • 1
  • 1