Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET POP3

 AfterLogic Forum : MailBee.NET POP3
Subject Topic: Date Property changed after call to Downl Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
scotty
Newbie
Newbie


Joined: 27 August 2007
Online Status: Offline
Posts: 25
Posted: 09 June 2009 at 8:19am | IP Logged Quote scotty


Hello,
Using the MailBee.Pop3 component I encountered the following problem with some (specially formatted) emails:

When comparing the value of the Date-property after calling DownloadHeader() to the value or the property after calling DownloadEntiryMessage() there is sometimes a difference in the time of day.

The following code snippet reproduces this behavior (using the release or latest beta version of MailBee.NET) when it encounters a mail like the one below on the POP3-Server:



           // pop3 - connect and login
           :
             int count = pop3.InboxMessageCount;
             for (int n = 1; n <= count; n++)
             {
                Console.WriteLine("*** Message " + n);
                MailMessage msg = pop3.DownloadMessageHeader(n);
                Console.WriteLine(msg.Date.ToString());
                msg = pop3.DownloadEntireMessage(n);
                Console.WriteLine(msg.Date.ToString());
             }
           :


This should result into the same date being printed out twice to the console window. For most mails this works fine but in some rare cases the date value is changed after the call to DownloadEntireMessage().

This is the raw text of a mail that can be used to reproduce this behavior:



From: test@test.net
To: test1@test.net
Date: Tue, 2 Jun 2009 08:40:35 +0200
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
     boundary="9B095B5ADSNADJIOJDAS DFA983499893898JSDFJIJFOSIDFI"
Message-ID: <mwWkdXYf500000006@test.net>
Subject: A Simple Test Message

--9B095B5ADSNADJIOJDASDFA983499893898JSDFJIJFOSIDFI
Content-Type: text/plain; charset=unicode-1-1-utf-7

This is a simple testmessage. please ignore

--9B095B5ADSNADJIOJDASDFA983499893898JSDFJIJFOSIDFI--




Can you help me with this problem?
Thanks in advance.
Scotty
Back to Top View scotty's Profile Search for other posts by scotty
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 09 June 2009 at 9:00am | IP Logged Quote Alex

Could you please do the following?
- once called DownloadHeader for the message in question, call SaveMessage to save the header in the file
- once then called DownloadEntireMessage for the message in question, call SaveMessage to save the entire message in the file
- make sure dates are the same in raw sources of the header and the entire message

Sometimes, mail servers send different data for the header and the entire message. This may occur if the mail server caches header data in a database table for quick access and this data goes out of sync with the entire message (which is usually stored on the filesystem).

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
scotty
Newbie
Newbie


Joined: 27 August 2007
Online Status: Offline
Posts: 25
Posted: 10 June 2009 at 12:57am | IP Logged Quote scotty


Thank you for your reply.

Doing what you suggested, I inserted calls to SaveMessage() immediately after DownloadMessageHeader() and DownloadEntireMessage().
Executing the test program I got the following output:

Output to console window:


*** Message 1
Date after DownloadMessageHeader: 02.06.2009 08:40:35
Date after DownloadEntireMessage: 02.06.2009 10:40:35


File writen after DownloadMessageHeader():

Return-path: <test@test.net>
Envelope-to: test@ test.net
Delivery-date: Tue, 09 Jun 2009 11:44:40 +0200
Received: from [86.111.62.332] (port=4217)
     by smartmx-05.inode.com with smtp (Exim 4.69)
     (envelope-from <test@ test.net >)
     id 1MDxse-0004yr-9T
     for test@ test.net; Tue, 09 Jun 2009 11:44:40 +0200
From: test@test.net
To: test1@test.net
Date: Tue, 2 Jun 2009 08:40:35 +0200
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
     boundary="9B095B5ADSNADJIOJDAS DFA983499893898JSDFJIJFOSIDFI"
Message-ID: <mwWkdXYf500000006@test.net>
Subject: Benachrichtigung
X-Inode-Scanner: clean
X-Inode-SpamScore: 3.1
X-Inode-SpamBar: +++
X-Inode-SpamReport: Spam detection software on "smartmx-05.inode.com"
     has analyzed this mail, the results are include below.
     Content analysis details:
     pts rule name         &n bsp;    description
     ---- ---------------------- --------------------------------------------------
     3.0 DATE_IN_PAST_96_XX     Date: is 96 hours or more before Received: date
     0.1 RDNS_NONE        &nb sp;     Delivered to trusted network by a host with no rDNS
