Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: DBMail: dev

[DBMail 0000911]: Messages saved with IMAP have incorrect internaldate

 

 

DBMail dev RSS feed   Index | Next | Previous | View Threaded


bugtrack at dbmail

Jul 20, 2012, 3:08 PM

Post #1 of 1 (258 views)
Permalink
[DBMail 0000911]: Messages saved with IMAP have incorrect internaldate

A NOTE has been added to this issue.
======================================================================
http://dbmail.org/mantis/view.php?id=911
======================================================================
Reported By: brendan
Assigned To:
======================================================================
Project: DBMail
Issue ID: 911
Category: IMAP daemon
Reproducibility: always
Severity: minor
Priority: normal
Status: new
target:
======================================================================
Date Submitted: 29-Jul-11 01:22 CEST
Last Modified: 21-Jul-12 00:08 CEST
======================================================================
Summary: Messages saved with IMAP have incorrect internaldate
Description:
We migrated one mailbox from our old system to DBMail 3.0 rc2 to test, and
found that all messages copied to it (with IMAP), and all new ones saved
using IMAP, have an internaldate 7 hours earlier than what each should be.
All new messages delivered by lmtpd are correct. The 7 hour difference
corresponds to our timezone PDT (-0700), but the time shown is neither UTC
nor PDT because UTC is 7 hours later than our time.

The problem seems to come from the use of strptime/strftime in
_ic_append_enter in imapcommands.c, which strips the -0700 portion of the
date string sent by the IMAP client when constructing sqltime, so the
message is saved with the localtime value as if it were UTC.

For our site I corrected it for the moment with the crude patch below. I
only tested it lightly so far, but g_mime_utils_header_decode_date (in
dbmail_message_set_internal_date in dbmail-message.c) seems to handle the
unmodified date just fine. I am sure you can fix it more cleanly.

*** imapcommands.c.old 2011-07-28 16:16:00.000000000 -0700
--- imapcommands.c 2011-07-28 16:14:51.000000000 -0700
***************
*** 1230,1236 ****
dt = g_strstrip(dt);

if (strptime(dt, "%d-%b-%Y %T", &tm) != NULL)
! strftime(sqldate, sizeof(sqldate), "%Y-%m-%d %H:%M:%S", &tm);
else
sqldate[0] = '\0';
/* internal date specified */
--- 1230,1236 ----
dt = g_strstrip(dt);

if (strptime(dt, "%d-%b-%Y %T", &tm) != NULL)
! strcpy(sqldate, dt);
else
sqldate[0] = '\0';
/* internal date specified */

======================================================================

----------------------------------------------------------------------
(0003463) brendan (reporter) - 21-Jul-12 00:08
http://dbmail.org/mantis/view.php?id=911#c3463
----------------------------------------------------------------------
This is fixed in release 3.0.2.

Issue History
Date Modified Username Field Change
======================================================================
29-Jul-11 01:22 brendan New Issue
21-Jul-12 00:08 brendan Note Added: 0003463
======================================================================

_______________________________________________
Dbmail-dev mailing list
Dbmail-dev [at] dbmail
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail-dev

DBMail dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.