lobaro / restic-backup-docker

A docker container to automate backups with restic
Apache License 2.0
330 stars 114 forks source link

fix: Send mail notifications via msmtp #84

Open gschafra opened 7 months ago

gschafra commented 7 months ago
gschafra commented 7 months ago

Successfully tested it using a custom image build using this changes in one of our prod environments in my company

sylarevan commented 5 months ago

Hi there. I also had the issue with emails not being sent after a backup. I can confirm the modifications in backup.sh, check.sh and entry.sh proposed in this PR are working when used with a correct msmprtc configuration file. But the Dockerfile must obviously be modified accordingly to install the msmtp package and to "change" sendmail binary which is using busybox initially. So, modifing the Dockerfile with :

RUN apk add --update --no-cache curl mailx msmtp

and adding

RUN ["ln", "-sf", "/usr/bin/msmtp", "/usr/sbin/sendmail"]

should also be part of this PR.

With this PR and the modifications above in the Dockerfile, emails are sent correctly.

gschafra commented 5 months ago

@sylarevan Oh, thanks. Should be fixed now.