james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Charles (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (MAILBOX-187) Parsing bugs MaildirMessageName?
Date Thu, 03 Jan 2013 15:06:13 GMT

     [ https://issues.apache.org/jira/browse/MAILBOX-187?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Eric Charles resolved MAILBOX-187.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 0.4
         Assignee: Eric Charles

Patch tested with mailbox-maildir + mailbox-integration-tester and committed Thx a bunch Eike.
Eric
                
> Parsing bugs MaildirMessageName?
> --------------------------------
>
>                 Key: MAILBOX-187
>                 URL: https://issues.apache.org/jira/browse/MAILBOX-187
>             Project: James Mailbox
>          Issue Type: Bug
>          Components: maildir
>    Affects Versions: 0.4
>            Reporter: Eike Kettner
>            Assignee: Eric Charles
>             Fix For: 0.4
>
>         Attachments: mailbox-187_2.patch, mailbox-187.patch
>
>
> I'm trying to migrate my postfix+courier setup to apache james. I want to keep my maildirs
and so pointed james to my courier maildir folders. When connecting to the mailbox, james
threw `StringIndexArrayOutOfBoundsEx` and `NullPointerEx` at me.
> The NPE came out of the class `MailderMessage`, while the IndexOutOfBounds were coming
from `MaildirMessageName`. All those exceptions were caused by the filenames in my mailbox,
that were not as expected by the parser. Looking at the source, I found that while parsing
a `MaildirMessageName`, the size field is expected to be present. If not, parsing fails. I
even have files in my mailbox without neither attributes nor flags in the filename... This
would also cause the parser to fail.
> The NPE in `MaildirMessage` was due to a message without flags while setting the RECENT
flag in the constructor. There is another subtle potential NPE bug in `MaildirMessage` when
returning the size obtained from the `MaildirMessageName` object. This could return null which
would fail when casting to a primitive long. Since the parser expects the size to be present,
this does not occur right now.
> While I'm fine with renaming my files to satisfy the `MaildirMessageName` parser, I thought
that it is better, if the parser would be more lenient regarding the message filename. I also
skimmed though this page http://cr.yp.to/proto/maildir.html and couldn't find a hint that
fields and flags is a requirement of a message filename? But I'm very new to those subjects
and there may be another specification or I failed to understand. Well, at the end, it would
be great if the parser accepts my message filenames, too :-). I'll attach a patch that aims
to fix those things (including a unit test), if you agree. 
> Thanks for such a great project, by the way!
> Kind Regards, Eike

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message