0

I setting main.cf in postfix on Linux SUSE like this

inet_interfaces = localhost
inet_protocols = ipv4

masquerade_domains =
masquerade_exceptions = root
mydestination = $myhostname, localhost.$mydomain
myhostname = localhost
mynetworks_style = subnet
relayhost=[smtp-relay.gmail.com]:25

smtpd_delay_reject = yes
smtpd_helo_required = no

smtpd_client_restrictions =

smtpd_helo_restrictions =

smtp_sasl_auth_enable = no
smtp_sasl_security_options =
smtp_sasl_password_maps =
smtpd_sasl_auth_enable = no

smtp_use_tls = no

I tried to telnet smtp-relay.gmail.com 25 and it's working

Anyway, when I tried to send email with postfix in server I got the issue.

root@localhost
(host smtp-relay.gmail.com[ipv4] refused to talk to me: 421 4.7.0 Try again later, closing connection. (EHLO)
0

Looking at the official Google documentation looks like a "ratelimit" on their side:

 421, "4.7.0", Try again later, closing connection. This usually indicates a Denial of Service (DoS) for the SMTP relay at the HELO stage.

How many mails per minute are you sending? By experience, usually Gmail accepts 50/100 mail/minute tops.

EDIT as per comment

Well, looks like the same error appears with a wrong HELO/HELO (as I first suspected).

I just tried:

$> telnet smtp-relay.gmail.com 25
Trying 108.177.15.28...
Connected to gmail-smtp-relay.l.google.com.
Escape character is '^]'.
220 smtp-relay.gmail.com ESMTP b8-v6sm74445wrr.1 - gsmtp
helo localhost
421 4.7.0 Try again later, closing connection. (EHLO) b8-v6sm74445wrr.1 - gsmtp
Connection closed by foreign host.

So it's definitively your EHLO string.

You have myhostname = localhost in your main.cf file, you should change it with myhostname = [your server fqdn], i.e. you should have a Fully qualified domain name for your server, complete with correct DNS/rDNS entries.

  • I just sent only 1 email per minute or I can say 1 email per hour. – user9111600 Sep 5 '18 at 12:46
  • Using temporary error code on a permanent error is not very wise from Google. – Esa Jokinen Sep 5 '18 at 13:16
  • @Mr Shunz, I still don't have FQDN just now maybe the process will finish on the next week, so can I use ip adress instead? – user9111600 Sep 5 '18 at 13:44
  • @user9111600 I just tried and it seems the error does not appear when using helo IP.ADD.RE.SS. Give it a try! – Mr Shunz Sep 5 '18 at 13:45
  • @ Mr Shunz, I just try with your suggestion but it still showing.. root@localhost (delivery temporarily suspended: host smtp-relay.gmail.com[74.125.24.28] refused to talk to me: 421 4.7.0 Try again later, closing connection. (EHLO) – user9111600 Sep 5 '18 at 13:58

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.