Automate Email Routing and Notifications
Three people can see the shared inbox, and each of them assumes one of the others has answered the customer. Two days later the customer writes again, politely furious. Nobody was lazy. The inbox simply had no concept of ownership, so every message belonged to everyone and therefore to no one.
If you run a support or operations mailbox, that is the problem worth solving first. Rules, filters and notifications are only tools for making sure each message has one owner, one deadline, and one place to go when it is stuck. This article walks through how to build that, what breaks, and how to keep your own outgoing mail from landing in spam.
Start with ownership, not rules
Before you write a single routing rule, answer four questions on paper.
- What kinds of mail arrive? Look at the last 200 messages and sort them into five to eight types, such as new order questions, billing, complaints, vendor mail, and automated notices.
- Who owns each type? One role per type, and a named person for each role this week. A role with two owners has none.
- What does done look like? A reply sent, a ticket closed, a hand-off accepted. Without a definition of done, nothing can be overdue.
- How fast is fast enough? Pick a target for the first reply for each type. Promise less than you can deliver and keep the promise.
Write the answers in a table. This table is your routing specification, and every rule you build later should be traceable to a row in it.
| Message type | Owner role | First reply target | Escalate to | Done when |
|---|---|---|---|---|
| New order question | Sales desk | 2 business hours | Operations lead | Customer confirms or order placed |
| Billing question | Accounts | 1 business day | Controller | Invoice corrected or explained |
| Complaint | Operations lead | 4 business hours | Owner | Customer acknowledges resolution |
| Vendor mail | Purchasing | 2 business days | Operations lead | Action taken or logged |
| Automated notice | No owner | None | Nobody | Filed automatically |
The targets above are examples, not recommendations. Choose yours from what your team can actually sustain.
How routing actually works
Mail routing is a sequence of checks applied to each incoming message. The common signals are the sender address or domain, the recipient alias (support@ versus billing@), words in the subject, keywords in the body, attachments, and headers added by other systems. Rules are evaluated in order, and the first match usually wins.
A few design points save grief later.
- Prefer aliases over keyword guessing. If customers can write to billing@ or orders@, the address itself is the most reliable routing signal you have. Keyword rules are a fallback.
- Put specific rules before general ones. A rule for a named key account should run before the rule that catches anything containing the word "invoice".
- Always have a catch-all. Mail that matches nothing goes to a triage owner, not into the void.
- Keep rules few and readable. If you need forty rules to run an inbox, the types are probably not well defined. Revisit your table.
- Version your rules. Keep a short log of what changed, when, and why. When the routing misbehaves on a Monday, you will want to know what changed on Friday.
Most shared-inbox tools, help-desk products and email platforms provide assignment rules. Check what you already pay for before buying something new. A rule engine you already own, used well, beats a new product used badly.
Clocks, SLAs and what happens at the deadline
A service level agreement, or SLA, is a promise about time, such as "first reply within two business hours". Internally it is simply a timer that starts when a message arrives and stops when the right event happens. Three decisions make timers useful.
- When does it start and stop? Starting at arrival is honest. Stopping at the first human reply, not the automatic acknowledgment, is also honest. Stopping on the auto-reply is a way of fooling yourself.
- What counts as business time? Define hours and holidays, including local holidays and the days after a storm when the office is closed. Pausing the clock while you wait on the customer is common, but write it down.
- What happens at 75 percent and at 100 percent? A nudge to the owner at 75 percent of the target, and an alert to the escalation contact at 100 percent, is a reasonable pattern. Escalation should land on a person who can change something, not on a distribution list.
Mail loops and how to avoid them
A mail loop happens when two automated systems keep replying to each other. Your auto-reply answers a vendor's auto-reply, which triggers yours again, and within minutes you have thousands of messages and a blocked sender reputation.
The defenses are simple and worth building in from day one.
- Never auto-reply to automated mail. Check for headers such as Auto-Submitted, Precedence set to bulk or list, and the empty return path that bounce messages use. If any are present, do not respond.
- Never auto-reply to yourself. Skip messages from your own domain addresses, and especially from your own routing system.
- Rate-limit replies per sender. One acknowledgment per sender per day is plenty.
- Set a hop limit. If your system adds a header each time it forwards a message, refuse to forward a message that already carries it several times.
- Test with a mailbox you control. Send an out-of-office message to your own inbox on purpose and watch what your rules do.
Forwarding rules deserve special caution. A rule that forwards everything to an external address can leak customer information, and a rule that forwards to a group that also contains the sender can start a loop. Review all forwarding rules on a schedule.
SPF, DKIM and DMARC in plain language
When your system sends notifications from your domain, receiving mail servers ask a reasonable question. Is this message really from you? Three standards answer it.
- SPF, short for Sender Policy Framework, is a list published in your DNS of the servers allowed to send mail for your domain. Think of it as a guest list at the door.
- DKIM, short for DomainKeys Identified Mail, adds a cryptographic signature to each message. The receiving server checks the signature against a public key in your DNS. It proves the message was not altered in transit and that someone with your key sent it. This is the wax seal.
- DMARC tells receivers what to do when SPF and DKIM checks fail to line up with the address people see in the From line, and where to send reports about it. It starts with a monitoring policy, then moves to quarantine, then to reject once you trust your setup.
Here is the catch for notification systems. Every service that sends mail as you, such as your help desk, your invoicing tool, your CRM and your website forms, needs to be included in SPF and needs its own DKIM key. Miss one and its messages will quietly fail checks and land in spam. SPF also has a limit of ten DNS lookups, and adding service after service is the usual way people exceed it.
A sensible sequence is to list every system that sends mail as your domain, publish SPF and DKIM for each, turn on DMARC in monitoring mode, read the reports for a few weeks, fix what is failing, and only then tighten the policy. These details change with providers, so follow each provider's current setup guide and test with a message to a mailbox at a different provider before you rely on it.
Notification fatigue is a design flaw
Every alert you add trains your team to ignore alerts. The test for any notification is whether the person who receives it can do something about it right now.
- Notify on change of state, not on every event. One message when a ticket becomes overdue is better than one every time someone comments.
- Batch the low-urgency items. A single morning summary replaces fifteen pings.
- Route by role, not by everyone. A billing alert that goes to the whole company teaches the whole company to mute the channel.
- Make urgency visible. Reserve the interruptive channel, such as a text or a phone push, for items with real deadlines. Everything else can wait in a digest.
- Prune quarterly. Look at which alerts people open and which they ignore. Delete the ignored ones.
- Include the next action. A notification that says "invoice 4481 is overdue, here is the link, you own it" gets handled. One that says "something changed" does not.
A worked example
This is a hypothetical scenario with invented numbers.
A small property management office has one inbox, info@, read by four people. About 120 messages arrive each weekday. The manager sorts a sample and finds roughly 35 are tenant maintenance requests, 20 are rent and billing questions, 15 are vendor invoices and quotes, 10 are leasing inquiries, and 40 are automated notices from software tools.
She builds four routing rules. Maintenance goes to the maintenance coordinator, billing to the accounts person, vendor mail to the purchasing contact, and leasing to the agent on duty. The 40 automated notices are filed into a folder with no notification at all. Anything that matches nothing goes to a triage owner who rotates weekly.
She sets first-reply targets of 2 business hours for maintenance and leasing and 1 business day for billing and vendors. A timer nudges the owner at 75 percent and alerts her at 100 percent.
Her team now has to look at 80 messages that need a human, not 120, and each has exactly one owner. A single morning digest replaces what used to be a stream of individual pings. In week two she reads the overdue report and learns that most breaches are maintenance requests arriving after 4 pm, so she adjusts the after-hours handoff rather than blaming anyone. The point of the example is the structure, not the figures.
Add a Puerto Rico detail. After a storm, when power and connectivity are uneven, the hand-off rule matters more than the routing rule. Decide in advance who covers the inbox if the primary owner is offline for three days, and make sure that person has access from a phone.
Ownership and review
Routing decays. People change roles, products change names, and new message types appear. Assign an owner to the routing itself, not just to the messages.
- Review the catch-all queue weekly. Each item is a missing rule or a missing type.
- Review the overdue list weekly. Each breach is a staffing, rule, or target problem.
- Review forwarding rules and delegated access quarterly, and remove access when people leave.
- Keep a short runbook that says where rules live, who can edit them, and how to turn them off in an emergency.
Questions for a vendor
- Can I assign by alias, sender, keyword and header, and in what order are rules evaluated?
- Does the SLA timer pause outside business hours, and can I define holidays?
- Which headers does the system check to avoid replying to automated mail?
- Which sending domains and DKIM keys will I need to set up for notifications?
- Can I export rules, message history and reports if I leave?
What to do on Monday morning
- Sort the last 200 messages into five to eight types.
- Fill in the routing table with an owner and a target for each type.
- Create a triage owner for anything that matches no rule.
- Check that your auto-replies ignore automated mail.
- List every system that sends email as your domain and confirm SPF and DKIM for each.
- Cut notifications down to those someone can act on today.
If you would rather not do the DNS and rules work alone, Ozcorp InfraOps helps small teams set up and maintain this kind of plumbing, and I am glad to look over a routing table or a DMARC report with you either way.
Osvaldo D. Rivera, PhD
Discuss your infrastructure requirements
Review the current service offer or schedule a conversation about the scope you need.
Stay in touch
Follow Ozcorp
Leave your details for occasional notes about new articles and Ozcorp updates.