+ Start a Discussion
Mats ErikssonMats Eriksson 

Mail to case - Delete or just dropping unwanted mail

I have written a custom mail-to-case class for handling inbound mails to a custom mailaddress. These mails are meant for already existing cases. This class is working very well. However, some people have started using this address for communicating general stuff to us. Not good! At the moment, my class is always returning Success regardless if it fails or not. Any errors are being logged in a separate logging app. result.success = true; return result; That means as many mails fail they create un-necessary entries in my error log app. What is the proper way code wise to gracefully handle these mails? I ONLY want to process mails that have a case reference in the subject and/or body and preferably bounce those that don't. Failing that I'd like to forward these to another mailaddress. Lastly, if that is not possible, I'd like to quietly just drop those mail in the can so to speak. How to achieve this in a mail handler class? /Mats