Score:0

Configure host base Postfix and send emails using a container

in flag

I have installed and configured the nano /etc/postfix/main.cf file for postfix in the host server and when I try to send it from the host server echo "Test Postfix Gmail SMTP Relay" | mail -s "Postfix Gmail SMTP Relay Message" [email protected] it's running fine from the host machine. But when I enter the same command from the bash terminal of the container, I get this error bash: mail: command not found.

Here is the configuration inside /etc/postfix/main.cf:

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated
defer_unauth_destination
myhostname = demo.example.host
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = localhost.example.host, , localhost
relayhost = [smtp.gmail.com]:587
mynetworks = 172.17.0.2 172.17.0.3 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128                                                                                                                                    mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = 172.17.0.1
inet_protocols = all
# Enables SASL authentication for postfix
smtp_sasl_auth_enable = yes
# Disallow methods that allow anonymous authentication
smtp_sasl_security_options = noanonymous
# Location of sasl_passwd we saved
smtp_sasl_password_maps = hash:/etc/postfix/sasl/sasl_passwd
# Enable STARTTLS encryption for SMTP
smtp_tls_security_level = encrypt
# Location of CA certificates for TLS
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
anx avatar
fr flag
anx
A `mail` binary is not typically distributed with postfix (`sendmail` is, but its interface is distinct). If you want something in your container, you have to put it there.
hillsonghimire avatar
in flag
https://satishgandham.com/2016/12/sending-email-from-docker-through-postfix-installed-on-the-host/ i was following along this method.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.