Contacts from sent mail
sent_contact_ruleRead or change the user's rule for who becomes a contact from the mail they have sent, preview how many existing contacts a rule would remove, and remove them. The rule has three parts, any of which lets an address in: min_messages (mailed at least this many times, 0 turns it off), recent_months (mailed within this many months, 0 turns it off), and count_direct_to (ever sent to directly in To rather than Cc or Bcc). 'Stop adding people I only cc'd' is min_messages 0, recent_months 0, count_direct_to true. action: read shows the rule and the count; set saves the fields passed and applies from the next sync; preview counts what a rule would remove without saving it (pass the fields to try, or none for the saved rule); cleanup removes the contacts the saved rule leaves out. Before cleanup, tell the user the would_remove count and ask them to confirm; call cleanup with confirm true only after they say yes. Removed contacts are soft-deleted like any deleted contact, not erased. Point them to settings_url to see or change the rule themselves.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | ||
| confirm | No | cleanup only: true once the user has agreed to the removal. | |
| min_messages | No | ||
| recent_months | No | ||
| count_direct_to | No |