metaData.setStoreProtocol(AnnotationElement.asOptionalString(annotationInstance, "storeProtocol"));
metaData.setHost(AnnotationElement.asOptionalString(annotationInstance, "host"));
metaData.setUser(AnnotationElement.asOptionalString(annotationInstance, "user"));
metaData.setPassword(AnnotationElement.asOptionalString(annotationInstance, "password"));
metaData.setFrom(AnnotationElement.asOptionalString(annotationInstance, "from"));
final PropertiesMetaData properties = new PropertiesMetaData();
for (String fullProp : AnnotationElement.asOptionalStringArray(annotationInstance, AnnotationElement.PROPERTIES)) {
PropertyMetaData p = new PropertyMetaData();
String[] prop = fullProp.split("=", 2);
p.setName(prop[0]);
p.setValue(prop[1]);
properties.add(p);
}
metaData.setProperties(properties);
final SessionProvider provider = SessionProviderFactory.create(metaData);
return new MailSessionDefinitionInjectionSource(metaData.getName(), provider);
}