Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to the Power Users community on Codidact!

Power Users is a Q&A site for questions about the usage of computer software and hardware. We are still a small site and would like to grow, so please consider joining our community. We are looking forward to your questions and answers; they are the building blocks of a repository of knowledge we are building together.

How do I stop Gmail from silently dropping legitimate email?

+9
−0

I have a domain and now use it for my primary email address. In addition to depositing mail in that mailbox, this address also currently forwards to my Gmail account. (Yes I know, and I want to relocate 20+ years of saved email, but not today.) I set up the forwarding using the CPanel "Forwarders" page.

I've known for a while that Gmail sometimes silently drops incoming email -- it doesn't bounce or go to the spam folder; it just disappears. The rules by which Gmail decides to do that are opaque. I get a lot of actual spam and malware delivered to my spam folder, too, so it doesn't seem to be that Gmail is hyper-aggressive.

In recent weeks I have noticed an increase in legitimate email not arriving at Gmail. This includes messages sent directly to me (not mailing lists), sometimes in response to messages I sent, and includes senders I have explicitly whitelisted with Gmail. Most mail gets through; some gets silently dropped, and I can't characterize it yet -- I haven't seen any unique traits in the affected messages.

I used https://www.mail-tester.com to check that DMARC, DKIM, SPF, etc from my domain are fine; it reports 10/10 (authenticated, not blocklisted, passes SpamAssassin). I checked the "email deliverability" report on CPanel and it looks fine. CPanel's "track delivery" shows no failures. (I know that the missing Gmail messages wouldn't show up here, as Gmail is silently swallowing them, but I checked to see if anything else is showing up there.)

Long-term I want to stop using Gmail, but: (1) I'm not there yet and (2) I don't know if Gmail is dropping my messages to other Gmail users. So I'd like to figure out what's going wrong here. How can I debug (and ideally fix) this problem?

Here are the headers from a message that arrived -- from a Gmail address, for extra irony -- at my domain, but did not subsequently arrive at my Gmail address after forwarding. My reply, sent from my domain, did arrive at the recipient's Gmail address, interestingly (not all messages get blackholed).

("Redacted", "mydomain", and "my-hosting-provider" are my redactions.)

Return-Path: 
Delivered-To: ME@MYDOMAIN.org
Received: from redacted.my-hosting-provider.com
	by redacted.my-hosting-provider.com with LMTP
	id YAYMLtaa82cvqQAAflZDjA
	(envelope-from )
	for ; Mon, 07 Apr 2025 04:28:54 -0500
