if (field != null) {
// not sure if we really should reparse it. It maybe be better to check just for the right type.
// But this impl was easier in the first place
AddressList aList = LenientAddressBuilder.DEFAULT.parseAddressList(MimeUtil.unfold(f.getBody()));
for (int i = 0; i < aList.size(); i++) {
Address address = aList.get(i);
if (address instanceof org.apache.james.mime4j.dom.address.Mailbox) {
org.apache.james.mime4j.dom.address.Mailbox mailbox = (org.apache.james.mime4j.dom.address.Mailbox) address;
String value = AddressFormatter.DEFAULT.encode(mailbox).toUpperCase(Locale.ENGLISH);
doc.add(new Field(field, value, Store.NO, Index.ANALYZED));
if (i == 0) {