Files
emailwiz/docs/UPSTREAM-REVIEW.md
T

5.9 KiB
Raw Blame History

Review of upstream emailwiz against Debian 13

Upstream: https://github.com/LukeSmithxyz/emailwiz, HEAD aefc7a88f95a049a7f6a1adb4050633b69869bc6 (2026-10-17, "Fix bash-only syntax in adddomain.sh"). 218 commits. Before that, the last functional change was in 2025-05. Upstream still writes Dovecot 2.3 syntax.

"Verified" means reproduced in a Debian 13.7 container (tests/Containerfile) or observed on a real server installed with upstream emailwiz. "Static" means found by reading the code.

Blocking on Debian 13

# Problem Evidence This fork
U1 Dovecot 2.4 rejects the generated dovecot.conf. Missing dovecot_config_version (fatal at line 1), then ssl_cert/ssl_key/ssl_dh/ssl_prefer_server_ciphers, mail_location, %n, protocols = $protocols, mail_plugins = $mail_plugins sieve, pop3_uidl_format %08Xu%08Xv, plugin { sieve… } are all removed or renamed verified: doveconf: Fatal: … The first setting must be dovecot_config_version, then ssl_cert: Unknown setting 2.4 template validated with doveconf -c before install
U2 Exits unless the domain has an AAAA record, after already purging/reinstalling packages and stopping services static (l.22–61) IPv6 optional; AAAA/SPF ip6 only when the host has global IPv6
U3 service spamassassin … / /etc/default/spamassassin path; Debian 13 has only spamd.service and spamassassin-maintenance.timer; CRON= is gone verified: no spamassassin.service; /etc/default/spamd has no CRON manages spamd only
U4 netstat (net-tools) used to detect the web server; not installed on Debian 13 verified: no netstat not needed (certbot is optional and webserver-agnostic)

Destructive or unsafe behaviour

# Problem This fork
U5 apt-get purge ?config-files -y $install_packages purges the mail packages' configs on every run (the pattern also matches the explicit package list), after systemctl stop postfix dovecot: mail is down for the entire run and all config is lost never purges; services keep running; reload only what changed
U6 mv dovecot.conf dovecot.backup.conf: second run overwrites the only backup with emailwiz's own file timestamped, checksummed backups in /var/backups/emailwiz
U7 sed -i '/^\s*-o/d;/^\s*submission/d;/^\s*smtp/d' master.cf deletes every -o line of every service, then appends; the spamassassin service is appended again each run postconf -M/-P per service; stale overrides removed deterministically
U8 >> header_checks, >> pam.d/dovecot, >> opendkim.conf, >> cli.ini: duplicate lines on rerun rendered files, compared before install
U9 appends auth required pam_unix.so nullok to /etc/pam.d/dovecot: empty passwords permitted for IMAP/SMTP not done; migrate-upstream --fix-pam removes it
U10 opendkim-genkey on every run replaces the DKIM key (the published DNS key then no longer matches, so DMARC p=reject drops your mail) key generated only if missing
U11 useradd vmail + chown -R vmail:vmail /var/lib/dovecot changes ownership of Dovecot's state directory to an unused account not done
U12 sed -i … /etc/fail2ban/jail.conf edits a package conffile (Debian 13 already sets backend = systemd in defaults-debian.conf) jail.d/emailwiz.local
U13 ufw allow for 80 993 465 25 587 110 995 TCP and UDP, both families, unconditionally firewall left to the admin (documented)

Functional and security defects

# Problem Seen on a real install This fork
U14 header_checks removes Received: from all mail, including inbound, so SpamAssassin cannot score the relay path yes smtp_header_checks: outbound only
U15 port 465 (smtps) has no smtpd_client_restrictions: unauthenticated clients can deliver to local users bypassing SpamAssassin (content_filter is on :25 only) config yes; behaviour reproduced (tests) 465/587 require SASL
U16 smtpd_sasl_auth_enable = yes globally: AUTH offered on the MX port 25 yes AUTH only on 587/465
U17 smtp_tls_CAfile = $certdir/cert.pem: the server's own leaf cert used as the CA bundle for outbound TLS n/a (that host used the system bundle) system CA bundle
U18 milter inet:localhost:12301: localhost resolves to ::1 first while OpenDKIM binds 127.0.0.1 only yes (getent ahosts localhost) inet:127.0.0.1:12301 on both sides
U19 /lib/opendkim/opendkim.service.generate + ExecStart override duplicates/overrides Socket from opendkim.conf yes override retired; socket set in opendkim.conf only
U20 login map escapes only the first . of the domain (sed 's/\./\\\./') – all dots escaped; user+tag@ allowed
U21 fail2ban [sieve] jail enabled though managesieve isn't installed; with the systemd backend it has no journal match yes not enabled
U22 certbot deploy-hook written into cli.ini (global) with grep -q against an unanchored domain; HTTP-01 via --register-unsafely-without-email – per-hook script in renewal-hooks/deploy, exact domain match
U23 4096-bit self-signed cert valid for 100 years as a code path – removed
U24 no set -e; every step prints "...done" regardless of result – set -eu, explicit validation, exit codes
U25 /etc/cron.weekly/postmaster-clean deletes files matching *.mail* older than 30 d: matches only when the hostname contains "mail" – not installed (postmaster is aliased to a real user)

Kept from upstream (deliberately)

Postfix + Dovecot + OpenDKIM + SpamAssassin, system users with PAM, Maildir at ~/Mail with LAYOUT=fs folder names, Junk autoexpunge, the default Sieve spam rule, reject_sender_login_mismatch, and the DKIM path /etc/postfix/dkim/<domain>/<selector>.private. Existing emailwiz installs therefore migrate without touching mail or DNS.