0

I came across a wired issue it is obviously Gmail relay service resolved as IPv4/v6 randomly, which causes the authentication not passed.

I used DigitalOcean Ubuntu 18.10 + Postfix + G Suite account + Let's Encrypt all configured following instructions below.

When testing via SSH terminal (sendmail on local server)

sendmail my.test.account@gmail.com
From: support@mydomain.com
Subject: Test mail
This is a test email
.

I got two different results randomly:

Fail:

postfix/pickup[21093]: E16871F9559: uid=1000 from=<eric>
postfix/cleanup[25243]: E16871F9559: message-id=<20190316202842.E16871F9559@masternode.mydomain.com>
postfix/qmgr[21094]: E16871F9559: from=<eric@mydomain.com>, size=299, nrcpt=1 (queue active)
postfix/smtp[25246]: E16871F9559: to=<my.test.account@gmail.com>, relay=smtp-relay.gmail.com[2a00:1450:400c:c0a::1c]:587, delay=12, delays=12/0.01/0.3/0.02, dsn=5.7.1, status=bounced (host smtp-relay.gmail.com[2a00:1450:400c:c0a::1c] said: 550-5.7.1 Invalid credentials for relay [2a03:b0c0:1:d0::59a:1]. The IP address 550-5.7.1 you've registered in your G Suite SMTP Relay service doesn't match 550-5.7.1 domain of the account this email is being sent from. If you are 550-5.7.1 trying to relay mail from a domain that isn't registered under your G 550-5.7.1 Suite account or has empty envelope-from, you must configure your 550-5.7.1 mail server either to use SMTP AUTH to identify the sending domain or 550-5.7.1 to present one of your domain names in the HELO or EHLO command. For 550-5.7.1 more information, please visit 550 5.7.1  https://support.google.com/a/answer/6140680#invalidcred c2sm93605wrr.48 - gsmtp (in reply to MAIL FROM command))
postfix/smtp[25246]: E16871F9559: lost connection with smtp-relay.gmail.com[2a00:1450:400c:c0a::1c] while sending RCPT TO
postfix/cleanup[25243]: 46B1F1F955A: message-id=<20190316202843.46B1F1F955A@masternode.mydomain.com>
postfix/qmgr[21094]: 46B1F1F955A: from=<>, size=3748, nrcpt=1 (queue active)
postfix/trivial-rewrite[25245]: warning: do not list domain mydomain.com in BOTH mydestination and virtual_alias_domains
postfix/bounce[25248]: E16871F9559: sender non-delivery notification: 46B1F1F955A
postfix/qmgr[21094]: E16871F9559: removed
postfix/local[25250]: warning: database /etc/aliases.db is older than source file /etc/aliases
postfix/local[25250]: 46B1F1F955A: to=<nobody@mydomain.com>, orig_to=<eric@mydomain.com>, relay=local, delay=0.02, delays=0/0.02/0/0, dsn=2.0.0, status=sent (delivered to file: /dev/null)
postfix/qmgr[21094]: 46B1F1F955A: removed

Success and I got the mail

postfix/pickup[21093]: 10C7A1F9559: uid=1000 from=<eric>
postfix/cleanup[25243]: 10C7A1F9559: message-id=<20190316202949.10C7A1F9559@masternode.mydomain.com>
postfix/qmgr[21094]: 10C7A1F9559: from=<eric@mydomain.com>, size=299, nrcpt=1 (queue active)
postfix/smtp[25246]: 10C7A1F9559: to=<my.test.account@gmail.com>, relay=smtp-relay.gmail.com[64.233.167.28]:587, delay=24, delays=23/0/0.44/0.06, dsn=2.0.0, status=sent (250 2.0.0 OK  1552768189 e2sm92429wrr.91 - gsmtp)
postfix/qmgr[21094]: 10C7A1F9559: removed

Looking at the difference, I found if the relay server resolved as IPv6 it will fail to pass the credential check. Can anybody identify the issue?

Temporary workaround: I have to set Gmail relay service as: Only accept mail from the specified IP addresses: No

Edit: Issue was solved (workaround) by disabling "Only accept mail from the specified IP addresses" under G Suite Gmail relay settings. I did add my host server ip as the only IP allowed to accept emails:

G Suite Gmail relay settings

  • 1
    How did you configure Postfix? – Michael Hampton Mar 16 at 23:54
  • @MichaelHampton exactly following the links above, but solved by disabling the "Only accept mail from the specified IP addresses" under G Suite Gmail relay settings. – Vincent-cm Mar 18 at 0:31
  • If you actually solved this, you should post an answer. It will not be noticed as part of the question and will only confuse people. – Michael Hampton Mar 18 at 1:05
  • @MichaelHampton sorry I corrected as 'workaround'. I still confused that this error: "The IP address 550-5.7.1 you've registered in your G Suite SMTP Relay service doesn't match 550-5.7.1 domain of the account this email is being sent from." I will leave as it is for others who have resolved this rootly. – Vincent-cm Mar 18 at 11:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.