LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-13-2013, 06:09 AM   #1
starchon
LQ Newbie
 
Registered: Jan 2012
Posts: 4

Rep: Reputation: Disabled
Getmail4 - changing date time of imported mail.


Hi,

I have written a gmail archiver script which uses getmail4 to retrieve email via SimpleIMAPSSLRetriever and archives them to an mbox file.

All works well, apart from the fact the retrieved mail all have the date / time changed to the current time they were imported at.

Does anyway know a way to leave the date / time stamps of the retrieved mail untouched?

Thanks in advance,

steve
 
Old 06-14-2013, 08:06 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by starchon View Post
(..) the retrieved mail all have the date / time changed to the current time they were imported at.
Could you post (obfuscated) headers for one single email so we can confirm this? I mean if that really would be the case it would be a violation of the IMAP RFC and also something I never encountered having used getmail the past couple of years.
 
Old 06-18-2013, 05:25 AM   #3
starchon
LQ Newbie
 
Registered: Jan 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thanks for the response, much apreciated. Please find headers below for the same mail before and after being retrieved by getmail:

Ive highlighted what is added after being retrieved by getmail. Now Ive just tested Thunderbird, and the dates are correct on the mail's once the mbox is imported. Apple Mail however is displaying all email dates as 28th May. Should have tested another client first, but I still dont udnerstand why Apple Mail is reporting the latest "Received By" date, and Thunderbird is correctly ignoring that date?

Original Header


Code:
Delivered-To: some_receiver@example.com
Received: by xxx.xxx.xxx.xxx with SMTP id a8csp143816oag;
        Sun, 4 Nov 2012 10:55:30 -0800 (PST)
Received: by  xxx.xxx.xxx.xxx with SMTP id h11mr2994552lbc.99.1352055329733;
        Sun, 04 Nov 2012 10:55:29 -0800 (PST)
Return-Path: <some_sender@example.com>
Received: from mail-la0-f53.google.com (mail-la0-f53.google.com [ xxx.xxx.xxx.xxx])
        by mx.google.com with ESMTPS id v1si11150985lbh.45.2012.11.04.10.55.29
        (version=TLSv1/SSLv3 cipher=OTHER);
        Sun, 04 Nov 2012 10:55:29 -0800 (PST)
Received-SPF: pass (google.com: domain of some_sender@example.com designates xxx.xxx.xxx.xxx as permitted sender) client-ip= xxx.xxx.xxx.xxx;
Authentication-Results: mx.google.com; spf=pass (google.com: domain of some_sender@example.com designates  xxx.xxx.xxx.xxx as permitted sender) smtp.mail=some_sender@example.com
Received: by mail-la0-f53.google.com with SMTP id l5so3593875lah.40
        for <some_receiver@example.com>; Sun, 04 Nov 2012 10:55:29 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20120113;
        h=mime-version:date:message-id:subject:from:to:content-type
         :x-gm-message-state;
        bh=PUwnjwmibDFtcMlaDAnyqSsTdHpOXjNJPLjbnXMDRbg=;
        b=eOsp84FJEsd7uLqsua3cx3GMoLE1FnCn2pkkdoLtrob9qpYQB+NPGrJNMYGVodZi8I
         Ogzef6Ybf481kpbsm7TGX/uRnUUC0mcKvO6faVSpHwnh0blhlLd1PiNW8kQfz3PDp+nU
         rUkjbzJizNlBdsA+39ufwwxKT/tf09Rq3KNdtCL2NrBUSyt7RePa3DE0NDLI1NAS3vXC
         l6l6C3NCpPy+rmKyE3ZkUkpTAcWWyn+6J5wPwWjLpOjiVJ3PDSrBKZpEvWUXAu2Eeoz2
         QOb1lPgrdcVN/IjLtCeHwEkkaP14lBy/fuqNVgHFS0K8LcDreg59bQ+T6e1OjjIrVIbx
         qjng==
MIME-Version: 1.0
Received: by xxx.xxx.xxx.xxx with SMTP id fv4mr7035539lab.39.1352055325548;
 Sun, 04 Nov 2012 10:55:25 -0800 (PST)
Received: by xxx.xxx.xxx.xxx with HTTP; Sun, 4 Nov 2012 10:55:25 -0800 (PST)
Date: Sun, 4 Nov 2012 18:55:25 +0000
Message-ID: <CAPhtDuZwNcDrB39KBYMoqNHuCfmJFu-qyqZb_yRHEuEfF9Qc6A@mail.gmail.com>
Subject: some crap.
From: some_sender@example.com
To: undisclosed-recipients:;
Content-Type: multipart/alternative; boundary=f46d040711e56561f404cdafe906
Bcc: some_receiver
X-Gm-Message-State: ALoCoQnPtm4SqwEsofQrY7zb/9iJAZBZhXmobxs1W3lHoXNwVc5zJMDMpNnBe7OMH960mhYZ/j6O

--f46d040711e56561f404cdafe906
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable
After Getmail Retrieval:

Code:
Return-Path: <some_sender@example.com>
Delivered-To: unknown
Received: from imap.gmail.com (173.194.66.108:993) by
  xxx.xxx.xxx.xxx with IMAP4-SSL; 28 May 2013
  10:30:04 -0000
Delivered-To: some_receiver@example.com
Received: by xxx.xxx.xxx.xxx with SMTP id a8csp143816oag;
        Sun, 4 Nov 2012 10:55:30 -0800 (PST)
Received: by xxx.xxx.xxx.xxx with SMTP id h11mr2994552lbc.99.1352055329733;
        Sun, 04 Nov 2012 10:55:29 -0800 (PST)
Received: from mail-la0-f53.google.com (mail-la0-f53.google.com [209.85.215.53])
        by mx.google.com with ESMTPS id v1si11150985lbh.45.2012.11.04.10.55.29
        (version=TLSv1/SSLv3 cipher=OTHER);
        Sun, 04 Nov 2012 10:55:29 -0800 (PST)
Received-SPF: pass (google.com: domain of some_sender@example.com designates xxx.xxx.xxx.xxx as permitted sender) client-ip=xxx.xxx.xxx.xxx;
Authentication-Results: mx.google.com; spf=pass (google.com: domain of ome_sender@example.com designates xxx.xxx.xxx.xxx as permitted sender) smtp.mail=some_sender@example.com
Received: by mail-la0-f53.google.com with SMTP id l5so3593875lah.40
        for <some_receiver@example.com>; Sun, 04 Nov 2012 10:55:29 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20120113;
        h=mime-version:date:message-id:subject:from:to:content-type
         :x-gm-message-state;
        bh=PUwnjwmibDFtcMlaDAnyqSsTdHpOXjNJPLjbnXMDRbg=;
        b=eOsp84FJEsd7uLqsua3cx3GMoLE1FnCn2pkkdoLtrob9qpYQB+NPGrJNMYGVodZi8I
         Ogzef6Ybf481kpbsm7TGX/uRnUUC0mcKvO6faVSpHwnh0blhlLd1PiNW8kQfz3PDp+nU
         rUkjbzJizNlBdsA+39ufwwxKT/tf09Rq3KNdtCL2NrBUSyt7RePa3DE0NDLI1NAS3vXC
         l6l6C3NCpPy+rmKyE3ZkUkpTAcWWyn+6J5wPwWjLpOjiVJ3PDSrBKZpEvWUXAu2Eeoz2
         QOb1lPgrdcVN/IjLtCeHwEkkaP14lBy/fuqNVgHFS0K8LcDreg59bQ+T6e1OjjIrVIbx
         qjng==
MIME-Version: 1.0
Received: by xxx.xxx.xxx.xxx with SMTP id fv4mr7035539lab.39.1352055325548;
 Sun, 04 Nov 2012 10:55:25 -0800 (PST)
Received: by xxx.xxx.xxx.xxx with HTTP; Sun, 4 Nov 2012 10:55:25 -0800 (PST)
Date: Sun, 4 Nov 2012 18:55:25 +0000
Message-ID: <CAPhtDuZwNcDrB39KBYMoqNHuCfmJFu-qyqZb_yRHEuEfF9Qc6A@mail.gmail.com>
Subject: some crap.
From: some_sender@example.com
To: undisclosed-recipients:;
Content-Type: multipart/alternative; boundary=f46d040711e56561f404cdafe906
Bcc: some_receiver
X-Gm-Message-State: ALoCoQnPtm4SqwEsofQrY7zb/9iJAZBZhXmobxs1W3lHoXNwVc5zJMDMpNnBe7OMH960mhYZ/j6O

--f46d040711e56561f404cdafe906
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

Last edited by starchon; 06-18-2013 at 06:05 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem changing time and date linx win Debian 5 02-14-2011 11:37 PM
ls -R without changing access time/date bhyurf Programming 5 09-01-2010 11:57 PM
Changing the Time/Date format WilliaMITCHELL Ubuntu 3 09-28-2008 12:34 PM
Code for changing system's local date & time g4j31a5 Programming 8 03-21-2007 05:02 AM
Changing system date and time from KDE yapp Linux - General 4 04-17-2005 03:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration