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: getTo() throws IllegarArgumentException
Date Fri, 12 Aug 2011 08:22:28 GMT
On Fri, 2011-08-12 at 02:24 +0100, Rustam Aliyev wrote:
> Hi,
> 
> After upgrading to 0.7 I'm getting following problem:
> 
> The message I'm trying to parse contain following to field:
>      To: "BiZ" <>
> 
> Using DOM parser I call mimeMessage.getTo() where mimeMessage is parsed 
> mimeMessage object and getting following:
> 
> java.lang.IllegalArgumentException: null
>      at 
> org.apache.james.mime4j.dom.address.Mailbox.<init>(Mailbox.java:59) ~[na:na]
>      at 
> org.apache.james.mime4j.field.address.LenientAddressBuilder.parseMailboxAddress(LenientAddressBuilder.java:139)

> ~[na:na]
>      at 
> org.apache.james.mime4j.field.address.LenientAddressBuilder.parseAddress(LenientAddressBuilder.java:264)

> ~[na:na]
>      at 
> org.apache.james.mime4j.field.address.LenientAddressBuilder.parseAddressList(LenientAddressBuilder.java:303)

> ~[na:na]
>      at 
> org.apache.james.mime4j.field.AddressListFieldLenientImpl.parse(AddressListFieldLenientImpl.java:71)

> ~[na:na]
>      at 
> org.apache.james.mime4j.field.AddressListFieldLenientImpl.getAddressList(AddressListFieldLenientImpl.java:51)

> ~[na:na]
>      at 
> org.apache.james.mime4j.message.AbstractMessage.getAddressList(AbstractMessage.java:470)

> ~[na:na]
>      at 
> org.apache.james.mime4j.message.AbstractMessage.getTo(AbstractMessage.java:239) 
> ~[na:na]
>      ...
> 
> According to getTo() description it should return AddressList or null in 
> case if To not present. Now, this is tricky case. But I would like to 
> get back whatever possible, i.e. AddressList with only name field. In 
> any case, it should not throw IAE.
> 
> Regards,
> Rustam.
> 

Rustam

Please raise a JIRA for this defect. 

Oleg


Mime
View raw message