Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

postfix + gmail

51 views
Skip to first unread message

D. R. Evans

unread,
Jun 3, 2022, 3:20:06 PM6/3/22
to
I am trying to configure postfix correctly to send e-mail to a gmail.com
account, using my gmail credentials.

1. It all works fine if I use Thunderbird, with the following configuration:
server name: smtp.googlemail.com
port: 587
Connection security: STARTTLS
Authentication method: normal password
username: doc....@gmail.com
and the password set to my gmail password.

That, in fact, is the method that I am using to post this e-mail to the reflector.

2. But when I try to duplicate that with postfix, I receive the following error:

> <doc....@gmail.com>: host smtp.googlemail.com[142.250.138.16] said: 530-5.7.0
> Authentication Required. Learn more at 530 5.7.0
> https://support.google.com/mail/?p=WantAuthError
> e12-20020a9d490c000000b0060b6facd5e4sm4170514otf.29 - gsmtp (in reply to
> MAIL FROM command)

I have spent most of the morning following various Internet threads related to
this error, and making many variations to my postfix configuration, but
without success.

FWIW, here are the relevant parts of my current postfix configuration, and it
generates the error message quoted above (I am running debian stable):

in main.cf:

smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl/sasl_passwd
smtp_sasl_security_options =
smtp_sasl_type = cyrus
smtp_use_tls = yes
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt

in sasl_passwd:

[smtp.googlemail.com]:587 doc....@gmail.com:<password>

I did check that the password matches exactly the password in Thunderbird.

So if some postfix guru could enlighten me as to what I need to change, I'd be
very grateful.

Doc

--
Web: http://enginehousebooks.com/drevans

IL Ka

unread,
Jun 3, 2022, 3:40:05 PM6/3/22
to
Hello.
Do you have "relayhost" set to gmail SMTP server?

Did you call postmap(1) to build password file?


Here are a couple of tutorials:

The best place to ask postfix questions is postfix mail list: https://www.postfix.org/lists.html
Postfix developers answer there.

You can try to debug and increase logging :https://www.postfix.org/DEBUG_README.html




D. R. Evans

unread,
Jun 3, 2022, 4:10:07 PM6/3/22
to
And, of course, half an hour after giving up and asking for help, I discovered
what I needed to change.

I did a "journalctl | grep smtp" and noticed that, when my machine was
connecting to gmail, it seemed to be doing so on port 25. Aha!

So I changed my transport file explicitly to use port 587 when connecting to
smtp.googlemail.com, reloaded everything and now it works.

(Slightly in my defence, I had briefly pondered the question of port number
earlier this morning, but, since I hadn't seem any mention of it in my reading
of solutions to this problem, I figured that the fact that I had enabled auth
in the main.cf file must mean that postfix was automagically going to use port
587 instead of port 25. Now I know better.)
0 new messages