X-Inode-SpamFlag: 1


File writen after DownloadEntireMessage:

Return-path: <test@test.net>
Envelope-to: test@test.net
Delivery-date: Tue, 09 Jun 2009 11:44:40 +0200
Received: from [86.111.62.332] (port=4217)
     by smartmx-05.inode.com with smtp (Exim 4.69)
     (envelope-from <test@test.net>)
     id 1MDxse-0004yr-9T
     for test@test.net; Tue, 09 Jun 2009 11:44:40 +0200
From: test@test.net
To: test1@test.net
Date: Tue, 2 Jun 2009 08:40:35 +0200
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
     boundary="9B095B5ADSNADJIOJDAS DFA983499893898JSDFJIJFOSIDFI"
Message-ID: <mwWkdXYf500000006@test.net>
Subject: Benachrichtigung
X-Inode-Scanner: clean
X-Inode-SpamScore: 3.1
X-Inode-SpamBar: +++
X-Inode-SpamReport: Spam detection software on "smartmx-05.inode.com"
     has analyzed this mail, the results are include below.
     Content analysis details:
     pts rule name         &n bsp;    description
     ---- ---------------------- --------------------------------------------------
     3.0 DATE_IN_PAST_96_XX     Date: is 96 hours or more before Received: date
     0.1 RDNS_NONE        &nb sp;     Delivered to trusted network by a host with no rDNS
X-Inode-SpamFlag: 1

This is a MIME-formatted message.
Portions of this message may be unreadable without a MIME-capable mail program.

--9B095B5ADSNADJIOJDASDFA983499893898JSDFJIJFOSIDFI
Content-Type: text/plain; charset=unicode-1-1-utf-7

This is a simple testmessage. please ignore



--9B095B5ADSNADJIOJDASDFA983499893898JSDFJIJFOSIDFI—


In both files the date entry in the raw message text is the same:
Date: Tue, 2 Jun 2009 08:40:35 +0200

Nevertheless the Date-property of the MailMessage-object is off by two hours (comparing its value before and after calls to DownloadEntireMessage()).

I did a little experimenting and found out that when I remove the charset-setting (charset=unicode-1-1-utf-7) from the text of my original test-message the Date-properties (before and after calls to DownloadEntireMessage()) on the receiving end match up again. But that of course is no solution as I normally don’t have control over the contents of the received messages.

Regards,
Scotty

Back to Top View scotty's Profile Search for other posts by scotty
 
Corwin
Valued Community Member
Valued Community Member
Avatar

Joined: 16 March 2009
Location: Russian Federation
Online Status: Offline
Posts: 15
Posted: 10 June 2009 at 5:25am | IP Logged Quote Corwin

This is what documentation says:

By default, all dates are adjusted to UTC (GMT) timezone. To adjust to local time, set DatesAsUtc property of Parser object.

For example::
Code:
MailMessage msg = Pop3.QuickDownloadMessage("mail.domain.com", "jdoe", "secret", 1);
msg.Parser.DatesAsUtc = true;


Try specifying either true or false, does it help?

Cheers,
Corwin.
Back to Top View Corwin's Profile Search for other posts by Corwin Visit Corwin's Homepage
 
scotty
Newbie
Newbie


Joined: 27 August 2007
Online Status: Offline
Posts: 25
Posted: 10 June 2009 at 5:43am | IP Logged Quote scotty

Thank you for your response.

Unfortunately this hasn’t solved my problem.

When I insert the line

msg.Parser.DatesAsUtc = true;

into my test-application the output in the console window changes to


*** Message 1
Date after DownloadMessageHeader: 02.06.2009 06:40:35
Date after DownloadEntireMessage: 02.06.2009 08:40:35


Both dates are two hours earlier now but still different from each other.

Regards,
scotty.

Back to Top View scotty's Profile Search for other posts by scotty
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6038
Posted: 10 June 2009 at 6:39am | IP Logged Quote Igor

We've been unable to reproduce this. Could you please let us know the version number of MailBee.NET.dll you use?

We recommend to update your dll installation to the latest version according to this FAQ page.

Please let us know if the update helps.

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide