Our corporate email signature, as many others do as well, has our company logo in in. When I add e-mail to Salesforce it adds that as an attachment to the task/email. The source of the e-mail can be inbound from a client or just using the send to salesforce address from Outlook. While this is small if it is one or two e-mails, some of our opportunities will have dozens if not hundreds of e-mails. This results in the attachments list becoming fairly large and having a very low signal to noise ratio.

Is there a way to have the attachments pruned out automatically or removed before being added at all?

I am using Salesforce for Outlook, Email to Salesforce, and Email to Case and all seem to have the same issue.

  • How are you adding the signature and logo?
    – Mike Chale
    Commented Aug 9, 2013 at 16:44
  • The attachments are either in the e-mail from Outlook that it adds, or in the inbound e-mail from customers. Commented Aug 10, 2013 at 21:18

3 Answers 3


Some email clients, unfortunately, will embed your signature's images/icons as attachments in the outgoing emails (MIME format). A proper web email client (e.g. gmail) will automatically host the images for you and then generate HTML markup for the signature that only references the hosted image, for example:

'-- Bill Lumberg <img src="/gmail/images/Initech.jpeg">' 

^^ then, you don't get all those garbage attachments. So, this is dependent on the email client of the sender.

If you're writing an Apex InboundEmailHandler, you can "kind of" detect the presence of these nasty embedded attachments by searching for a "cid:" (read: content id) in the email's HTML body. Unfortunately, last I checked, even the InboundEmailHandler does not provide the information necessary to determine exactly which attachments correspond to each of the embedded cid's (i.e. you can't differentiate between the "real" attachments and the embedded ones). What I ended up doing, in my InboundEmailHandler, was to check for the presence of "cid:" in the HTML body, and if detected then I apply a simple size-threshold filter (configurable) to all attachments matching an MIME image content-type (e.g. remove all things that look like images smaller than 8K).

Unfortunately, I'm not sure if you'll have any good options outside of an InboundEmailHandler -- or better yet, have users either send in emails via gmail or eliminate their gaudy signatures ;)

  • Hmmm something to look at. It still doesn't make it easy to remove all of the existing ones. Commented Aug 19, 2013 at 19:56

Had the same problem. We found names of the most flagrant ones and run a scheduled search and destroy on them.

Could be scheduled/batch apex, but we used informatica to be that much lazier. No code!


This app seems to be geared towards fixing this problem https://blog.internetcreations.com/2014/12/how-to-eliminate-email-signature-attachments-in-salesforce/

  • 1
    Have you used this app? If so, did it work as described?
    – Jagular
    Commented Jan 2, 2015 at 16:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .