0 votes

I'm listening to 2 mailboxes, when i send a message from A to B, the messageid is different on both messages (inbox in B and sent mail in A).

Is it possible to check if is the same message?

A: 06401d843...@t....
B: 06901d843...@t....

by (200 points)

1 Answer

0 votes

It's rather unusual as it is a sender who assigns Message-Id header (IMail.MessageId).

I double checked with Gmail, and both messages: sent email in sent folder and received email in INBOX of the other account had the same Message-Id header (IMail.MessageId).

It looks like yours Message-Id is custom created (Mail.dll assigns one automatically in a bit different format).

Are you uploading email to a sent folder yourself (maybe there is an error in this code), or rely on SMTP server to put it there?

Turn on logging to check if you set Message-Id when sending and investigate which one is different: the one in sent or the one received:
https://www.limilabs.com/blog/logging-in-mail-dll

by (301k points)
the message was not sent using the dll, i was using outlook.
I was monitoring both folders, the inbox for B and sent mails for A.
The reason, why it is an incorrect behavior, is that when replied, sender can't really match those emails.

I checked how Outlook online behaves and message in sent folder has the same Message-Id as the one received.

I'm 99% sure that the problem is somewhere in your code. It would be a very serious issue in Outlook otherwise.
INBOX testess02:

Delivered-To: testess02@XXXX.com
Received: from cps12.webserver.pt
    by cps12.webserver.pt with LMTP
    id GI4cGllTRGJeVgAAaubkSQ
    (envelope-from <testess@XXXX.com>)
    for <testess02@XXXX.com>; Wed, 30 Mar 2022 13:55:53 +0100
Return-path: <testess@XXXX.com>
Envelope-to: testess02@XXXX.com
Delivery-date: Wed, 30 Mar 2022 13:55:53 +0100
Received: from [148.69.142.78] (port=40943 helo=SCAMPOS)
    by cps12.webserver.pt with esmtpsa  (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
    (Exim 4.94.2)
    (envelope-from <testess@XXXX.com>)
    id 1nZXrf-0004d2-PC
    for testess02@XXXX.com; Wed, 30 Mar 2022 13:55:53 +0100
From: <testess@XXXX.com>
To: <testess02@XXXX.com>
Subject: test
Date: Wed, 30 Mar 2022 14:13:13 +0100
Message-ID: <010f01d84437$e98558b0$bc900a10$@XXXX.com>
MIME-Version: 1.0
Content-Type: multipart/alternative;
    boundary="----=_NextPart_000_0110_01D84440.4B4A5CF0"
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AdhEN+cxYZSar7bqS1myzpRLP5aMjg==
Content-Language: pt


OUTBOX testess:

Mail.dll Information: 0 : 20 14:15:51 S: )
Mail.dll Information: 0 : 20 14:15:51 S: 7E7F00A5 OK Fetch completed (0.001 + 0.000 secs).
Mail.dll Information: 0 : 20 14:15:51 C: 7E7F00A6 UID FETCH 120 (UID BODY.PEEK[])
Mail.dll Information: 0 : 20 14:15:51 S: * 52 FETCH (UID 120 BODY[] {2686}
Mail.dll Information: 0 : 20 14:15:51 S (2686 bytes):
Mail.dll Information: 0 : 20 14:15:51 From: <testess@XXXX.com>
To: <testess02@XXXX.com>
Subject: test
Date: Wed, 30 Mar 2022 14:13:13 +0100
Message-ID: <011401d84437$ea939460$bfbabd20$@XXXX.com>
MIME-Version: 1.0
Content-Type: multipart/alternative;
    boundary="----=_NextPart_000_0115_01D84440.4C58E6C0"
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AQK8cbpUxyw+ZIfYUpj+rdXBGkbX4A==
Content-Language: pt
As you can see, the messageID should be the same, since it's the same email.

in the inbox i'm using:

    FolderStatus folderStatus = client.SelectInbox();

in the outbox i'm using:

    CommonFolders folders = new CommonFolders(outClient.GetFolders());
    client.Select(folders.Sent);

on both, for getting the email info i'm using:

    email = new MailBuilder().CreateFromEml(outClient.PeekMessageByUID(uid));

where uid is the id returned by the client.Search function
You are looking at different emails. They have different content e.g. boundary ids are differetn _NextPart_000_0115 -vs- _NextPart_000_0110
Apparently the problem is server side, when testing with mails from another imap server, everything works as planned.

Thank you for your help
...