Browser-based UI
Create and manage rules, accounts, and file shares from any browser. No CLI required.
Gmail + NAS automation
A self-hosted Go web service with a browser UI. Define rules, connect Gmail accounts, and let the scheduler handle the rest.
Create and manage rules, accounts, and file shares from any browser. No CLI required.
Visual query builder with inline validation warns about unknown operators or bad values as you type.
Subfolder templates use {year}, {month}, {sender}, and more.
Automatically convert saved PDFs to PNG images at 150 DPI using poppler-utils.
Connect several Gmail accounts and assign each rule to multiple accounts and shares simultaneously.
One container ships the Go backend, embedded SolidJS UI, SQLite database, and poppler.
The fastest way to run the service is with Docker Compose. Copy this into a docker-compose.yml:
services:
gmail-nas:
image: ghcr.io/pacorreia/export-gmail-attachments-to-nas:latest
ports:
- "8080:8080"
volumes:
- ./data:/data
environment:
SECRET_KEY: "change-me-to-a-random-string"
GOOGLE_CLIENT_ID: "your-client-id.apps.googleusercontent.com"
GOOGLE_CLIENT_SECRET: "your-client-secret"
# PORT defaults to 8080
# DATABASE_URL defaults to sqlite:///data/app.db
Then start it:
docker compose up -d
# Open http://localhost:8080 in your browser
On first run, open Settings → Accounts to connect a Gmail account via OAuth, then create your first rule under Rules.
The service uses OAuth 2.0 to access Gmail on behalf of each connected account. You need to create credentials in Google Cloud Console once.
https://mail.google.com/http://localhost:8080/oauth/callback (or your public URL)GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET environment variables (or update your docker-compose.yml)| Variable | Required | Default | Description |
|---|---|---|---|
SECRET_KEY | ✅ | — | Encryption key for OAuth tokens and SMB passwords (AES-256-GCM). Service will not start without it. |
GOOGLE_CLIENT_ID | ✅ | — | Google Cloud OAuth2 client ID |
GOOGLE_CLIENT_SECRET | ✅ | — | Google Cloud OAuth2 client secret |
DATABASE_URL | ❌ | sqlite:///data/app.db | Database connection string. Supports sqlite://, postgres://, sqlserver://. |
PORT | ❌ | 8080 | HTTP port the server listens on. |
OAUTH_REDIRECT_URL | ❌ | http://localhost:8080/oauth/callback | OAuth2 redirect URI — must match the Google Cloud console setting. |
Generate a strong random value: openssl rand -hex 32. Never reuse across environments.
OAuth tokens and SMB passwords are stored encrypted at rest with AES-256-GCM using your SECRET_KEY.
The service requests the https://mail.google.com/ scope, which is the minimum needed for reading and optionally deleting messages.
Limit SMB share permissions to a dedicated service account with write access only to the target folders.
Thanks to all the amazing people who have contributed to this project!