I have configured Postfix to Send Mail Using Gmail.
I have modified the file
myhostname = fqdn.peris.app mydestination = $myhostname, peris.app, localhost, localhost.localdomain, localhost relayhost = [smtp.gmail.com]:587 # Enable SASL authentication smtp_sasl_auth_enable = yes # Disallow methods that allow anonymous authentication smtp_sasl_security_options = noanonymous # Location of sasl_passwd smtp_sasl_password_maps = hash:/etc/postfix/sasl/sasl_passwd # Enable STARTTLS encryption smtp_tls_security_level = encrypt # Location of CA certificates smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
I also Log in to my gmail account, then click on Manage your account access and security settings. Scroll down to “Password & sign-in method” and click 2-Step Verification, Ensuring that 2-Step Verification is enabled and generating a password that I use in the file
Then I test it with:
sendmail email@example.com From: firstname.lastname@example.org Subject: Test mail This is a test email .
and what I receive in the
email@example.com is a mail from
firstname.lastname@example.org and I thought I should received directly from my domain,