Uploaded image for project: 'James Server'
  1. James Server
  2. JAMES-1515

Maildirstorage backend crashes with Exception due to "wrong" filename

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 3.0-beta4
    • None
    • None
    • OpenJDK 6 on Debian/GNU Linux "wheezy"

    Description

      The maildirstorage backend crashed:

      INFO | jvm 1 | 2013/07/23 19:42:02 | java.lang.NumberFormatException: For input string: "5891,W=6001"
      INFO | jvm 1 | 2013/07/23 19:42:02 | at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
      INFO | jvm 1 | 2013/07/23 19:42:02 | at java.lang.Long.parseLong(Long.java:438)
      INFO | jvm 1 | 2013/07/23 19:42:02 | at java.lang.Long.valueOf(Long.java:535)
      INFO | jvm 1 | 2013/07/23 19:42:02 | at org.apache.james.mailbox.maildir.MaildirMessageName.getSize(MaildirMessageName.java:293)
      INFO | jvm 1 | 2013/07/23 19:42:02 | at org.apache.james.mailbox.maildir.mail.model.MaildirMessage.getFullContentOctets(MaildirMessage.java:381)
      INFO | jvm 1 | 2013/07/23 19:42:02 | at org.apache.james.mailbox.store.MessageResultImpl.getSize(MessageResultImpl.java:89)
      INFO | jvm 1 | 2013/07/23 19:42:02 | at org.apache.james.imap.processor.fetch.FetchResponseBuilder.build(FetchResponseBuilder.java:145)
      INFO | jvm 1 | 2013/07/23 19:42:02 | at org.apache.james.imap.processor.fetch.FetchProcessor.processMessageRanges(FetchProcessor.java:164)
      INFO | jvm 1 | 2013/07/23 19:42:02 | at org.apache.james.imap.processor.fetch.FetchProcessor.doProcess(FetchProcessor.java:119)
      INFO | jvm 1 | 2013/07/23 19:42:02 | at org.apache.james.imap.processor.fetch.FetchProcessor.doProcess(FetchProcessor.java:54)
      INFO | jvm 1 | 2013/07/23 19:42:02 | at org.apache.james.imap.processor.AbstractMailboxProcessor.doProcess(AbstractMailboxProcessor.java:100)
      INFO | jvm 1 | 2013/07/23 19:42:02 | at org.apache.james.imap.processor.AbstractMailboxProcessor.process(AbstractMailboxProcessor.java:89)
      INFO | jvm 1 | 2013/07/23 19:42:02 | at org.apache.james.imap.processor.AbstractMailboxProcessor.doProcess(AbstractMailboxProcessor.java:83)
      INFO | jvm 1 | 2013/07/23 19:42:02 | at org.apache.james.imap.processor.AbstractMailboxProcessor.doProcess(AbstractMailboxProcessor.java:66)
      INFO | jvm 1 | 2013/07/23 19:42:02 | at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:52)
      INFO | jvm 1 | 2013/07/23 19:42:02 | at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:54)
      INFO | jvm 1 | 2013/07/23 19:42:02 | at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:54)
      INFO | jvm 1 | 2013/07/23 19:42:02 | at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:54)
      INFO | jvm 1 | 2013/07/23 19:42:02 | at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:54)
      INFO | jvm 1 | 2013/07/23 19:42:02 | at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:54)
      INFO | jvm 1 | 2013/07/23 19:42:02 | at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:54)
      INFO | jvm 1 | 2013/07/23 19:42:02 | at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:54)
      INFO | jvm 1 | 2013/07/23 19:42:02 | at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:54)
      INFO | jvm 1 | 2013/07/23 19:42:02 | at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:54)
      INFO | jvm 1 | 2013/07/23 19:42:02 | at org.apache.james.imap.processor.base.AbstractChainedProcessor.process(AbstractChainedProcessor.java:54)
      INFO | jvm 1 | 2013/07/23 19:42:02 | at org.apache.james.imapserver.netty.ImapChannelUpstreamHandler.messageReceived(ImapChannelUpstreamHandler.java:181)
      INFO | jvm 1 | 2013/07/23 19:42:02 | at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296)
      INFO | jvm 1 | 2013/07/23 19:42:02 | at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:327)
      INFO | jvm 1 | 2013/07/23 19:42:02 | at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:305)
      INFO | jvm 1 | 2013/07/23 19:42:02 | at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:207)
      INFO | jvm 1 | 2013/07/23 19:42:02 | at org.jboss.netty.handler.execution.ChannelUpstreamEventRunnable.run(ChannelUpstreamEventRunnable.java:44)
      INFO | jvm 1 | 2013/07/23 19:42:02 | at org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor$ChildExecutor.run(OrderedMemoryAwareThreadPoolExecutor.java:312)
      INFO | jvm 1 | 2013/07/23 19:42:02 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
      INFO | jvm 1 | 2013/07/23 19:42:02 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      INFO | jvm 1 | 2013/07/23 19:42:02 | at java.lang.Thread.run(Thread.java:679)

      I migrated maildirs from a dovecot to James. Dovecot uses the following format for MaildirMessageName's:

      1374565032.M689006P9510.vs4918,S=1759,W=1797:2,Sa
      <timestamp>.<id>.<host>,S=<size>,W=<size in cr+lf form>:<info>

      (see http://wiki.dovecot.org/MailboxFormat/Maildir)
      The field W= is not expected by the current implementation. The maildir format documentation states: (http://cr.yp.to/proto/maildir.html) "Do not try to extract information from unique names." I think this means that the implementation may try to use that info, but should not rely on the correctness/availability of that info.

      WORKAROUND:
      Remove ",W=<num>" on every maildir file.

      Attachments

        1. JamesMaildirRepair.java
          5 kB
          Jan-Philipp Hülshoff

        Activity

          People

            Unassigned Unassigned
            jphue Jan-Philipp Hülshoff
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: