Patterns

Patterns trigger automatic actions when emails match certain criteria. Great for handling recurring noise.

Pattern Structure

{
"id": "billing-receipts",
"name": "Billing Receipts",
"match_sender": "(stripe|paypal|aws)@",
"match_subject": "(receipt|payment|invoice)",
"match_body": null,
"account_id": null,
"suggested_action": "move:billing",
"suggested_cc": null,
"priority": "low",
"auto_apply": true,
"tags": ["billing", "noise"]
}

Field Reference

FieldRequiredDescription
idYesUnique identifier for the pattern
nameYesHuman-readable description
match_senderNoRegex pattern for From address
match_subjectNoRegex pattern for Subject line
match_bodyNoRegex pattern for email body
match_allNoIf true, ALL conditions must match. If false, ANY triggers. Default: false
account_idNoLimit to specific account (null = all)
suggested_actionYesWhat to do when matched
suggested_ccNoEmail addresses to CC
priorityNoPriority level: high, normal, low
auto_applyYesApply automatically or suggest only
tagsNoTags for categorization

Matching Rules

Patterns use regex. All matches are case-insensitive by default. At least one match field (match_sender, match_subject, or match_body) should be specified.

Available Actions

ActionDescription
move:folderMove to specified folder
archiveArchive the email
use_template:nameSuggest a template response
delegate:emailCC someone
priority:highMark as high priority

Auto Apply

When auto_apply is true, the action happens automatically in Phase 3. When false, the AI suggests the action but waits for approval.

Be Careful
Only set auto_apply: true for patterns you're confident about. Start with false and move to true after the pattern proves reliable.

Example Patterns

Billing Noise

{
"id": "billing-receipts",
"name": "Billing Receipts",
"match_sender": "(stripe|paypal|aws|runware|digitalocean)@",
"suggested_action": "move:billing",
"auto_apply": true,
"tags": ["billing", "noise"]
}

Newsletter Archive

{
"id": "newsletters",
"name": "Newsletters",
"match_sender": "(newsletter|digest|noreply)@",
"match_subject": "(weekly|digest|update)",
"suggested_action": "archive",
"auto_apply": true,
"tags": ["newsletter", "noise"]
}

Card Failure Alert

{
"id": "card-failure",
"name": "Card Failure",
"match_subject": "(failed|declined|expired|update.*card)",
"suggested_action": "priority:high",
"priority": "high",
"auto_apply": false,
"tags": ["urgent", "billing"]
}

Support Ticket Template

{
"id": "techdeals-ticket",
"name": "TechDeals Ticket",
"match_sender": "[email protected]",
"suggested_action": "use_template:techdeals-need-info",
"suggested_cc": ["[email protected]"],
"auto_apply": false,
"tags": ["support", "techdeals"]
}

File Location

~/.config/pontius/knowledge/patterns/patterns.json