diff --git a/files/entrypoint.sh b/files/entrypoint.sh index 4596222..d67e340 100755 --- a/files/entrypoint.sh +++ b/files/entrypoint.sh @@ -90,11 +90,13 @@ if [ -f /firstrun ]; then # Configure standard mail delivery parameters (may be overriden by backuppc user-wide config) echo "account default" > /etc/msmtprc + echo "logfile /var/log/msmtp.log" >> /etc/msmtprc echo "host ${SMTP_HOST:-mail.example.org}" >> /etc/msmtprc - echo "auto_from on" >> /etc/msmtprc if [ "${SMTP_MAIL_DOMAIN:-}" != "" ]; then - echo "maildomain ${SMTP_MAIL_DOMAIN}" >> /etc/msmtprc + echo "from %U@${SMTP_MAIL_DOMAIN}" >> /etc/msmtprc fi + touch /var/log/msmtp.log + chown "${BACKUPPC_USERNAME}:${BACKUPPC_GROUPNAME}" /var/log/msmtp.log # Clean rm -rf /root/BackupPC-$BACKUPPC_VERSION.tar.gz /root/BackupPC-$BACKUPPC_VERSION /firstrun diff --git a/files/supervisord.conf b/files/supervisord.conf index e4ca1ef..574c25e 100644 --- a/files/supervisord.conf +++ b/files/supervisord.conf @@ -36,3 +36,9 @@ redirect_stderr = true stdout_logfile = /dev/stdout stdout_logfile_maxbytes = 0 user = %(ENV_BACKUPPC_USERNAME)s + +[program:watchmails] +command = tail -f /var/log/msmtp.log +redirect_stderr = true +stdout_logfile = /dev/stdout +stdout_logfile_maxbytes = 0