No-double-email guard
Sending twice to the same person looks like spam and burns the lead. Guard every send.
Keep one permanent contact record
A small SQLite table works: email (primary key), profile, person, status (reserved, sent, unknown, do_not_contact), reserved_at, data (JSON). Never delete rows.
Before each run
- Import every recipient from the mailbox's Sent folder (To, Cc, Bcc) as
status: sent. Read every page. A mailbox error or partial page is NOT an empty result - stop. - Check the inbox for replies, opt-outs, and bounces. Mark opt-outs and bounces
do_not_contact. Do not cold-email anyone who already has a conversation going.
Before each send
- Normalize the email (lowercase; for Gmail remove dots and
+tags). - Block if the email, the LinkedIn profile, or the same person at the same company already exists.
- Enforce a daily send limit.
- Write the reservation to the database before the network call. A crash then cannot cause a second send.
- Send once. On confirmed success, set
status: sentwith the provider message ID. - On any error or unclear result, set
status: unknown, stop all sends for the run, and ask the user. Never retry automatically.