gomail
Go email sorter to help me keep on top of my emails.
I currently have my emails in Microsoft 365. So I am using the Microsoft Graph API to update and query my emails.
I have added the name to the list of approved apps that can access my account.
Docker file
I originally deployed this my Synology NAS. But I have since moved it to Gokrazy on a Raspberry Pi 5.
Gokrazy build
I have added a top level program to run and added tags to the build.
in the directory ~/gokrazy/hello just run gok update and it should rebuild.
In the cmd directory there is a gomail.yaml file that needs to be updated.
gomail.yaml Configuration
The gomail.yaml file defines email sorting rules. Emails are processed in priority order: delete, maybe, news, briefly. The first matching rule wins.
delete
List of sender address patterns. Matching emails are deleted immediately.
delete:
- spam@example.com
maybe
List of sender address patterns. Matching emails are moved to the News folder immediately (no delay).
maybe:
- messages-noreply@linkedin.com
- donotreply@amazon.com
news
Sender-based rules with a delay. Emails from matching senders stay in the inbox for delay_days before being moved to News. This lets you see them briefly before they're filed away.
news:
- sender: ebay@ebay.co.uk
delay_days: 2
- sender: publications@understandingwar.org
delay_days: 1
briefly
Rules with a delay. Emails matching the rule stay in the inbox for delay_days before being moved to News. Each rule can match on subject, sender, or both (all specified fields must match). Matching is case-insensitive partial (substring) match.
briefly:
- subject: "ISW Publications"
delay_days: 1
- sender: "notifications@example.com"
delay_days: 2
- subject: "Weekly Digest"
sender: "news@example.com"
delay_days: 1
news_retention_days
Emails in the News folder older than this many days are deleted automatically. Set to 0 to disable.
news_retention_days: 14
Learned senders
Emails moved manually to the AddToNews folder have their senders auto-learned and saved to gomail-learned.yaml. Learned senders are treated like maybe rules on subsequent runs.
Links