1
0
mirror of https://github.com/moparisthebest/k-9 synced 2025-01-12 06:08:25 -05:00
This commit is contained in:
Jesse Vincent 2011-01-19 21:33:23 +00:00
parent 8329a0287b
commit a234c39722
2 changed files with 24 additions and 15 deletions

View File

@ -131,8 +131,7 @@ public class Address
public static Address[] parse(String addressList) public static Address[] parse(String addressList)
{ {
ArrayList<Address> addresses = new ArrayList<Address>(); ArrayList<Address> addresses = new ArrayList<Address>();
if (addressList == null if (addressList == null && !"".equals(addressList))
&& !"".equals(addressList))
{ {
return EMPTY_ADDRESS_ARRAY; return EMPTY_ADDRESS_ARRAY;
} }
@ -148,7 +147,8 @@ public class Address
if (mailbox.getName() != null ) if (mailbox.getName() != null )
{ {
addresses.add(new Address(mailbox.getLocalPart() + "@" + mailbox.getDomain(), mailbox.getName())); addresses.add(new Address(mailbox.getLocalPart() + "@" + mailbox.getDomain(), mailbox.getName()));
} else }
else
{ {
addresses.add(new Address(mailbox.getLocalPart() + "@" + mailbox.getDomain())); addresses.add(new Address(mailbox.getLocalPart() + "@" + mailbox.getDomain()));
} }

View File

@ -78,9 +78,12 @@ public class MimeMessage extends Message
MimeStreamParser parser = new MimeStreamParser(); MimeStreamParser parser = new MimeStreamParser();
parser.setContentHandler(new MimeMessageBuilder()); parser.setContentHandler(new MimeMessageBuilder());
try { try
{
parser.parse(new EOLConvertingInputStream(in)); parser.parse(new EOLConvertingInputStream(in));
} catch (MimeException me) { }
catch (MimeException me)
{
throw new Error(me); throw new Error(me);
} }
@ -576,12 +579,18 @@ public class MimeMessage extends Message
public void field(RawField field) public void field(RawField field)
{ {
try { expect(Part.class);
try
{
Field parsedField = DefaultFieldParser.parse(field.getRaw(), null); Field parsedField = DefaultFieldParser.parse(field.getRaw(), null);
((Part)stack.peek()).addHeader(parsedField.getName(), field.getBody().trim()); ((Part)stack.peek()).addHeader(parsedField.getName(), parsedField.getBody().trim());
} catch (MessagingException me) { }
catch (MessagingException me)
{
throw new Error(me); throw new Error(me);
} catch (MimeException me) { }
catch (MimeException me)
{
throw new Error(me); throw new Error(me);
} }
} }