* @throws SieveMailException
*/
public Address[] parseAddresses(final String headerName,
final Message message) throws SieveMailException {
try {
final SieveAddressBuilder builder = new SieveAddressBuilder();
for (Enumeration en = message.getAllHeaders(); en.hasMoreElements();) {
final Header header = (Header) en.nextElement();
final String name = header.getName();
if (name.trim().equalsIgnoreCase(headerName)) {
builder.addAddresses(header.getValue());
}
}
final Address[] results = builder.getAddresses();
return results;
} catch (MessagingException ex) {
throw new SieveMailException(ex);
} catch (org.apache.jsieve.parser.generated.address.ParseException ex) {