function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
paul-lmipaul-lmi 

Using Apex code with Akismet Anti-Spam service

I was wondering if anyone else had an interest in this.  The use cases for it a pretty broad, but this could potentially be used to filter/classify inbound cases, leads, etc, and either flag them or take some other action.

Example, I've implemented an Apex Email service to direct emails to our support@ email addresses directly into SFDC.  This obviously has it's share of pros and cons, where the biggest con is the sheer barrage of spam that gets directed at these addresses.

So, I've also created an Apex class to interact with Akismet in order to classify spam better.  Our organization's needs require us to not auto-delete anything, but being able to sort by spam true/false is a significant improvement in conjunction with a mass-delete custom button.

I'd like to get a feel for how many people would be looking to do something similar before I just go and release something to AppExchange.

The only caveat I'll mention here is that due to limitations in Apex itself not allowing HTTP callouts as part of triggers, this class would have to be used in other custom Apex code that is not a trigger.
hemmhemm
Another option would be to have the email sent to gMail (or Google Apps) first, where the spam filter kicks in and then have a rule that auto forwards non-spam to your Apex email service.  Let gMail do the work instead of your code.  I haven't tried it, but it's worth a look.


Message Edited by hemm on 03-23-2008 10:16 AM
paul-lmipaul-lmi
i think that may work for some, but consider:

1. email has more latency prone than a triggered HTTP request, so it's less "real time" than some may be comfy with
2. you lose the original contact info when it is passed through gmail, vs. this method where the object never actually leaves salesforce.

I actually decided to go with Defensio.com instead.  Their API is a bit more user friendly, and I'd already written half an Apex class for it anyways.

I'll end up putting the code for it in the google code share at some point rather than AppExchange, as just about every implementation of this is going to be custom to some extent.

Sadly this is all because Salesforce's native email security option for Apex Email Services is WAY to strict, and I have no control over what happens when it rejects an email.
hemmhemm
Sounds like you know what you are doing.

On a side note, whenever I have a gMail filter forward emails, the header remains in tact.  It seems to be more of a redirected email than a forwarded email.
Sushant Arora 6Sushant Arora 6
Hi paul, Can you please provide the code 
plmcgrnplmcgrn
I’m the original poster, but note that this was 14 years ago…

I no longer have this code handy because Google retired that repository service ~6 years ago.  Even if I did, I doubt the target API’s still work the same way after such a long time.