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
David McArthurDavid McArthur 

Flow to auto discard

We are receiving spam email through email-to-case. What is the best way to auto discard these cases and how do you do it in Salesforce? 
VinayVinay (Salesforce Developers) 
Hi David, 

Unfortunately, this is limitation in salesforce, kindly review limitation below.

https://ideas.salesforce.com/s/idea/a0B8W00000GdlbaUAB/spam-from-email-to-case

Check below workaround and see if that works for you.
https://www.infallibletechie.com/2021/11/spam-filter-in-salesforce-email-to-case.html#google_vignette

Please mark as Best Answer if above information was helpful.

Thanks,
Aaliyah MannAaliyah Mann
Email Filters: Set up email filters in Salesforce by navigating to Setup > Email-to-Case > Edit. Here, you can define rules to filter out emails from specific addresses or with certain keywords. Case Assignment Rules: Create rules to automatically assign potential spam cases to a specific queue or user for review, or set a specific status. Use Third-party Anti-spam Tools: Integrate Salesforce with an external anti-spam tool. These tools can filter emails before they're turned into cases. Regular Review: Regularly review the spam cases to adjust and refine your rules, ensuring legitimate cases aren't discarded.   https://www.telltims.net
Lexi KansLexi Kans
automatically discard spam email cases in Salesforce, you can create a custom field called "Spam Case" on the Case object. Then, develop an autolaunched flow that triggers whenever a new case is generated via email-to-case. Within the flow, include a Decision element that examines the incoming email's content to identify spam based on specific criteria like keywords or email addresses. If the email meets your spam criteria, mark the "Spam Case" field as True.
Next, add another Decision element after the spam check to determine the value of the "Spam Case" field. If it's True, employ an Update Records element to set the case status to "Closed" or an appropriate status indicating it's been discarded. Optionally, you can configure an email alert to notify designated users or teams whenever a spam case is detected and discarded, aiding in tracking such attempts.
https://scholarshipbasket.com/