Changing message filename convention

Bron Gondwana brong at fastmail.fm
Sun Nov 15 15:34:18 EST 2009


On Sun, Nov 15, 2009 at 08:09:02AM -0600, Jeff wrote:
> On Sun, Nov 15, 2009 at 4:52 AM, Bron Gondwana <brong at fastmail.fm> wrote:
> > On Sun, Nov 15, 2009 at 08:51:02AM +0000, David Carter wrote:
> >> On Sat, 14 Nov 2009, Jeff wrote:
> >>
> >> >Without getting into the details of why I want to do this, is
> >> >there a quick way to hack the source to change the file naming
> >> >convention for message files. I have reason to not want the
> >> >trailing dot.
> >>
> >> The trailing dot is there to generate unique names, so you don't
> >> have any conflict with the mailbox namespace. For example a mailbox
> >> named "42" or "cyrus.index". I really wouldn't recommend this.
> >
> > I would recomment 12345.eml if you were going to do this, rather than
> > just strip the dot.
> >
> > http://filext.com/file-extension/EML
> >
> > It shouldn't be too hard to add, but it's a pain to have to convert
> > on a live instance of course.
> >
> > Also - I suspect there's a pile of code that depends on the \d+\.
> > pattern existing.
> 
> Yes, .eml was my plan, but changing only mailbox.c breaks things. I
> was looking for some pointers on which other source files made
> assumptions about the expected file name.

There's no guarantee I've got them all, and they're totally untested,
but here's a couple of patches.  I'm planning to apply the first one
(once it's tested obviously) but not necessarily the second one!
Putting all the filename creating logic in one place is sane for sure.

Basically the pattern "%lu." in a sprintf is a likely candidate.  I
haven't audited all the other possibilities yet though!

Bron.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-and-use-mailbox_message_fname-implementation.patch
Type: text/x-diff
Size: 16910 bytes
Desc: not available
Url : http://lists.andrew.cmu.edu/pipermail/cyrus-devel/attachments/20091116/a61561b7/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-rename-mailbox-options.patch
Type: text/x-diff
Size: 1600 bytes
Desc: not available
Url : http://lists.andrew.cmu.edu/pipermail/cyrus-devel/attachments/20091116/a61561b7/attachment-0001.bin 


More information about the Cyrus-devel mailing list