Score:0

Gmail reports SPF issues with emails sent from Thunderbird via postfix

by flag

This question is similar to the following question in the Mozilla forum. However, the answer given there to this question doesn't address the issue that I am seeing.

Question in Mozilla forum: https://support.mozilla.org/lt/questions/1369698

In other words, I'm having trouble getting Google to accept messages going to gmail.com addresses only when such messages are sent via Thunderbird. Messages sent with non-Thunderbird clients to the same gmail.com addresses with the same sender address from the same machine that Thunderbird runs on going out via the same SMTP server always arrive with no problem.

My situation is a bit complicated. To describe what is going on, I'll be using the following domain names:

localmachine-example.com -- my ubuntu-20.0.4 desktop machine upon which Thunderbird is running

postfix-example.com -- my debian-11 email server machine upon which postfix-3.5.18 is running

When I am using Thunderbird, I have it configured to send outgoing emails via SMTP using this host and port:

postfix-example.com/port=587

All domains handled by the postfix-example.com SMTP server have proper SPF, DKIM, and DMARC records that always are shown as being correct whenever I query their validity via various online domain-verification services.

For all email destinations except gmail.com addresses, when I send emails from Thunderbird running on localmachine-example.com, no matter what the sending address is, these messages go to my postfix server which then successfully routes them to the destination.

However, if the destination address is specifically a gmail.com address, the mail gets returned by Google with the following message. Suppose I'm sending the email to [email protected]. This is the message that comes back:

Jun 11 20:29:12 postfix-example postfix/smtp[1088941]: 81AC812C554:to=<[email protected]>, relay=gmail-smtp-in.l.google.com[2607:f8b0:4002:c1b::1b]:25, delay=0.46, delays=0.16/0.01/0.02/0.25, dsn=5.7.25, status=bounced (host gmail-smtp-in.l.google.com[2607:f8b0:4002:c1b::1b] said: 550-5.7.25 [2600:3c02::f03c:93ff:febc:dd9e] The IP address sending this message 550-5.7.25 does not have a PTR record setup, or the corresponding forward DNS 550-5.7.25 entry does not point to the sending IP. As a policy, Gmail does not 550-5.7.25 accept messages from IPs with missing PTR records. Please visit 550-5.7.25  https://support.google.com/mail/answer/81126#ip-practices for more 550 5.7.25 information. g200-20020a0dddd1000000b0056d0485d928si2677570ywe.362 - gsmtp (in reply to end of DATA command)

No email destinations other than gmail.com addresses fail to accept similar messages that are sent via Thunderbird.

And please note the following carefully:

If instead of Thunderbird, I use the emacs "Wanderlust" email client to send the exact, same message from the exact, same localmachine-example.com machine to the exact, same [email protected] address, and routed through the exact same postfix-example.com/port=587 SMTP server, it arrives at the gmail.com destination with no problem.

In other words ...

(1) Both the Thunderbird client and the emacs "Wanderlust" email client are running on the same localmachine-example.com host.

(2) Both the Thunderbird client and the emacs "Wanderlust" email client are sending a message with the same sender address.

(3) Both the Thunderbird client and the emacs "Wanderlust" email client are sending a message with the same [email protected] recipient address.

(4) Both the Thunderbird client and the emacs "Wanderlust" email client are configured to send outgoing emails through the same SMTP server: postfix-example.com/port=587

(5) All emails sent via the emacs "Wanderlust" email client always arrive at the [email protected] address with no problems.

(6) However, all emails sent to gmail.com addresses via the Thunderbird client always bounce back with the error message that I posted above.

Does anyone know what I can do to configure Thunderbird to not cause this kind of error when I am sending to gmail.com addresses from my localmachine-example.com host?

Also, I get the exact, same behavior when sending via Seamonkey instead of Thunderbird.

Thank you very much in advance.

Nikita Kipriyanov avatar
za flag
Also notice that Postfix 2.11 is **ancient** and **[unsupported since Feb 21, 2018](http://www.postfix.org/announcements/postfix-3.3.0.html)**. Debian 11 includes Postfix 3.5, which is supported. Questions about unsupported and unmaintained software are off topic on ServerFault.
HippoMan avatar
by flag
Well, luckily, this question and its answer don't have anything to do specifically with postfix, actually. :)
ws flag
Lots of words here, but no headers from emails sent, no SPF policy
HippoMan avatar
by flag
OOPS! I'm actually using postfix 3.5.18. I had originally copied the postfix version from the wrong machine. I now have changed this in the question, above. As for the info I supplied here, it turns out that none of email header info nor SPF details are related to the actual solution to the problem. See my Answer here.
Score:3
us flag

The error isn't complaining about SPF, it's telling you there's a lack of PTR record for 2600:3c02::f03c:93ff:febc:dd9e, and from here it appears there it doesn't have one. So Google is trying to do a reverse DNS lookup on the IP and expecting a result that points back to the mail server's A / AAAA record.

Presumably that's your Postfix server? Does it normally send using IPv6 or do other emails get sent via IPv4 and the PTR hasn't been setup for IPv6? Some setting in Postfix that's causing your Thunderbird to be sent via IPv6 instead? Or does that IP belong to your machine running Thunderbird, and for some reason when sending from that Postfix is retaining that IP as the source rather than changing it to its own?

Nikita Kipriyanov avatar
za flag
indeed, `Host e.9.d.d.c.b.e.f.f.f.3.9.c.3.0.f.0.0.0.0.0.0.0.0.2.0.c.3.0.0.6.2.ip6.arpa not found: 3(NXDOMAIN)`
HippoMan avatar
by flag
Thank you very much to both of you for all of this! I had disabled ipv6 for my postfix server long ago. It looks like Thunderbird might be trying to use ipv6 anyway. Also, I know that postfix 2.11 is old. At some point, I will upgrade it.
HippoMan avatar
by flag
As I commented above, I accidentally named the incorrect postfix version. I'm actually using version 3.5.18, and I corrected that in my original question now.
Score:0
by flag

It turns out that this issue is due to a "feature" (ha ha!) of Thunderbird.

I found the answer, and I discuss it here: http://forums.mozillazine.org/viewtopic.php?f=39&t=3110324&p=14956991#p14956991

I fixed the problem by creating a separate, unique SMTP server entry in Thunderbird for each and every email address that Thunderbird services.

PS: And Seamonkey has this same "feature".

Nikita Kipriyanov avatar
za flag
Very interesting, I use Thunderbird a lot, I managed many mail systems based on Postfix, and had never seen this problem. Probably because I always set up `reject_sender_login_mismatch` so even if any user tries to send mail with wrong "from" envelope, they will be rejected and the problem will be indicated by my server to them immediately and directly, like "[email protected] is not allowed to send mail from [email protected]"?
HippoMan avatar
by flag
Yes, your Postfix configuration probably indeed prevented this Thunderbird "feature" from going into effect for you.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.