# How does Email-to-Case process incoming customer email messages to generate and update support cases?

**Topic:** Admin · **Difficulty:** Medium · **Tags:** Admin, Case Management, Email-to-Case

Read it on the site: https://www.forcechallenges.com/interview-questions/how-does-email-to-case-process-incoming-customer-email-messages-to-generate-and-update-support-cases

## Answer

**Basics:** Support teams receive mail at addresses like support@company.com. Email-to-Case creates a case for each new email, stores the message on the case, and attaches follow-up replies to the same case so agents work from Salesforce.

**How it works:**
1. Setup > Email-to-Case > Enable (choose On-Demand Email-to-Case).
2. Create a Routing Address: the customer-facing address, case origin, priority, owner (queue or assignment rule) and auto-response.
3. Salesforce generates a unique Email Services Address; verify the routing address by clicking the link in the verification email.
4. Set up forwarding from the corporate mailbox to the Salesforce-generated address.
5. Incoming mail creates a Case and an `EmailMessage`, matches the sender to a Contact by email, and applies assignment and auto-response rules.
6. Replies include a Thread ID (or Case Thread ID/Reference ID) in the subject or body, so later emails are attached to the same case. Enable Case Thread ID settings in Support Settings.

**Advanced / deep dive:** There are two flavors: On-Demand Email-to-Case (hosted by Salesforce, recommended) and Standard Email-to-Case (requires an agent installed behind your firewall; legacy and being phased out; verify current status). Email size and daily volume limits exist (including limits per user license and attachment size caps), so verify current figures for your edition. Contact matching: if no contact matches, case is created without a contact (optionally with Web email); multiple matches can create ambiguity. Threading can be by Thread ID or by Reference headers when Enhanced Email and "Email threading behavior" settings are enabled. Lightning Email Experience, Case Feed and Email Templates support replies from agents. Use Email-to-Case with Omni-Channel and Assignment Rules for routing; use Spam handling and Email Deliverability settings (SPF, DKIM, DMARC) so replies and auto-responses are delivered. Be aware that email-to-case triggers Apex triggers and flows on Case and EmailMessage, so automation must be bulk safe and not loop.

**Code / config example:**
```
Setup > Email-to-Case
  [x] Enable Email-to-Case   [x] Enable On-Demand Email-to-Case
Routing Address: support@company.com
  Case Origin: Email   Priority: Medium   Owner: Support Queue
  Create Task from Email: No
  Auto-response rule: Default Case Auto-Response
Forward mailbox rule: support@company.com -> support.xyz123@2x4k.in.salesforce.com
```

**Hidden gotchas & must-remember points:**
- The routing address must be verified before use.
- Without a Thread ID in the subject or body, replies create new cases.
- Attachments and email size are capped; oversized emails are rejected or truncated.
- Auto-response loops with other auto-responders can create floods; use rules and filters.
- Contact matching depends on the From email; shared mailboxes cause misassignment.
- Triggers on EmailMessage run on inbound messages, so keep them light.

**Best practice:** Use On-Demand Email-to-Case with Omni-Channel, enable thread IDs, and lock down deliverability settings.

---
Source: ForceChallenges · last updated 2026-11-02
