I need to identify if an attachment is signature image of the sender and ignore it as I want to skip that kind of attachments, but I'm not able to identify if that particular attachment is signature image.
Or can a user add a custom property while adding the signature image, so I can look for that property in the program?
if (emailMessage.getHasAttachments() || emailMessage.getAttachments().getItems().size() > 0) {
//get all the attachments
AttachmentCollection attachmentsCol = emailMessage.getAttachments();
log.info("File Count: " + attachmentsCol.getCount());
Attachment attachment = attachmentsCol.getPropertyAtIndex(i);
//log.debug("Starting to process attachment "+ attachment.getName());
//do we need to skip this attachment
FileAttachment fileAttachment = (FileAttachment) attachment;
// if we don't call this, the Content property may be null.
fileAttachment.load();
booelan isSignatureImage = fileAttachment.isContactPhoto(); // this is false
}
}