class MailAttributesListToMimeHeaders extends GenericMailet {

    @Override
    public void init() throws MessagingException {
        String simpleMappings = getInitParameter("simplemapping");
        if (Strings.isNullOrEmpty(simpleMappings)) {
            throw new MessagingException("simplemapping is required");
        }

        attributeNameToHeader = MappingArgument
            .parse(simpleMappings)
            .entrySet()
            .stream()
            .collect(Guavate.toImmutableMap(
                    entry -> AttributeName.of(entry.getKey()),
                    entry -> entry.getValue()
            ));
    }

}