Open manshurtigh opened 4 months ago
To get around this I added a postfix relay that supports authentication and referenced that in my db-backup configuration.
postfixrelay:
container_name: postfixrelay
image: loganmarchione/docker-postfixrelay:latest
restart: unless-stopped
environment:
- TZ=America/Los_Angeles
- RELAY_HOST=email-smtp.us-east-1.amazonaws.com
- RELAY_PORT=587
- RELAY_USER=<USER>
- RELAY_PASS=<PASS>
networks:
- docker-backup
ports:
- 25:25
volumes:
- postfixrelay_data:/var/spool/postfix
I suppose you can mount a msmtp configuration file to /etc/msmtprc
.
To get around this I added a postfix relay that supports authentication and referenced that in my db-backup configuration.
postfixrelay: container_name: postfixrelay image: loganmarchione/docker-postfixrelay:latest restart: unless-stopped environment: - TZ=America/Los_Angeles - RELAY_HOST=email-smtp.us-east-1.amazonaws.com - RELAY_PORT=587 - RELAY_USER=<USER> - RELAY_PASS=<PASS> networks: - docker-backup ports: - 25:25 volumes: - postfixrelay_data:/var/spool/postfix
This seems like a great idea. Could you also provide how you specify the postfixrelay container in the configuration for the docker-db-backup?
I included the following environment variables:
NOTIFICATION_TYPE: EMAIL
MAIL_FROM: backup@example.local
MAIL_TO: admin@example.local
SMTP_HOST: postfixrelay
SMTP_PORT: 25
postfixrelay being the name of my postfix container.
Cheers! I got the postfixrelay container working. Successfully sent a test email. However, if I run a "backup-now" in the docker-db-backup container it does not send an email. I don't even see it trying in the logs of the postfixrelay container.
Below is configured in docker-db-backup
ENABLE_NOTIFICATIONS=true
NOTIFICATION_TYPE=EMAIL
I even get a notice in the log saying:
2024-08-14.21:02:16 [NOTICE] ** [messaging] Container configured to route mail via SMTP to 'postfixrelay
Summary
Email is not sent. Need to specify SMTP authentication.
Steps to reproduce
Configure below:
What is the expected correct behavior?
All smtp servers expect an authentication.
Environment
Possible fixes
I don't know if it's not documented or I cannot find it?