librelist archives

« back to archive

Strange problem with MailCore2

Strange problem with MailCore2

Eric Gorr
2013-06-20 @ 20:19
I've got a sample project at github demonstrating the problem...

MailCore is having trouble parsing the message

in the sample project.

The test code to read the message is found in AppDelegate.m

and is

    MCOMessageParser* parser = [MCOMessageParser 
    MCOAbstractPart* mainPart = [parser mainPart];
    MCOAbstractMessage* message = [mainPart message];
    MCOMessageHeader* header = [message header];
    NSLog( @"%@", [header subject] );
    NSLog( @"%u", [mainPart partType] );
    NSArray* parts = [(MCOAbstractMultipart*)mainPart parts];
    NSLog( @"%@", parts );

The message clearly has two parts, but MailCore is reporting zero parts. 
With other messages, this works without any trouble.

The only problem I have noticed with the message is that it does not 
contain the final boundary at the end. Assuming this is the problem, is 
there some standard way of dealing with such issues? If this is a bug, I 
can file an official one and am willing to spend some time fixing it, but 
would need some guidance in understanding the code.

I obtained this message via Apple Mail and connecting to my gmail account.