Timezone is not getting from Mailmessage Date in Rebex mail

0 votes
asked Jun 18, 2015 by shekhar (190 points)


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:

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

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,

Applies to: Rebex Secure Mail

1 Answer

0 votes
answered Jun 18, 2015 by Lukas Pokorny (128,250 points)


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.

commented Jun 18, 2015 by shekhar (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 ([]) 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 [] by nm7.bullet.mail.sg3.yahoo.com with NNFMP; 18 Jun 2015 15:57:07 -0000
Received: from [] by tm19.bullet.mail.sg3.yahoo.com with NNFMP; 18 Jun 2015 15:57:07 -0000
Received: from [] 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
Received: by; 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;
Content-Length: 1187
Received-SPF: pass (mail.magazinemanager.info: domain of yahoo.com designates as permitted sender)
X-ME-Bayesian: 0.007220
commented Jun 19, 2015 by Lukas Pokorny (128,250 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