restic-backup-docker icon indicating copy to clipboard operation
restic-backup-docker copied to clipboard

fix: Send mail notifications via msmtp

Open gschafra opened this issue 2 years ago • 3 comments

  • since Alpine's mail no longer supports -S
  • fixes #82

gschafra avatar Nov 17 '23 06:11 gschafra

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

gschafra avatar Nov 17 '23 06:11 gschafra

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.

sylvarg avatar Jan 20 '24 17:01 sylvarg

@sylarevan Oh, thanks. Should be fixed now.

gschafra avatar Jan 20 '24 20:01 gschafra