I was very surprised to get an unexpected bounceback from Gmail to an email from my own domain's SMTP/IMAP server send via Outlook (details anonymised):
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 [1234:a1b2:4321:a12::1a]: 550-5.7.1 [1234:1234:1234:a12::12a1] Our system has detected that this message 550-5.7.1 does not meet IPv6 sending guidelines regarding PTR records and 550-5.7.1 authentication. Please review 550-5.7.1 https://support.google.com/mail/?p=IPv6AuthError for more information 550 5.7.1 . 123ab123456abc.123 - gsmtp
I didn't understand why it was a IPv6AuthError but after checking that reverse IP lookups did work using my PTR and that my DKIM and SPF records were fine, I did a DNS IPV6 lookup test which threw a simple "not found" error:
Find Problems aaaa
Test: DNS Record Published Result: DNS Record not found
Which isn't surprising: my domain is on an IPV4 ip address so I've never set any aaaa records, thinking (perhaps niavely?) that I didn't need them unless I was using an IPV6-only IP address.
Further emails from the same my-domain.com address to the same GMail address dind't give the same error, so it's an intermittent problem. I've added AAAA
www records pointing to the auto-converted IPV6 version of my IPV4 ip address, and it seems fine so far but it's hard to say if it's fixed an intermittent problem.
My emails are sent using Exim with some dynamic configuration that assigns an IPv4 address to each domain on the mail server. There's nothing in my Exim configuration that I'm aware of that would assign an IPv6 address instead, but
netstat -tulpn | grep :25 does show that Exim listens to IPv6 addresses:
netstat -tulpn | grep :25 tcp 0 0 0.0.0.0:2525 0.0.0.0:* LISTEN 2788/exim tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 2788/exim tcp 0 0 :::2525 :::* LISTEN 2788/exim tcp 0 0 :::25 :::* LISTEN 2788/exim
So my question is: under what circumstances would a mail server configured to use an IPV4 IP address need AAAA records to send and receive mail?