james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Thunderbird Mailbox support
Date Mon, 21 Jul 2014 12:31:46 GMT
On Fri, 2014-07-18 at 11:53 +0200, Wolfgang Fahl wrote:
> Dear mime4j developers,
> 
> for one of my projects I have been using mime4j successfully to import
> e-mail into our CRM database for some two years know.
> Currently I am trying to add a feature which would allow reading Mozilla
> Thunderbird Mailbox content.
> As of mime4j 0.8 there seems to be a MboxIterator which could do that.
> Since I didn't find any publicly available source repository which I
> could use to access the 0.8-Snapshop I have copied
> the three source files:
> * CharBufferWrapper.java
> * FromLinePatterns.java
> * MboxIterator.java
> 
> into my source tree and I am using these together with the following
> maven dependency:
> 
> <!-- EMail handling -->
>         <dependency>
>             <groupId>org.apache.james</groupId>
>             <artifactId>apache-mime4j-core</artifactId>
>             <version>0.7.2</version>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.james</groupId>
>             <artifactId>apache-mime4j-dom</artifactId>
>             <version>0.7.2</version>
>         </dependency>
> 
> The iterator works somewhat o.k. on some of the Thunderbird mailbox
> files and loops thru the mails in it correctly.
> The mails can than not be directly parsed with mime4j - there is one
> newline at the begining which spoils the show. After
> working around this it's working as expected in some cases. In other
> cases there is an error:
> 
> java.lang.IllegalArgumentException: File does not contain From_ lines!
> Maybe not be a vaild Mbox.
>     at
> org.apache.james.mime4j.mboxiterator.MboxIterator.initMboxIterator(MboxIterator.java:85)
>     at
> org.apache.james.mime4j.mboxiterator.MboxIterator.<init>(MboxIterator.java:75)
>     at
> org.apache.james.mime4j.mboxiterator.MboxIterator.<init>(MboxIterator.java:62)
>     at
> org.apache.james.mime4j.mboxiterator.MboxIterator$Builder.build(MboxIterator.java:241)
>     at
> com.bitplan.clientutils.ThunderbirdMailArchiveImpl.getMailById(ThunderbirdMailArchiveImpl.java:386)
>     at
> com.bitplan.clientutils.ThunderbirdMailArchiveImpl.getMailById(ThunderbirdMailArchiveImpl.java:261)
>     at
> com.bitplan.clientutils.rest.TestMailAccess.testMailById(TestMailAccess.java:77)
>  
> By the way - there is a typo in the above error message "vaild" should
> be "valid".
> 
> The error is something I'd like to fix or work-around.
> 
> I have two big user accounts with several hundred mailbox files and some
> 300.000 mails from the last 15 years which I'd like
> to use as a testcase against which to run the mime4j implementation.
> 
> Would you please supply me with some pointers where I get the necessary
> source code and how i could supply patches and
> testcases for the project?
> 
> Also it would be good to know whether others would be interested in the
> Thunderbird Mailbox reading capability.
> 
> 
> Cheers
>   Wolfgang
> 

Wolfgang

I am not really involved in development of MboxIterator, but generally
you should be able to find sources in the ASF source repository [1] or
at github [2] (read-only copy of the official repo).

Once you have a change-set which you would like incorporated in the
official code tree, you should raise a change request in JIRA [3] and
attach the patch to it or reference a pull request at github.

Oleg

[1] http://svn.apache.org/repos/asf/james/mime4j/trunk/
[2] https://github.com/apache/james-mime4j/tree/trunk
[3] https://issues.apache.org/jira/browse/MIME4J


Mime
View raw message