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