I have a scenario where the signature images in the mail content alone needs to be removed. EWS converting all the email attachments with Content and assigning it CID which are embedded in mail.
Here in the email, lot of images are embedded but I need to figure out only the signature image in the email body and needs to remove it.
It does only have CID and nothing to figure out to identify the signature image. Is there any possibility?
Signature Image:
[cid:[email protected]]
Some Other Image:
[cid:[email protected]]
Are you asking if signatures have a CID which can programmatically be distinguished from other CIDs? The answer is no.
There may be hints in other MIME headers like a Content-Description: signature
or similar, but nothing is properly standardized. It's just another MIME part, and entirely optional.
There are weak heuristics you could use, like "if this is the last inline part, and/or it's identical to an inline body part in other messages from the same correspondent", but this is obviously brittle and error-prone.