borgmatic-collective / docker-borgmatic

Borgmatic in Docker
GNU General Public License v3.0
314 stars 88 forks source link

[msmtp] Not using MAIL_SUBJECT #242

Closed rallisf1 closed 4 months ago

rallisf1 commented 1 year ago

Borgmatic Version: 1.7.15

Mails get sent fine but only have ✅ SUCCESS: or ❌ FAILED: as subject without the value of MAIL_SUBJECT

witten commented 1 year ago

Just a drive-by comment: I believe that the msmtp image is deprecated and may be removed from a future release. I know that doesn't help you with the issue you're having, but I thought it worth mentioning.

Psycho0verload commented 8 months ago

@rallisf1 have a look at #228. That MSMTP has been removed is not a big deal. You can easily replace it with apprise.

As cronjob you set the following:

*/5 * * * * PATH=$PATH:/usr/local/bin /usr/local/bin/borgmatic --stats -v 0 > /tmp/backup_run.log

This will write the output of Borgmatic to the log file and then send it away via apprise

before_backup:
  - echo "Starting a backup job."
after_backup:
  - echo "Backup created."
  - apprise -vv -t "✅ SUCCESS" -b "$(cat /tmp/backup_run.log)" "mailtos://smtp.example.com:587?user=info@example.com&pass=YourSecurePassword&from=server@example.com"
on_error:
  - echo "Error while creating a backup."
  -  apprise -vv -t "❌ FAILED" -b "$(cat /tmp/backup_run.log)" "mailtos://smtp.example.com:587?user=info@example.com&pass=YourSecurePassword&from=server@example.com"

With this it is also possible to update to 1.8.3 without further ado.

modem7 commented 4 months ago

Hi guys,

Apologies for the very late reply.

We've moved over to Apprise now instead of msmtp, so please migrate your configs using apprise.