[LINUX] Send an email from the VirtualBox CentOS 8 server using your Google account as the sending address and using the app password

# dnf install mailx

Send test email

# mail <email_address>
Subject: test
test
.
# tail -f /var/log/maillog

Connection timeout...

Email forwarding settings

setting file

/etc/postfix/sasl_passwd
[smtp.gmail.com]:587 <google account email address>:16-digit app password
# postmap /etc/postfix/sasl_passwd

setting file

/etc/postfix/main.cf
relayhost = [smtp.gmail.com]:587
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_tls_security_options = noanonymous
smtp_sasl_mechanism_filter = plain
# systemctl restart postfix

firewalld settings

# firewall-cmd --list-services --permanet
cockpit dhcpv6-client ssh
# firewall-cmd --add-service=smtp --permanent
Success
# firewall-cmd --add-service=smtps --permanent
Success
# firewall-cmd --list-services --permanet
cockpit dhcpv6-client smtp smtps ssh

Send test email

# mail <email_address>
Subject: test
test
.

Check the queue

# postqueue -p

(Reference) Delete queue

# postsuper -d ALL deferred

Recommended Posts

Send an email from the VirtualBox CentOS 8 server using your Google account as the sending address and using the app password
Send a message from the server to your Chrome extension using Google Cloud Messaging for Chrome
I tried sending an email from the Sakura server with flask-mail
Output the report as PDF from DB with Python and automatically attach it to an email and send it
Send an email directly by pulling an MX record from your email address in Python
Create an account from CentOS mail server construction
Access Google Cloud Storage from Python (boto) using your service account and key file (p12)
[Map display] Display a map from the address registered by the user using the Google Maps JavaScript API and Geocoding API!