Skip to content

Mail Archiver: new service - #324

Open
melbv wants to merge 10 commits into
tailscale-dev:mainfrom
melbv:add-mail-archiver
Open

melbv wants to merge 10 commits into
tailscale-dev:mainfrom
melbv:add-mail-archiver

Conversation

@melbv

@melbv melbv commented Jul 6, 2026 •

Copy link
Copy Markdown

Mail Archiver: new service

Mail Archiver: new service

Description

Addition of 'mail archiver' folder, compose.yml, .env and README files

Related Issues

  • None.

Verification

Started the stack with docker compose up -d. The tailscale container reports healthy, the app starts and connects to the database, and the web interface is reachable at https://mail-archiver..ts.net. Confirmed PostgreSQL no longer listens on the Tailscale IP (listen_addresses=localhost) and the first login forces a password change.

Checklist

  • I have performed a self-review of my code and followed the templates structure.
  • I have added verification that the stack works as expected.
  • I have updated necessary documentation (e.g. frontpage README.md ).
  • I have selected the correct label(s) for this PR.

Additional Context

  • None.

melbv and others added 6 commits July 6, 2026 16:49
- Remove the tag:container advertise flag; the sidecar failed to log in
  with "requested tags are invalid or not permitted" on tailnets without
  that tag.
- Run PostgreSQL in the sidecar's network namespace and connect over
  127.0.0.1, instead of a separate network the app could not reach.
- Use template naming (hostname, app-/db container names, serve.json,
  ${SERVICE}-data bind mounts) and template healthcheck settings.
- Replace the curl healthcheck, which always failed because the image
  ships no HTTP client, with a pgrep check on MailArchiver.dll.
- Pass TZ from .env and use it for the web interface time zone.
- Make the OAuth button label configurable instead of "PocketID SSO".
- Move .env comments onto their own lines and document required
  passwords.
- Rewrite the README per the template, with first-start notes, the
  OIDC redirect URI, and volume descriptions.
@jackspiering

Copy link
Copy Markdown
Collaborator

Thanks for adding Mail Archiver! I pushed two commits to this branch so the stack starts and matches the service template:

  • bce792a: removed --advertise-tags=tag:container (the sidecar could not log in without that tag), moved PostgreSQL into the sidecar's network namespace, applied the template naming and health checks, and rewrote the README.
  • 2271052: added Mail Archiver to the root README.md and documented the prerequisites.

Please pull these commits before you make further changes.

Before we can merge, please update the PR description to follow the pull request template:

  1. Change the title to Mail Archiver: new service.
  2. Fill in Verification with how you tested the stack, for example: the containers become healthy, the web interface opens through the Tailnet, you can log in, and you can archive a mailbox. Logs or screenshots are welcome.
  3. Tick a checklist item only when it is done. The root README.md entry was missing before.

See CONTRIBUTING.md for the full checklist.

@jackspiering

Copy link
Copy Markdown
Collaborator

Thanks for the work on Mail Archiver, and for the patience. I ran the stack from a copy on a test Tailnet. All containers became healthy, the web interface opens through Tailscale Serve, login works, an account can be created, and the data survives a recreate.

Before we can merge, please change the following:

  • Make APP_PW and DB_PW required with ${VAR:?Set VAR in .env} in compose.yaml. Start their .env comments with # Required: (CONTRIBUTING.md, step 2).
  • Add command: ["postgres", "-c", "listen_addresses=localhost"] to db. Without it, PostgreSQL listens on the Tailscale IP, so other Tailnet devices can reach port 5432. I tested this change, and the app and the database health check still work.
  • Rewrite the README with the template headings. Put the extra db container under "Deviations from the standard setup". Under "First run", say that the first login forces a password change.
  • Replace the ${SERVICE} placeholders in comments with "the service". Use the current template's header and ports comments.
  • Put the .env comments for DNS_SERVER and TZ on their own line.
  • Merge main into the branch and re-add the Mail Archiver row in the new root README.md format, in "Productivity and collaboration" between linkding and Mattermost.
  • Change the title to Mail Archiver: new service and fill in "Verification" in the description.

Not tested: IMAP and Microsoft 365 sync, and OIDC login, because I had no mail server, tenant, or identity provider.

@melbv

melbv commented Oct 13, 2026

Copy link
Copy Markdown
Author

Worked through above comments @jackspiering

@jackspiering

Copy link
Copy Markdown
Collaborator

Thanks @melbv, this is nearly there. I pulled the latest commit and tested the stack on a test Tailnet. All containers become healthy, PostgreSQL listens on localhost only, Serve works, login works (with the forced password change), and the data survives a recreate. The earlier review points are done.

A few things are left:

  • Fix the Markdown lint, which CI runs (CONTRIBUTING.md). Remove the extra blank line at README.md:110. Add a blank line before the list in services/mail-archiver/README.md:21.
  • Fix "Deviations from the standard setup" in the service README. It still contains a literal ${SERVICE}. The sentence "…localhost only.The db service…" is missing a space and repeats itself. Please write it once, for example: "The stack adds a db service (container app-mail-archiver-db) that runs PostgreSQL. Mail Archiver keeps its data in a database. The db service shares the network namespace of the sidecar, so Mail Archiver reaches it at 127.0.0.1, and PostgreSQL listens on localhost only."
  • Replace SERVICE documentation and SERVICE source code under "Links" with Mail Archiver documentation and Mail Archiver source code.
  • In "Before you start", say that only APP_PW and DB_PW are required and that Compose stops with an error until they are set. TS_AUTHKEY is only needed for the first start.
  • In compose.yaml, remove the ${…} placeholders from comments, as in the template: use # Application above the application service and "Binding the service port to the local network" in the ports comment.
  • In .env, start the comment above each required variable with # Required: and say what to set. Example: # Required: password of the first admin user. Generate it with: openssl rand -hex 16. Put it on its own line above APP_PW=, and do the same for DB_PW. Drop the #version=1.1 and #COMPOSE_PROJECT_NAME= lines, which the template no longer has.
  • Change the PR title to Mail Archiver: new service. Clean up the description (remove the repeated title and the stray heading) and make sure Verification only lists what you ran.

Not tested: IMAP and Microsoft 365 sync, mbox import, and OIDC login, because I had no mail server, tenant, or identity provider.

Would you like me to commit these README, compose.yaml and .env fixes to your branch, or do you prefer to apply them yourself?

@jackspiering jackspiering added the new service request to add a new service label Oct 13, 2026
@melbv melbv changed the title Add mail archiver Mail Archiver: new service Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new service request to add a new service

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants