Page 1 of 1

Time stamp is incorrect in PP when importing mail into Gmail

Posted: Sun Aug 31, 2014 11:43 pm
by killme
I set up Gmail to check my ISP POP3 account. I check my Gmail account in PP using IMAP. The emails from my ISP imported fine and Gmail shows the correct time stamp, dates of when the emails were originally received by my ISP.

When POP Peeper downloads these imported emails from Gmail the time stamp for when they were received shows the time and date that Gmail imported them into my Inbox. It's not showing the correct time stamp that Gmail shows. Is this normal? Is it fixable?

This same behavior happens on PP v3.8.1 and v4.0 Beta 13.

Re: PP time stamp incorrect when importing mail into Gmail

Posted: Mon Sep 01, 2014 6:47 am
by spc3rd
Hi killme,

Sorry to hear you are experiencing the issue you've described.

[NOTE]: I've thus far been unable to duplicate the problem you mentioned (using PP Beta 13 only). I'm unable to test this using PP v3.8.1.0, hence my own results are inconclusive at the moment. Since this issue will likely need Jeff's attention for further evaluation, I have contacted him to request his review of your post here. In the interim, I have two questions for you:

1. Most email service providers have a mail-forwarding option. Does your ISP POP3 account not have this option?

2. If your ISP POP3 account does have a mail-forwarding option, is there a particular reason why you do not use it, as Gmail suggests at the [Learn More] link for the Mail Fetcher option?

When I use the mail-forwarding option on my own ISP POP3 account to forward mail to my Gmail IMAP account, there are no issues with the proper date/time being shown, both when the message is retrieved by Gmail, and when PP subsequently retrieves the message from the Gmail IMAP account.

[Recommendation]: IF your ISP POP3 account does have a mail-forwarding option, try using that option to forward your messages to the Gmail IMAP account instead. (Be sure to FIRST disable your Gmail Mail Fetcher settings before enabling the mail-forwarding option in your ISP POP3 account).

Please post back and let me know how things go.

Best regards,

Re: PP time stamp incorrect when importing mail into Gmail

Posted: Mon Sep 01, 2014 8:44 am
by killme
I didn't want to set up mail forwarding because I don't know if would interfere with my continuing to use my ISP mail separately. I just want a copy of my ISP email in my Gmail as a kind of backup.

I was looking at the email headers again in Gmail comparing them to the ones in my ISP (Charter). I found that there are some additional "Received" lines that correspond to the time stamps that POP Peeper shows. Gmail is adding those additional time stamps of when it retrieves the email, but Gmail doesn't go by those when it's displaying my messages.

It looks like POP Peeper displays the Date/Time time stamp according to the Received: line (perhaps the latest one, the one on top) instead of the Date: line.

Re: PP time stamp incorrect when importing mail into Gmail

Posted: Mon Sep 01, 2014 9:51 am
by spc3rd
Thanks for posting back, killme!

Since my ISP is Cox Communications, I can't really address the issue with Charter. With my Cox email accounts, there is an option to both forward any emails received to another email account and retain a copy within the Cox POP3 account.
I can still send/receive emails from the Cox account either within PP or from the account on-line without any issues. The same may not be true with Charter though.

As mentioned in my previous post, I have contacted Jeff and asked him to review the issue your having, so I'll defer to his expertise at this point.

Cheers & enjoy the holiday! :mrgreen:

Re: Time stamp is incorrect in PP when importing mail into G

Posted: Tue Sep 02, 2014 7:24 pm
by Jeff
killme -- you're correct, PP uses the timestamps from the "received" fields instead of the "date" field. The reason for this is because (10 years ago), it was common for spam to contain a date in the future, presumably so that their email would appear on top of all others. Another problem it solved is the fact that users don't always have their computers set correctly. That one is probably less of a problem nowadays since most OS's use time synchronization. The first one -- probably also a thing of the past.

So, for now, there's nothing you can do about it but you give a very good example for why it should be re-considered.

Re: Time stamp is incorrect in PP when importing mail into G

Posted: Tue Sep 02, 2014 10:59 pm
by killme
Aah yes. I remember those emails from the future. It made it easy to identify the spam.

Would it be possible to have PP use the earliest Received time stamp instead of the latest? That would seem to solve the issue without reintroducing a former problem.

Re: Time stamp is incorrect in PP when importing mail into G

Posted: Wed Sep 03, 2014 3:55 pm
by Jeff
The reason that PP uses the most recent is in case there's a significant delay somewhere between the starting MTA and final destination. If the message was originally sent 24 hours ago, it could be buried amongst all the email that arrived in the meantime.

Anyway, I'll probably offer it as an option and I'll just have to do some real-world testing to see which would make the best default option.

Re: Time stamp is incorrect in PP when importing mail into Gmail

Posted: Thu May 05, 2016 2:42 am
by killme
Hope it's OK to resurrect an old thread. I just ran into this problem again tonight. I added a POP3 account in Gmail and when the messages started downloading in PP it showed the timestamp of when Gmail downloaded the email. That's when I remembered this old thread. This time I'm using PP 4.1.1 though.

I looked at the headers of the emails and Gmail adds the line "Received: by" at the top (along with other headers). Would it be an easy fix to have PP ignore this line and instead use the line "Received: from" so the correct timestamp will show in PP?

Re: Time stamp is incorrect in PP when importing mail into Gmail

Posted: Thu May 05, 2016 11:02 am
by mjs
ADDENDUM: Okay upon further consideration, am I correct to say that the issue you are discussing only applies to when first creating an account at the time when messages will get initially populated into Pop Peeper? And this has nothing to do with new messages arriving subsequent to when the account was created when messages are initially populated into Pop Peeper in as much as time-stamps for messages that arrive are correct from then on? If so then I apologize for the confusion on my part and please disregard the remainder of my post :oops:, as this is something that Jeff will need to address. :wink:

I'm apparently misunderstanding something here. I tested for Gmail using all three protocols (Gmail, IMAP, POP3) and found that the "Received by" and "Received from" time-stamps were the same in each case, but more importantly it was the correct time as compared to my Computer clock in all three cases in regards to when I sent the message.

Example (which correlated with my Computer time):
Received: by Thu, 5 May 2016 07:27:41 -0700 (PDT)
Received: from Thu, 05 May 2016 07:27:41 -0700 (PDT)

And this was the actual time when the mail was sent.

In each example I noted the time the message was sent and that time correlated to all time stamps in as much as what Gmail had for their inbox time-stamp in the Gmail account interface on the web which was the same as Pop Peeper and as I said, the time correlated to my Computer clock time as to when the message was sent.

Sorry if I'm not understanding something, but I'm not seeing any problem from my end in regards to time-stamps for Gmail messages.


EDIT: Disregard above post as it does not apply to the topic, Jeff has clarified the issue

Re: Time stamp is incorrect in PP when importing mail into Gmail

Posted: Thu May 05, 2016 1:42 pm
by Jeff
lakrsrool -- the importance of this occurs when you import messages from another source into another mailbox. In this case a new "Received" line is placed in the header and PP uses this timestamp (ie. "now") instead of the original timestamp, which could have been years ago. So now, instead of PP displaying the original timestamp -- as would be preferred -- it shows a current timestamp, which is not ideal.

killme -- Ok, this has been changed for the next version, barring any unforeseen incident.

Re: Time stamp is incorrect in PP when importing mail into Gmail

Posted: Tue May 24, 2016 6:45 pm
by Jeff
Update -- well, it took all of 24 hours of running this change before the email arrived that killed it. I received the following email, only the important details noted:

Code: Select all

Received: Tue, 24 May 2016 11:27:23 -0700 (PDT)				= 18:27:23 UTC
Received: Wed, 25 May 2016 01:27:56 +0800					= 17:27:56 UTC
Date: Mon, 22 Sep 2014 22:06:59 +0800						= 2014, who cares
As you can see, the spammers system time is incorrect (2014), which forced me to have to find the message when PP told me I had an unread message. Not cool.

So, my newest implementation uses the last "received" timestamp, which will be the first timestamp chronologically. This should -- theoretically -- be the best compromise between using the original timestamp (for imported messages) and not relying on the inaccuracy of user's computers.

But... I've been pacing around for the last 30 minutes after coming up with that solution which means I'm not satisfied with it. I'm seriously considering sticking with the original code (first "received" timestamp) until more thought/research can be put into this. v4.2 is intended to be a fairly quick release (once I decided v4.2 was going to happen instead of a v4.1.2, which was mid-last week) and I don't want something that has worked for so long for most people to cause a significant delay, or worse, have unexpected side-effects.

One other thing that is interesting if not significant -- notice the 2 "received" timestamps above. Even accounting for the fact that the final server (first line) is in DST, its timestamp is 33 seconds earlier than the sending computer's (second line). Which means that one or both of the server's timestamps are not 100% accurate. Still more accurate than the user's, though.


Thoughts, anyone?
:?:

In fact, after having written up this thesis, I do have a plan, but I'd like to hear from other people before I divulge its details.

Re: Time stamp is incorrect in PP when importing mail into Gmail

Posted: Wed May 25, 2016 11:27 pm
by killme
I agree that using the Date header causes more problems than it solves.

Pasted below are a portion of the headers from an email message as they are shown in Gmail after its been imported. Below that are the same headers as they are shown in Eudora. The top headers that start with the phrase Received: by give the date of August 15, 2014 and that's when Gmail imported the message. Further down, there's another header that begins with Received: from and it gives the date of July 28, 2014. That date matches what's listed in the Date header.

Would it be possible to ignore the timestamps on the lines that begin with Received: by and only use the timestamps that are in the lines that begin with Received: from? Or would it be possible to ignore all timestamps above the line that begins with X-Gmail-Fetch-Info:?

Here are the headers of an email after it was imported into Gmail. I took out the personal information.

Code: Select all

Delivered-To: MYGMAILADDRESS
Received: by 10.216.209.130 with SMTP id s2csp34703weo;
        Fri, 15 Aug 2014 00:43:52 -0700 (PDT)
X-Received: by 10.180.80.133 with SMTP id r5mr51616521wix.62.1408088552348;
        Fri, 15 Aug 2014 00:42:32 -0700 (PDT)
Authentication-Results: mx.google.com;
       spf=hardfail (google.com: domain of srs0=w3xm=4x=gmail.com=SENDERID@bounce.secureserver.net does not designate 68.114.190.11 as permitted sender) smtp.mail=srs0=w3xm=4x=gmail.com=SENDERID@bounce.secureserver.net;
       dkim=pass header.i=@gmail.com
Received-SPF: fail (google.com: domain of srs0=w3xm=4x=gmail.com=SENDERID@bounce.secureserver.net does not designate 68.114.190.11 as permitted sender) client-ip=68.114.190.11;
Received: by 10.181.13.103 with POP3 id ex7mf336185wid.17;
        Fri, 15 Aug 2014 00:42:32 -0700 (PDT)
X-Gmail-Fetch-Info: MYEMAILADDRESS 1 mail.charter.net 110 MYEMAILADDRESS
Return-Path: <srs0=w3xm=4x=gmail.com=SENDERID@bounce.secureserver.net>
Received: from imp04 ([10.20.200.4]) by mta52.charter.net
          (InterMail vM.8.01.05.02 201-2260-151-103-20110920) with ESMTP
          id <20140728093035.HOFW2859.mta52.charter.net@imp04>
          for <MYEMAILADDRESS>; Mon, 28 Jul 2014 05:30:35 -0400
Received: from mtain001.msg.strl.va.charter.net ([68.114.190.11])
	by imp04 with charter.net
	id XlWb1o02T0FCAh804lWbR5; Mon, 28 Jul 2014 05:30:35 -0400
Received: from impin007 ([68.114.189.31])
          by mtain001.msg.strl.va.charter.net
          (InterMail vM.9.00.010.00 201-2473-137) with ESMTP
          id <20140728093035.JUHF10666.mtain001.msg.strl.va.charter.net@impin007>
          for <MYEMAILADDRESS>; Mon, 28 Jul 2014 04:30:35 -0500
Received: from p3plsmtp12-06.prod.phx3.secureserver.net ([173.201.192.63])
	by impin007 with charter.net
	id XlWa1o03r1NXqsV01lWboV; Mon, 28 Jul 2014 04:30:35 -0500
	...{snipped)...
Date: Mon, 28 Jul 2014 05:30:34 -0400
Here are the beginning headers for the same email as shown in Eudora. I took out the personal information.

Code: Select all

Return-Path: <srs0=w3xm=4x=gmail.com=SENDERID@bounce.secureserver.net>
Received: from imp04 ([10.20.200.4]) by mta52.charter.net
          (InterMail vM.8.01.05.02 201-2260-151-103-20110920) with ESMTP
          id <20140728093035.HOFW2859.mta52.charter.net@imp04>
          for <MYEMAILADDRESS>; Mon, 28 Jul 2014 05:30:35 -0400
Received: from mtain001.msg.strl.va.charter.net ([68.114.190.11])
        by imp04 with charter.net
        id XlWb1o02T0FCAh804lWbR5; Mon, 28 Jul 2014 05:30:35 -0400
Received: from impin007 ([68.114.189.31])
          by mtain001.msg.strl.va.charter.net
          (InterMail vM.9.00.010.00 201-2473-137) with ESMTP
          id <20140728093035.JUHF10666.mtain001.msg.strl.va.charter.net@impin007>
          for <MYEMAILADDRESS>; Mon, 28 Jul 2014 04:30:35 -0500
Received: from p3plsmtp12-06.prod.phx3.secureserver.net ([173.201.192.63])
        by impin007 with charter.net
        id XlWa1o03r1NXqsV01lWboV; Mon, 28 Jul 2014 04:30:35 -0500
        ...(snipped)...
Date: Mon, 28 Jul 2014 05:30:34 -0400

Re: Time stamp is incorrect in PP when importing mail into Gmail

Posted: Thu May 26, 2016 3:18 pm
by Jeff
ignore all timestamps above the line that begins with X-Gmail-Fetch-Info:?
Maybe if GMail ever becomes the sole email provider, but I'm hoping it never comes to that... ;)

only use the timestamps that are in the lines that begin with Received: from
That's actually a very interesting observation. It does have some merit, but I also think it's possible that it may only work in certain situations -- that is, it may be specific to the server (gmail) and/or to the method you used to import messages.

For posterity, here's what I found:
RFC 2821, section 4.4, "Trace information" --
- The FROM field, which MUST be supplied in an SMTP environment,
SHOULD contain both (1) the name of the source host as presented
in the EHLO command and (2) an address literal containing the IP
address of the source, determined from the TCP connection.
Basically, it's not saying that it must NOT be present in other situations, which means that there may be some implementations which may use the "From" Field. For example, I'm assuming that you used Eudora to transfer "local" email up to the GMail IMAP server? But I wonder what would happen if you used GMail to retrieve messages via POP3, would it add an extra "received" line into the header and would it include the "From" field, since it could theoretically have that information from the POP3 server. To be honest, I haven't tested it, as it really wouldn't prove anything; otherwise, I'd just fall into the same trap I did when I thought that using the "Date" field might be a good idea now that the entire world must surely use internet/atomic clocks to sync their clocks :)


Anyway, the plan that I alluded to before is thus: the default behavior for PP will not change, yet. But -- I've added a hidden option that allows you to change the behavior so that PP can use the chronologically first "received" header. This is experimental and does require a couple of one-time manual changes to enable; this is all documented here, along with a long prose of why this is necessary:
http://www.esumsoft.com/products/pop-pe ... TimeHeader

I will email you with more details, so that you can test it out.

Re: Time stamp is incorrect in PP when importing mail into Gmail

Posted: Thu May 26, 2016 9:32 pm
by killme
I used Gmail to retrieve the emails via POP3 and that's where the additional Received lines came from. I am assuming the X-Gmail-Fetch-Info line is only added to the emails that Gmail retrieves because the line is not present on other emails sent directly to my Gmail address.

Could a rule be made to detect this line in the headers of an email? If the line is present then PP would ignore the timestamps above the line. If the line is NOT present then PP would use the latest timestamp as it does now.

I will try out 4.2 and see what happens. Thank you for taking the time.

Dan

Re: Time stamp is incorrect in PP when importing mail into Gmail

Posted: Thu May 26, 2016 11:12 pm
by killme
I installed PP 4.2 beta and made the changes to use the last Received header entry. I'm running it simultaneously with v4.1.1

Emails that are retrieved by Gmail via POP3 are now showing the correct timestamp. The timestamp on some emails in PP 4.2 show it to be a minute earlier than on 4.1.1. I don't think a minute really matters that much.

Re: Time stamp is incorrect in PP when importing mail into Gmail

Posted: Fri May 27, 2016 2:52 pm
by Jeff
Thanks for doing the comparison and following up.

Yes, there will definitely be some variations, it could even be several minutes (or hours, or days, really; but unlikely except in the event that one of the servers along the route was inaccessible). I think the important thing is that it will still be consistent. That is, in a running conversation, the emails won't become out of order just because PP is using a different field, because it will use the equivalent field for each message.

Be sure to let me know if you ever come across an email that seems to be really out of order (e.g. you receive a new email in PP, but can't easily find it because it's not at the top of the list).

Re: Time stamp is incorrect in PP when importing mail into Gmail

Posted: Mon May 30, 2016 11:55 am
by killme
Just want to add that this issue doesn't occur on Outlook.com using either IMAP or POP3 to import email. Outlook.com doesn't add a timestamp of when the email was retrieved. I wish Gmail behaved that way.

Re: Time stamp is incorrect in PP when importing mail into Gmail

Posted: Tue May 31, 2016 1:23 pm
by Jeff
Out of curiosity -- and I apologize if you mentioned this previously -- can you tell which timestamp GMail uses for the imported messages? That is, when viewing the messages through your webbrowser on gmail.com, and do they show a different timestamp on the message list as opposed to when you actually open the message?

Re: Time stamp is incorrect in PP when importing mail into Gmail

Posted: Thu Jun 02, 2016 1:52 pm
by killme
Gmail will show the correct timestamp of when the message arrived at the original email account. In other words, Gmail ignores the timestamp that it itself added when it imported the message.