Return-path: 
Envelope-to: ME@MYDOMAIN.org
Delivery-date: Mon, 07 Apr 2025 04:28:54 -0500
Received: from mail-qt1-f175.google.com ([209.85.160.175]:52619)
	by redacted.my-hosting-provider.com with esmtps  (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
	(Exim 4.98.1)
	(envelope-from )
	id 1u1imd-00000000Tfi-3sXU
	for ME@MYDOMAIN.org;
	Mon, 07 Apr 2025 04:28:54 -0500
Received: by mail-qt1-f175.google.com with SMTP id d75a77b69052e-4774ce422easo42549131cf.1
        for ; Mon, 07 Apr 2025 02:28:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1744018125; x=1744622925; darn=MYDOMAIN.org;
        h=to:in-reply-to:references:message-id:date:subject:mime-version
         :content-transfer-encoding:from:from:to:cc:subject:date:message-id
         :reply-to;
        bh=IHdxC90FwlDs+Q67J6fS6xs+eyD781SUtdFdBhig2Bs=;
        b=MzMWgTjvHCCypK8VmN/+97Q4Nm7eXng6xFMuj3bF2s+LvykoQix2k000ftAH+cmEln
         OVbiZJf1J/ZW60MsVLG9pDj0r+F/hA/J9A3IzSEj1qvetxn3wmvEvdO1REw0I9x+6VzU
         haAxog9XMAg/f9rsiM9gBlm6MamDJZ5VKv9D8h5Yh/BdXiJDZg3tj9wv1bmQF7xIywqN
         8UbhT23Wggeifw9OStwjYUL+EaPNC1zBaOclq/ODPHhWZlHb19vRlHEwP8OJ/Yl5AlvW
         rv8w/9Fj0J+CnTn8cXL96DjZWOJrz1EwOCSKyWwdMn1h2f6kYAcO5mFJ/rfQkk6tcrx2
         iWww==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1744018125; x=1744622925;
        h=to:in-reply-to:references:message-id:date:subject:mime-version
         :content-transfer-encoding:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=IHdxC90FwlDs+Q67J6fS6xs+eyD781SUtdFdBhig2Bs=;
        b=xVaaObcfBWBfgoRVDez4XLQac8QAKALo9VZG9TY5D9iktoyQwUFcu0TOpvd+ig+DYz
         Ttd6xlJRqjPO95z45WnD5itin4i6Ta9VIPWCwaR7MGmsl4IWMYhpM7DX3IPpqB4a9J9g
         dTdZMalEsJcF/3QXjKJnObVjGC5r2Rk/MwdaIIrN00GiCKtmDfviEaiQa72DODTeEmBd
         aUWIKbfnEmrelljFLUFjUYagrD4FAsM1qLWhq+8h2/MB4WZB2H+SenoLV1riaL1aUPWS
         cguJmtNzXBgkMh/VaOUKqYW5q6MJVt7Iz5mFqLVgi4GeHtYwcvAm0djOGPEWtEnzQ0ic
         bIcA==
X-Gm-Message-State: AOJu0YzFSePwLdVEc/SKlR6yDuJpDxfylifDtc3kT9+z5U387/vFUtlS
	PLc8cMVutvoGXsJYgZQDELwZBwVoydRvcrreVV410o3IyTWMadleMJy4vg==
X-Gm-Gg: ASbGncsMd7qWzv3ztjyZgdMbQ0cKf1wfPVj5tq6gIkQDg8/JVOcOmbEr1e4ZYTr/5fj
	O/vg1ewgB/rdWyVSwyfLSQMXwUIOk4CvZAQ9LKZMKGhZjCeysSpqhNRL1wX+F+9lxjnz+EuqV/u
	V/VRqW+eGnjzGgt2L3Kk9eEff3aHF3K0qLZGBXNGwewBus0Oezq4P9S8EdP0PRETTUECssq6yez
	GziCBE/0Me1YWm/nE6GjOPgMe8BNgwhohw2pibifs/VvJbEdbd6tT+gVYSO48NBdwvdFi5xsna1
	f9IAGScSu57H+usSk0evSFhFn3X5+Sp5VkPj6njd+06v3y1z/OBAOs51NSLQ89JMwRNJ6mdZsqL
	EewL6h3BM
X-Google-Smtp-Source: AGHT+IG2GXTEaB1h8KsYF0VF3tCOWKpa1lzG+ARD00XDPGNAEcD8n47GtZtfzhlduMGqzU+9BT5Hbg==
X-Received: by 2002:ac8:5acc:0:b0:477:41e5:cb8d with SMTP id d75a77b69052e-479249bf9d1mr175485691cf.44.1744018125372;
        Mon, 07 Apr 2025 02:28:45 -0700 (PDT)
Received: from smtpclient.apple ([2600:4041:d0:1300:480e:2e72:7af8:9248])
        by smtp.gmail.com with ESMTPSA id d75a77b69052e-4791b057e6csm57759751cf.13.2025.04.07.02.28.44
        for 
        (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
        Mon, 07 Apr 2025 02:28:44 -0700 (PDT)
From: Redacted 
X-Google-Original-From: Redacted 
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Mime-Version: 1.0 (1.0)
Subject: Re: recipe
Date: Mon, 7 Apr 2025 05:28:33 -0400
Message-Id: <1AD5A4C5-B698-46B8-BD4C-7200813FDCB0@gmail.com>
References: 
In-Reply-To: 
To: ME@MYDOMAIN.org
X-Mailer: iPad Mail (22D82)
X-Spam-Status: No, score=-1.8
X-Spam-Score: -17
X-Spam-Bar: -
X-Ham-Report: Spam detection software, running on the system "redacted.my-hosting-provider.com",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 root\@localhost for details.
 Content preview: REDACTED
 Content analysis details:   (-1.8 points, 5.0 required)
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
                             [score: 0.0000]
  0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE:
                             The query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                             [209.85.160.175 listed in sa-accredit.habeas.com]
  0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
                             query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                            [209.85.160.175 listed in bl.score.senderscore.com]
  0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends
                             in digit
                             [REDACTED[at]gmail.com]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider
                             [REDACTED[at]gmail.com]
 -0.1 DKIM_VALID_EF          Message has a valid DKIM or DK signature from
                             envelope-from domain
 -0.1 DKIM_VALID             Message has at least one valid DKIM or DK signature
 -0.1 DKIM_VALID_AU          Message has a valid DKIM or DK signature from
                             author's domain
  0.1 DKIM_SIGNED            Message has a DKIM or DK signature, not necessarily
                             valid
X-Spam-Flag: NO

(Message body redacted)

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.
Why should this post be closed?

1 comment thread

rules by which Gmail decides to do that are opaque (2 comments)

2 answers

You are accessing this answer with a direct link, so it's being shown above all other answers regardless of its score. You can return to the normal view.

+0
−0

I've known for a while that Gmail sometimes silently drops incoming email -- it doesn't bounce or go to the spam folder; it just disappears. [...]

How can I debug (and ideally fix) this problem?

For me, these are the jumping-off points: the places you know messages are not coming from.

Vague suspicions that mail is vanishing are very difficult to act on, but if you have non-gmail contact with somebody who says "you didn't get my mail?" then this is the place to debug.

Some ISPs do blackhole mail, I've seen it happen. I have not seen GMail do that so I believe there would have been a bounce generated; but if the sender's mail is broken then the bounce may not reach the sender.

Are you able to update the question with some more specific information?

Now my understanding is that mail M comes from outside to your domain D, then you try to forward it to your gmail account G and that last is failing.

Problems with forwarding mail

There is a problem with mail forwarding, like this

  1. spammer chooses you (monica@D) and a random sender (patsy@P1)
  2. they have somebody's mail server do the dirty work of delivering that to your mailserver D, maybe from a mailserver in P1 or somewhere else P2. They don't care.
  3. if D realises it's spam before accepting it, the message is rejected and that is somebody else's responsibility. You're saying that isn't the case here.
  4. your domain D has accepted the message and tried to pass it on to G.
  5. if G has any suspicion that it's spam, I expect they would reject it. It's possible they blackhole it (which would cause your symptoms) but I believe they're better than that.
    • I haven't checked what they actually do. An actionable debugging point would be to try finding out by use of the GTUBE string
  6. when D is left holding a message which G refused to accept, D has responsibility for generating the bounce.
    • This is a new message from nobody (bounces should have an empty sender, so they cannot also bounce) to patsy@P1, which is an address that may not exist or might be flooded with similar bounces from other places.
    • Note that this is a new message - and spammers have abused mail servers to do this.
    • If you allow D to do this, you may get D tainted on the block lists; this may impact G's evaluation of other mails later

Solutions to this problem can include

  1. messages coming from trusted sources must not be rejected, even when they are clearly spam
    • I do this for domains which I requested to forward to me. The connection gets a "friendly" mark on it and even spam will not be rejected, because I don't want to put that burden of generating bounces on the service provider.
  2. cut-through mail delivery.
    1. D knows it will be forwarding to G, so before accepting from patsy@P1 it attempts the delivery immediately through to G.
    2. sender P2 is kept waiting on the line
    3. if G rejects the mail, then D also rejects the mail. No bounce is generated.
  3. maybe you can mess with the envelope sender on D before forwarding to G, but... here be dragons.

The do-nothing solution of allowing bounces to be generated off D is... not a good way to run a mail server, and likely to cause loss of reputation.

It is unclear to me whether this is happening for monica@D, but you should definitely check.

Being aware of G -> D -> G transfer

Continuing from the problems of mail forwarding, we have to consider

  1. G delivers a mail, from src@G to D
  2. D tries to deliver it again, from src@G to monica@G
    • note that D is not permitted to generate mail from: anybody@gmail, as documented by the SPF records, and as GMail servers are fully aware
    • there will be exceptions, possibly if your Exim is configured to authenticate as you before delivering back to GMail? That isn't exactly a normal thing to do but I'm starting to suspect it is the answer in your specific case.
  3. if G refuses the mail to monica@G, then
    • a bounce to src@G will be immediately generated by D
    • perhaps even a delivery attempted down the same connection (logs may not tell us that detail). This may trigger heuristics on the GMail side.
    • if the bounce to src@G was also refused by G, this would explain the blackholing.
    • Exim's logs would tell you. <> is the empty sender used for bounces.

Getting hold of MTA logs from domain D (1)

Are you able to update the question with some more information about the nature of the forwarding service? Did you pay an ISP to forward mail? Did you install a cloud VM and configure your own MTA? Or other?

Whichever it is, debugging will be much easier if you have the transfer logs.

If you can't get those, there may be clues in the full headers of a mail delivered successfully - telling what MTAs are involved.

The important question to answer is for a message known to have not arrived at G, what did D say about it? Having the Message-ID and asking for logs within a few days will probably be helpful.

Interpreting the email headers

Thank you for adding redacted headers. There is a lot to redact these days!

Let's list addresses,

  • sender src@gmail
    • I believe that in places you have deleted, rather than replacing? Else this appears to have been a bounce message (no envelope sender) which could explain the loss.
  • first delivery by gmail to ME@MYDOMAIN
    • I'm puzzled by the top of the headers. Did you retain a copy on MYDOMAIN? i.e. forwarding to two addresses, one local and one gmail?
    • If so, then there was local delivery to a ME@MYDOMAIN mailbox, and that it how you come to have these headers
  • second onwards delivery attempt to you@gmail, lost

We're looking mostly at Received: ... lines, and we interpret these headers backwards because new ones are inserted at the top. (In the case of spams, we stop trusting them to be honest somewhere towards the bottom, after the last trustworthy machine tells where it got the message from.)

The duplicated headers Return-Path: <missing> .. Return-Path: <missing>(again) are odd. If it's not a paste error then I'm inclined to blame whatever did the local delivery (LMTP) for being strange. Anyway that may be incidental - you have the relevant headers.

Return-Path: 
Delivered-To: ME@MYDOMAIN.org
Received: from redacted.my-hosting-provider.com
	by redacted.my-hosting-provider.com with LMTP
	id YAYMLtaa82cvqQAAflZDjA
	(envelope-from )
	for ; Mon, 07 Apr 2025 04:28:54 -0500
Return-path: 
Envelope-to: ME@MYDOMAIN.org
Delivery-date: Mon, 07 Apr 2025 04:28:54 -0500
Received: from mail-qt1-f175.google.com ([209.85.160.175]:52619)
	by redacted.my-hosting-provider.com with esmtps  (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
	(Exim 4.98.1)
	(envelope-from )
	id 1u1imd-00000000Tfi-3sXU
	for ME@MYDOMAIN.org;
	Mon, 07 Apr 2025 04:28:54 -0500
Received: by mail-qt1-f175.google.com with SMTP id d75a77b69052e-4774ce422easo42549131cf.1
        for ; Mon, 07 Apr 2025 02:28:47 -0700 (PDT)

The Received:...by redacted.my-hosting...(Exim 4.98.1)...1u1imd-00000000Tfi-3sXU...for ME@ is the one to focus on now. That is your Exim, or one working on your behalf, and it's a recent & sane piece of software.

There will be logs somewhere near you for this. Those are the logs to see next, 1u1imd... is the text to search for in those logs, and exigrep is a handy tool to do it. You may have (+7d) until 14th Apr to do this, depending on log rotation.

I don't have cPanel experience and in general there are different places the log may be,

  1. it's possible that the Exim doing your work is shared across multiple domains. If so, you would need to file a ticket to ask the admin to search on your behalf, because such logs would be private to other people also. I think that is not the case for you.
  2. the logs are on "your" machine, but there is a small hurdle to jump, like a "yes I know what I'm doing" button to elevate your privileges on the cloud VPS running your cPanel instance.
    • in general, the file you want is often called /var/log/exim/mainlog, then renamed to mainlog.1 and compressed to mainlog.2.gz.
  3. or our lucky day, cPanel provides documentation
    • your file is /var/log/exim_mainlog and they guide you to run the command yourself as root

You should get a few lines from the command exigrep 1u1imd-00000000Tfi-3sXU /var/log/exim_mainlog* or equivalently exigrep 1AD5A4C5-B698-46B8-BD4C-7200813FDCB0@gmail.com /var/log/exim_mainlog*

The exigrep tool finds matches for the string you give it, then it pulls out from the searched files all events relating to the message(s) involved.

More general notes

on redaction

In general, a safer way to redact can be

  1. gather the thing in a text file
  2. pipe it through a set of replacements (a bit technical for some)
  3. check for remaining matches of things you would want removed
  4. then paste the text, and the list of replacement strings

It could give a more consistent redaction without destroying necessary information.

This is a tool that could be webified easily enough, but I would rarely recommend trusting a third party to redact!

on pasting gibberish into root shells

In general, a note on trusting instructions to run as root,

  • although cPanel docs are an authority you can trust about exigrep .. mainlog, the bit in the middle is also important.
  • The id you're searching for is a short piece of text from an external email,
    • it's not text just made up by me, so you have less need to trust my instruction
    • these ids were generated by reputable mail transfer agents
    • however in the most general we must know that carefully designed text stuffed in here could compromise the machine
  • To those of us know would know a shellcode injection attack when we see one,
    • We must remember that "making it OK to paste a string of gibberish into a root shell" is not good for the world.
    • We should be clear why that specific gibberish is safe and relevant.

(Am I hoping for too much here?)

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.

1 comment thread

I've updated the question to include headers of a (legitimate) message that arrived at my domain (D) ... (2 comments)
+2
−0

Google is notorious for being very picky, having significant false positives, and not caring.

Most likely they aren't discarding these mail messages, but refusing to accept them in the first place. This can happen easily when the sender doesn't have all that latest anti-spam technology turned on at their end, like DKIM, SPF, etc.

There are still a lot of old mail servers out there. Google is a big organization and has the ability to jump on the latest technology quickly. Small companies with their own mail server (for various reasons) don't know much about these things and don't want to spend time being mail server administrators, so just let them run.

For quite a while, mail from my domain to gmail would sometimes get to a recipient, sometimes not. Mail to all other domains seemed to work normally. Sometimes, but now always, I'd get a bounce message from gmail. I had many things to do, so this didn't get much attention. Real companies don't use gmail, so only message to a few select individuals weren't getting thru. Most of the time, it was more to their advantage than mine to receive mail I sent. I developed the attitude "Screw this, you're the one who picked a bad mail service".

Eventually I looked into it and found that one of those settings (SPF ?) for my domain wasn't right or properly turned on. After fixing that, gmail seems to be accepting all my mail now.

After the next new anti-spam technology emerges and gmail gets uppity again, this will probably happen all over.

So, the answer is this is probably due to lagging technology by the sender together with an overly-aggressive and holier-than-thou attitude by Google. There is probably nothing you can do about it other than not use gmail.

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.

2 comment threads

one of those settings (SPF ?) for my domain wasn't right (2 comments)
notorious for being very picky, having significant false positives, and not caring (1 comment)

Sign up to answer this question »