Skip to content

DietPi-Software | local mail cache #7979

@ndrew222

Description

@ndrew222

Creating a software request

Formal software information

  • Software title | Local IMAP Mail Archive (Dovecot + getmail6)
  • Short description | Fetch mail from a remote IMAP mailbox into local storage, then serve it to LAN clients via a local IMAP server (mail archive / offload store).
  • Official URL (if available) | Dovecot: https://www.dovecot.org/ | getmail6: https://getmail6.org/
  • (Official) install documentation | getmail6 documentation: https://getmail6.org/documentation.html

Are there similar/alternative software titles available with DietPi-Software?

  • No direct DietPi-Software entry currently provides a “remote IMAP fetch + local IMAP serve” mailstore/archive workflow (i.e., a local IMAP endpoint backed by fetched mail). The closest “DIY” approach is manual APT installation/configuration of components.

What makes your requested software better than the above solutions, if available?

  • This provides a missing turnkey workflow in DietPi: use DietPi as a LAN-only IMAP server that stores mail locally while fetching from a hosted mailbox, enabling mailbox quota offload (e.g., Mailbox.org’s small quota) and multi-device access without running a full internet-facing mail server.
  • getmail6 explicitly supports retrieving mail via IMAP4/IMAP4-over-SSL (as well as POP3 variants) with a focus on being secure and easy to configure, which suits DietPi’s target audience.

How can DietPi make the installation easier or compatible, than following the install instructions or do APT installation, if available?

  • DietPi can automate:
    • Installing and enabling the required services and dependencies (IMAP server + fetcher) in one step.
    • Creating a working default configuration that:
      • fetches mail from a remote IMAP account (e.g., imap.mailbox.org:993)
      • stores it locally in a standard on-disk layout (e.g., Maildir)
      • serves it to LAN clients over IMAP with TLS enabled by default (self-signed acceptable).
    • Providing a DietPi-style configuration prompt for:
      • remote IMAP host/user/password (Mailbox.org uses imap.mailbox.org:993 with SSL/TLS)
      • sync schedule (systemd timer)
      • LAN bind interface and firewall guidance.
  • This reduces the manual steps and makes the setup reproducible and maintainable, aligning with DietPi-Software’s purpose (“ready to run … automates installation and configuration”).

Can you provide the installation steps that you would suggest DietPi-Software to do?

  1. Install required packages (via APT):

    • IMAP server: dovecot-imapd (and dovecot core packages)
    • Fetcher: getmail6 (Python3-based mail retriever supporting IMAP4/IMAP4-over-SSL)
  2. Create a dedicated local mail storage path under DietPi userdata:

    • e.g. /mnt/dietpi_userdata/mail/
    • Configure Dovecot to use a Maildir-based storage location under that path (sane default for file-based mail storage). (Implementation detail; maintainer can decide exact layout.)
  3. Configure Dovecot to serve IMAP on LAN only:

    • Bind to LAN interface (or 0.0.0.0 but firewall to LAN subnet)
    • Enable TLS for IMAP (IMAPS 993 and/or STARTTLS 143), using a self-signed certificate by default.
    • Create a single-user auth method appropriate for DietPi (e.g., system user via PAM), keeping it lightweight.
  4. Configure getmail6 to fetch from the remote IMAP account into the local Maildir:

    • Provide a DietPi prompt to capture:
      • IMAP host, port, SSL/TLS (Mailbox.org is imap.mailbox.org:993 SSL/TLS)
      • username + password
    • Set it up so it can be run non-interactively by a systemd service.
  5. Create and enable a systemd timer/service for periodic fetching:

    • Default interval can be conservative (e.g., every 5–15 minutes), but can be adjusted in a config file.
    • Log via journald (standard DietPi approach) so users can inspect fetch errors with journalctl.
  6. Provide “offload/quota management” safety behavior:

    • Default: do not delete from remote automatically.
    • Provide an optional/manual mechanism to purge remote mail only after a local backup exists:
      • e.g., document a “manual cleanup” workflow, or an optional script that the user runs after confirming backups.
  7. Post-install output:

    • Print LAN IMAP settings for clients (host/IP, ports, TLS note)
    • Mention Mailbox.org IMAP server/port used (imap.mailbox.org:993 SSL/TLS) to reduce confusion.

Are you willing to help maintaining the software installation, e.g. in case of needed setup changes due to updates etc.?

  • Yes. I can help by testing updates, reporting issues, and validating the setup on my DietPi system (single-user, LAN-only, Mailbox.org source mailbox, multiple devices).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions