Re: [Dovecot] Maildir files with mtime in the future

2009-04-03 Thread Holger Weiss
* Ben Winslow r...@bluecherry.net [2009-04-03 10:59]:
 On Fri, 3 Apr 2009 01:14:47 +0200
 Holger Weiss hol...@cis.fu-berlin.de wrote:
  I'd guess most backup software will include files with an mtime newer
  than the time of the previous backup in incremental backups.  At
  least, Bacula[*] and Veritas NetBackup do it that way.
 
 Aren't IMAP messages supposed to be immutable?  If the actual message
 is changed, it should reappear as a new file/message, and therefore be
 backed up because it didn't exist in the previous backup run.

The problem with an mtime in the future is that the file in question
will be backed up again and again with every incremental backup run even
though the file is unchanged.

Holger


Re: [Dovecot] Maildir files with mtime in the future

2009-04-03 Thread Holger Weiss
* Timo Sirainen t...@iki.fi [2009-04-03 12:44]:
 On Thu, 2009-04-02 at 19:36 +0200, Holger Weiss wrote:
  However, if the client does so, Dovecot will set the mtime of the
  Maildir file in question to the date specified by the client even if
  it's in the future.  Since files with an mtime in the future can cause
  all sorts of trouble (e.g., they might get backed up repeatedly by
  incremental backups), it would be nice if Dovecot would (optionally?)
  use the current time if the client specifies a time in the future.  For
  example, we use the following patch:
 
 Committed the patch, but forgot to add your name to the commit message,
 sorry. :(

No problem.

 I also changed it so that it allows times 2 hours into the future (I'm
 not sure why I chose exactly 2 hours).

Sounds good.

Thank you, Holger


Re: [Dovecot] Maildir files with mtime in the future

2009-04-02 Thread Holger Weiss
* Timo Sirainen t...@iki.fi [2009-04-02 18:44]:
 On Thu, 2009-04-02 at 19:36 +0200, Holger Weiss wrote:
  | If a date-time is specified, the internal date SHOULD be set in the
  | resulting message; otherwise, the internal date of the resulting
  | message is set to the current date and time by default.
  
  [ ftp://ftp.fu-berlin.de/doc/rfc/rfc3501.txt (6.3.11. APPEND Command) ]
  
  However, if the client does so, Dovecot will set the mtime of the
  Maildir file in question to the date specified by the client even if
  it's in the future.  Since files with an mtime in the future can cause
  all sorts of trouble (e.g., they might get backed up repeatedly by
  incremental backups), it would be nice if Dovecot would (optionally?)
  use the current time if the client specifies a time in the future.  
 
 Hmm. I don't really like violating a SHOULD.

Maybe the reason why this is not defined as a MUST is that the server
needn't accept obviously incorrect dates :-)

 I wonder how big of a problem this actually is. Are people often backing
 up based on mtime?

I'd guess most backup software will include files with an mtime newer
than the time of the previous backup in incremental backups.  At least,
Bacula[*] and Veritas NetBackup do it that way.

  For example, we use the following patch:
 
 This is a problem only with Maildir, so if the code is added it should
 go to maildir-save.c.

The mtime-problem is Maildir-specific, but an INTERNALDATE in the future
is obviously incorrect in any case.

Holger

[*] See: 
http://www.bacula.org/manuals/en/install/install/Configuring_Director.html


Re: [Dovecot] Maildir files with mtime in the future

2009-04-02 Thread Holger Weiss
* Timo Sirainen t...@iki.fi [2009-04-02 19:35]:
 On Fri, 2009-04-03 at 01:14 +0200, Holger Weiss wrote:
   This is a problem only with Maildir, so if the code is added it should
   go to maildir-save.c.
  
  The mtime-problem is Maildir-specific, but an INTERNALDATE in the future
  is obviously incorrect in any case.
 
 Not necessarily. Although I guess it's always some kind of a
 misconfiguration in that case. Like if server's time isn't correct.

Yes, but I guess the code should simply assume the server's time is
correct (or things may go south).

 Or maybe client wants to live in future. :)

True, you never know ... :-)

 I'll ask in imap list what others think about it.

Thanks a lot!

Holger


Re: [Dovecot] cyrus2dovecot description on the wiki

2008-09-24 Thread Holger Weiss
* Charles Marcus [EMAIL PROTECTED] [2008-09-24 12:12]:
 On 9/24/2008 11:47 AM, Steinar Bang wrote:
  The wiki page says cyrus2dovecot doesn't preserve timestamps or flags
  http://wiki.dovecot.org/Migration/Cyrus
 
  However, the cyrus2dovecot home page says:
   Virtually all available metadata is preserved during the
conversion. This includes the UID and INTERNALDATE of each message,
the IMAP folder subscriptions, the UIDVALIDITY and UIDNEXT values for
each folder, as well as all IMAP flags (i.e., \Recent, \Seen,
\Answered, \Flagged, \Draft, \Deleted) and the first 26 user-defined
keywords.
 
  Which to me sounds like the opposite of what the dovecot wiki says.
 
  Perhaps the wiki should be updated?

 Looks like there are 2 different scripts.

Yes, indeed.  We (Freie Universität Berlin) published our Cyrus2Dovecot
just a few days ago.  Unlike the older script, ours _does_ try hard to
preserve all available metadata, and this should actually work with all
Cyrus versions (tested with both the oldest and the newest available
Cyrus release, that is, 1.4 and 2.3.12p2, and with various database
formats).  Apart from that, ours provides a few additional features we
needed for our conversion which might also be useful to others, such as
renaming (or moving) folders using s/regex/replacement/ substitutions.

 But yeah, if the one you referenced above works well, the wiki should be
 changed to reflect use of this new one (with the permission of the
 author of course)...

We now added our Cyrus2Dovecot to the wiki page.

Holger


Re: [Dovecot] cyrus2courrier mass migration

2008-09-23 Thread Holger Weiss
* Mathieu Kretchner [EMAIL PROTECTED] [2008-09-23 12:59]:
 Holger Weiss a écrit :
  However, for our conversion, we've written our own cyrus2dovecot which
  also supports skiplist databases (amongst another few features not
  provided by the other tools):
  
  http://cyrus2dovecot.sw.fu-berlin.de/
 
 I've tried this one too and I'm stuck too :
 
 [EMAIL PROTECTED] testimap]# ./cyrus2dovecot -C /root/Mail/%u  -D 
 dovecot-mail/ mketchn
 
 cyrus2dovecot [mketchn]: (error) No Cyrus INBOX at: /root/Mail/mketchn

 [...]

 But I'm sure cyrus.header and cyrus.index exist.

Are you really sure?  That is, the following commands don't complain?

$ ls /root/Mail/mketchn/cyrus.header
$ ls /root/Mail/mketchn/cyrus.index

Holger


Re: [Dovecot] cyrus2courrier mass migration

2008-09-22 Thread Holger Weiss
* Mathieu Kretchner [EMAIL PROTECTED] [2008-09-22 16:11]:
 I would like to do a conversion of my imap accounts (and keep all theirs
 characteristics) from cyrus-imapd-2.2.12 in cyrus format to dovecot
 1.1.3 in courrier format.
 
 I've tried those 3 tools :
 
 cyrus2courrier.1.5.ts
 cyrus2courier-1.3z4
 imapsync (works well but very slow and should not be a true solution)
 
 But nothing is working to keep the seen/unseen flag (expect imapsync) !
 I know my cyrus version is too recent but do you have any idea how
 could I do this migration ?

cyrus2courier 1.5.ts should work with Cyrus 2.2.12 if the seen (and
subscription) states are available in flat text files; otherwise, they
must first be converted using cvt_cyrusdb(8).

However, for our conversion, we've written our own cyrus2dovecot which
also supports skiplist databases (amongst another few features not
provided by the other tools):

http://cyrus2dovecot.sw.fu-berlin.de/

Holger


[Dovecot] Cosmetic issue with dots in Maildir folder names

2008-09-07 Thread Holger Weiss
Just a minor cosmetic issue: We use the listescape plugin in order to
support . characters in Maildir++ folder names, and in at least the
following case, the escaped representation of the dot character (\2e)
won't be translated back to a . in messages for the IMAP client:

| 1 SELECT non.existent
| 1 NO Mailbox doesn't exist: non\2eexistent

However, SELECTing an existing folder whose name includes a dot works
fine, and it also works in other cases, e.g.:

| 2 CREATE does.exist
| 2 OK Create completed.
| 3 LIST  does.exist
| * LIST (\HasNoChildren) / does.exist
| 3 OK List completed.

This is with Dovecot 1.1.3; we use separator = / and we've defined
REAL_SEP to '.' and VIRTUAL_SEP to '/' in the plugin.

Holger