gomail

command module
v0.8.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2026 License: MIT Imports: 5 Imported by: 0

README

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.

Documentation https://h3-gomail.statichost.page/
Source (Codeberg) https://codeberg.org/hum3/gomail
Mirror (GitHub) https://github.com/drummonds/gomail

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
gomail command
gomaild command
test01 command
test02 command
test03 command
test04 command
<ProgramSnippet>
<ProgramSnippet>
test05 command
<GraphHelperSnippet>
<GraphHelperSnippet>

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL