How to send email to Gmail address from Debian cronjob?
I've configured some commands in my crontab file on a Debian database server so that the command results are piped to the mail command with the MAILTO variable set to my Gmail address. However, the mail delivery is failing with this error:
A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed: email@example.com SMTP error from remote mail server after end of data: host gmail-smtp-in.l.google.com [2607:f8b0:400e:c03::1b]: 550-5.7.1 [2600:3c01::f03c:91ff:feb3:234] Our system has detected that this 550-5.7.1 message does not meet IPv6 sending guidelines regarding PTR records 550-5.7.1 and authentication. Please review 550-5.7.1 https://support.google.com/mail/?p=IPv6AuthError for more information 550 5.7.1 . z71si22245379pgd.490 - gsmtp
After researching the error, I learned that I need to enable reverse DNS on my server. Since this is a database server, I had never created a domain zone for it (since I had never needed one) so I did that. When I added the domain zone, I had the DNS Manager create a few records using a new temporary linode I created. I then edited my server's A records so that they used the IP address shown when I run the command "ip -4 address" on my database server. Now when I run that ip command to get the IPv6 address, I get an address with the format "xxxx:xxxx::xxxx:xxxx:xxxx:xxx/64". If I want to edit the (blank), mail, and www AAAA records on my server, what exactly do I add? The ip command is only returning seven groups of hexidecimal digits but an IPv6 address is supposed to have eight groups of digits. Do I put "0000" at the beginning or end of the address returned by the ip command?
I should add that if I run the command "dig -x <ipv6_address> | grep PTR" using my servers address, it's not returning the server's FQDN even though it's been more than 24 hours since I set up reverse DNS. I would imagine that's due to the fact that my AAAA records have the wrong address.</ipv6_address>
My second question is, is there anything else I need to do to make Gmail not reject my mails?
After researching the error, I learned that I need to enable reverse DNS on my server.
In researching this on my end as well, it does appear that setting up rDNS would solve the issue for you. Did you already do this through the Remote Access tab of your Linode Manager?
Considering the detailed nature of your question, it may be helpful if you opened a ticket through the Support tab so we could see more details about your configuration :)