Having challenges with Postfix install



Ref; the Configure Postfix to Use Gmail SMTP on Ubuntu tutorial.

I keep flunking the “Test mail from postfix” test. Are there any other files that have my email besides “Main.cf” and sasl_passwd? I keep getting “malformed email”

mail: Cannot parse address postfix | mail -s Test’ (while expandingpostfix | mail -s Test’): Malformed email address
mail: Cannot parse address Postfix you@example.com mail: mail: mail: echo Test' (while expandingPostfix you@example.com
mail: echo Test’): Malformed email address
mail: Cannot parse address postfix | mail -s Test’ (while expandingpostfix | mail -s Test’): Malformed email address
mail: Cannot parse address Postfix”’ (while expandingPostfix”’): Malformed email address

Thanks in advance


Hi, crosscheck you have installed packages as given on https://rtcamp.com/tutorials/linux/ubuntu-postfix-gmail-smtp/#relaying-postfix-mails-via-smtpgmailcom
and post us the contents of /etc/postfix/main.cf and /etc/postfix/sasl_passwd and command you fired to test for sending mail.


Hi Hershad,

I incorrectly thought the mailutil file had been downloaded. When I discovered the error I went back through the whole install again. I don’t know if that’s the problem but here are the file outputs;


Debian specific: Specifying a file name will cause the first

line of that file to be used as the name. The Debian default

is /etc/mailname.

#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

appending .domain is the MUA’s job.

append_dot_mydomain = no

Uncomment the next line to generate “delayed mail” warnings

#delay_warning_time = 4h

readme_directory = no


relayhost = [smtp.gmail.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_use_tls = yes

TLS parameters

smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for

information on enabling SSL in the smtp client.

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_un$
myhostname = cageyaging.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = cageyaging.com, localhost.com, , localhost
relayhost =
mynetworks = [::ffff:]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all

[smtp.gmail.com]:587 cageyaging@gmail.com:my password



main.cf and sasl_passwd contents you posted looks correct.
After reinstall what errors did you get?? can you post them?


Hello @apprei9,

We haven’t heard back from you in long time. It looks like your issue is resolved.

I am closing this support ticket for now. Feel free to create a new support ticket if you have any queries further. :slight_smile: