Email Handler for Chatter
I wrote an application for the Chatter Developer Challenge, which you can install free from the AppExchange. It is called Email2Chatter, and it is an inbound email handler that automatically posts the subject and body text of email you send to your Chatter feed.
Email2Chatter supports email attachments, posting them to the Chatter feed for download, and also supports forwarded emails, which it attaches to the feed post as HTML or text.
Email2Chatter is available free of charge with complete source code under GPL license. Once you install the AppExchange package, you’ll need to configure the inbound email handler before you can send it email.
First, go to Setup => Develop => Email Services. Create an email service:
- Name: Chatter
- Apex Class: ChatterEmail
- Accept Attachments: All
- Accept Email From: [your organization's domain name]
- Truncate Oversize: [checked]
- Convert Text Attachments: [checked]
- Active: [checked]
Next, click New Email Address:
- Email Address: chatter
- Active: [checked]
- Context User: [name of system administrator]
- Accept Email From: [your organization's domain name]
Make note of the email address – that is where users can send or forward email and attachments to post to their Chatter feed.
Nice entry, Evan!
Are you authenticating based on the incoming email address because this can be easily spoof’d with any SMTP server that allows relaying.
The email only comes to Salesforce in the first place if sent to the “secret” email address provided to the service. But your point is well taken – if someone had the secret email address AND knew how to spoof the From address to match a user’s email in the Salesforce account, they would be able to post to Chatter and cause trouble.
As far as I know, the standard Email-to-Salesforce feature has the same vulnerability. But I am open to suggestions for improving security.
I just installed this and it is working for some users. However, for some reason, it is not working for myself and the other system administrator. The only thing that is different about us is that our usernames are different than our email addresses on our user record. However, our email addresses match that of the email address in the email service. We are both full System admins and developers within our org. Any idea why this might not be working. We have tried to change make our usernames and email address match the email address that we are sending from but it is not working. Weird.
The code looks at your user-account email address, which must match the address from which you are sending to Chatter. Your Salesforce username should have nothing to do with it.
Are you sending email to Salesforce from the same email address as your Salesforce user email? Is that email address allowed in the email service settings?
Is there any API available in APEX to deal with a ZIP attachment (presuming the business requirement was for the email service to burst the ZIP apart and post the contents to the chatter feed separately)?
Not that I know of.
great app!
I can’t seem to make the tag methods work when I email in.
i.e. #case
I am following the case but not the Owner.
I think you are looking for the app by the same name from Force.com Labs.
http://sites.force.com/appexchange/listingDetail?listingId=a0N30000003GKAOEA4
My version came out first, but does not support that feature.