Skip to content

WIP: GSoC21. Email Server Integration

Flynn requested to merge fliu/freedombox:gsoc-email into master

Lightweight email service that runs on a single-board computer. Helps: #56

Work Highlights:

  • Provides 3 modes of SMTP connection
  • Deploys "intermediate" level TLS parameters (2721e3cc)
  • Auto-configuration of email clients (a26fd9c4)
    • Can be used by Thunderbird
  • Supports mapping email aliases to the uidNumber (d5a1b8eb)
    • In case of a username change, the user keeps their aliases
  • Dedicated outbound filtering service (771d7857)
    • Enhances header privacy for all submitted mails
  • Carefully tuned thread- and file-based locking for more robust IPC

Mitigations:

  • Memory usage: Container uses ~1 GB of memory at idle
  • Backscatter: non-delivery notifications/reports
    • 6c79e1c5 Mails to system users are rejected at the connection level (previously they were queued). The commit does not completely eliminate NDR.
  • Permission and concurrency issues with embedded databases
    • 6c79e1c5 uses rename(2) to atomically replace Berkeley DB files

Workarounds:

  • There is a packaging bug in imap-sieve that prevents the extension from loading
    • Used sieve to sort emails (no spam learning)
  • In Django views, request.user.id does not equal the Unix uid (Django database uid != LDAP database uidNumber)
    • Look up Unix uid at request time
  • Postfix table grammar is context-free, not regular
    • Reject strings we do not understand
  • Users added via web UI do not have a home directory (tracked by #2093 (closed))
    • 95c3d37d Implemented a web UI for creating the missing home directory

Known Issues:

  • "From" header spoofing by authenticated users possible
    • Implement a policy server
  • non_admin_view bug (tracked by #2094)
  • Proposed mail group clashes with a Debian system group
  • Edge case, deadlock detection: fcntl.lockf is blocking by default.
    • Use fcntl.LOCK_NB and busy waiting?
Edited by Flynn

Merge request reports

Loading