0 votes
by (190 points)

Hi,

While reading mail message i need to have Mail send Date and Time, but while reading Mail Message object the "Date" property is not giving Time/Timezone.

Ex: I have send an email from Yahoo (IST) to Gmail. the Date and Received Date properties values are like below:

Date
Local Time : 06/18/2015 09:26:30;
OriginalTime: 06/18/2015 13:26:30;
UniversalTime: 06/18/2015 13:26:30;
TimeZone: 00:00:00

Received
Date Local Time : 06/18/2015 09:26:30;
OriginalTime: 06/18/2015 08:26:30;
UniversalTime: 06/18/2015 13:26:30;
TimeZone: -05:00:00

For Date the TimeZone is 00:00:00

In my project i used to show client mail send date & time.

How to resolve this one? Is this Yahoo mail server issue or Rebex?

Thank you,
Shekhar

Applies to: Rebex Secure Mail

1 Answer

0 votes
by (134k points)

Hi,

This looks like Yahoo mail server issue . A Stack Overflow question IMAP date filter issue seems to describe what might be a related issue with Yahoo and IMAP.

Could you please download the message directly into a file using Imap.GetMessage method (this is important - don't download into MailMessage/MimeMessage and then save) method, open it using a text editor such as Notepad and copy&paster the Date: and Received: headers here? That will make it possible to tell whether this is an IMAP server or client issue.

by (190 points)
Hi, thanks for quick response.
I have sent an email from Yahoo at IST  @9.26 pm.

Here i did like saved the file in D drive as like below:

 //get all messages
            messages = imap.Search(ImapListFields.Fast, ImapSearchParameter.Unread);
           if (messages.Count > 0)
            {
                foreach (ImapMessageInfo itemInfo in messages)
                {
                    imap.GetMessage(itemInfo.SequenceNumber, "D://test.txt");
                }
            }

And the result is:

"
Received: from nm7-vm1.bullet.mail.sg3.yahoo.com ([106.10.148.176]) by mail.magazinemanager.info with MailEnable ESMTP; Thu, 18 Jun 2015 10:57:06 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1434643027; bh=PhrJtXRFCMO01Hrz3lUQhEH6MuJno+pKdwWd28Y52q4=; h=Date:From:Reply-To:To:Subject:From:Subject; b=VcXaY7r7+voCunIQCd44Nvj5LR6wvvoVNR45MN1In4AJJaEk6ucLYFwTHrseNKKOqXKoub8pOXV7Z0WbQ9ZJbWGf1+GGqbHUtmR3Igk/cvfZ17sozL4SUrAvFuTgO/qYbUSDs64rb+nIvGraPcwYiEUgid8uiCoBAT2FuEIAfzi+w/yXp+XIZZPTgs7z119IS7rdzurXQSO0X3DootjhcLJSgJt4K42O7fkclc6COxs8UMWv4SVWFIWgt9E9vmL3xYTUHjxO5NyU6xz1oZo/SUledMHo2q76rBbxaDffnBKQxTceD1xJxZNcutANN/TbgjDBreqvrY3+3shglYq2HQ==
Received: from [106.10.166.62] by nm7.bullet.mail.sg3.yahoo.com with NNFMP; 18 Jun 2015 15:57:07 -0000
Received: from [106.10.150.23] by tm19.bullet.mail.sg3.yahoo.com with NNFMP; 18 Jun 2015 15:57:07 -0000
Received: from [127.0.0.1] by omp1024.mail.sg3.yahoo.com with NNFMP; 18 Jun 2015 15:57:07 -0000
X-Yahoo-Newman-Property: ymail-3
X-Yahoo-Newman-Id: 783986.23424.bm@omp1024.mail.sg3.yahoo.com
X-YMail-OSG: sodYJLgVM1mXRcMkdsOqMRRoeSD0Imdw.NQm_MMdvnj5uTEcUUaIHK3aV0s_vkj
 Zu4wEVF75kL4a7ssFOQK6EJEpcA2HRABJpihJ2KoHF6fwzi0DZrgmwfKmsDF1n_VnLxeA9j_pMnX
 mLNNEs1rrvG7FbN9Cbm2WevuJIe2ABx_z.HB1Wpw.gX67WKuj8jhWRNIctILA6coJOw_CFsJ155_
 M0QGzM7ca7EzjVFcGEu5isZUUSulBExWKsQsekgJRISlIouzAbkavjO0b6iIojTtkEU_Ec0qAcda
 EwDwzrS2BVmSnPV6mgBzh9UnWnlRNi6yZbMVXqwyfqZRxN0QIN3_Ox7PeGZXMU5P1jEdXkWXAPE8
 vcslgUXP0hJXdo0Fo5OJRDkJy_ik2etBnMYi0gkBxXNNMwGRSPeVmCS7BmlvmaiEw.8hLcaNPKX.
 gzjpgP.xSh5tirfFh8RKRWPvZp4NtadeY9U4DaqDbJr3dFFreU.ae3BXkiU0OYQBvjKQ770TtjS8
 jNuDWKgjpDG2Zbg--
Received: by 106.10.196.94; Thu, 18 Jun 2015 15:57:07 +0000
Date: Thu, 18 Jun 2015 15:57:06 +0000 (UTC)
From: shekar posham <shekar_536@yahoo.com>
Reply-To: shekar posham <shekar_536@yahoo.com>
To: Shekhar Posham <shekar536@gmail.com>
Message-ID: <1277247997.850027.1434643026940.JavaMail.yahoo@mail.yahoo.com>
Subject: timezone test @9.26 pm
MIME-Version: 1.0
Content-Type: multipart/alternative;
    boundary="----=_Part_850026_1674638485.1434643026938"
Content-Length: 1187
Received-SPF: pass (mail.magazinemanager.info: domain of yahoo.com designates 106.10.148.176 as permitted sender)
    client-ip=106.10.148.176
X-ME-Bayesian: 0.007220
"
by (134k points)
This confirms that it's indeed Yahoo that seems to be using a UTC timezone +0000 for all their headers in this case. There is nothing we can do about that, unfortunately - we just parse what we get. Perhaps changing the time zone in Yahoo would help? https://answers.yahoo.com/question/index?qid=20081220235849AAmlxde
...