SENDMAIL CAN NOT SEND TO GMAIL - OTKRITKI

Breaking

Saturday, July 27, 2019

SENDMAIL CAN NOT SEND TO GMAIL

You will see how to configure sendmail so that it can send your emails to "gmail.com" or "G Suite" boxes without a hitch. Because I realized lately that he was capricious on that. Especially since the banal function mail () of PHP. You will see how to fix this on a fresh Debian8.

The error in the logs

If you see in the following log /var/log/mail.log lines that looks like this:
Oct 04 11:16:14 hostname sm-mta [25169]: u9E9GEJv025167: to = <XXXXXXXXX@gmail.com>, ctladdr = <www-data @ XXXXXXXXXX> (33/33), delay = 00: 00: 00, xdelay = 00: 00: 00, mailer = esmtp, pri = 120382, relay = gmail-smtp-in.l.google.com. [IPv6: 2a00: XXXXXXXXX], dsn = 5.0.0, stat = Service unavailable
Oct 04 11:16:14 sm-mta hostname [25169]: u9E9GEJv025167: u9E9GEJv025169: DSN: Service unavailable
You can not send an email to Google managed mailboxes ... which is very annoying, but why? Just that Google does not always like to send e-mails on these IPv6 ... A fool all the same.

A solution to solve the sendmail and gmail error

Here is what you can do to correct the problem, it is relatively simple and fast. To start edit the file /etc/mail/sendmail.mc and go to the end of the file to add the line:
CLIENT_OPTIONS ( `Family = inet6, addr = :: ffff: 127.0.0.1 ') dnl
Once added save your file, and run the following command to reconfigure sendmail, answer yes to all the questions:
sendmailconfig
Sendmail will be reloaded at the end of the script. There is no longer any case test with a piece of PHP code for example such as:
<? php mail ('XXXXX@gmail.com ',' test ',' sendmail test for gmail '); ?>

Conclusion

Small manipulation that is simple and that will surely save you the bet if you had the problem and it is settled in less than 5 min!

No comments:

Post a Comment