KFC MAIL — OPERATION AND MAINTENANCE
Installed 1 November 2026

Webmail: https://mail.kfc.network/
Registration: https://mail.kfc.network/register
Invitations (admins only): https://mail.kfc.network/settings?section=invitations
Users and groups: https://mail.kfc.network/settings?section=users
Email all users: https://mail.kfc.network/settings?section=announcements
Password help: https://mail.kfc.network/password-help
Password-help requests (admins): https://mail.kfc.network/settings?section=password-requests
Mailcow admin: https://mail.kfc.network/admin/ (shortcut: /mailcow)
Existing SOGo: https://mail.kfc.network/SOGo/
About and source download: https://mail.kfc.network/about

Sign in with the full mailbox email address and its mailcow password.
The mailcow administrator login belongs to /admin/, not the webmail login.
The initial KFC Mail administrator is jamie@kfc.network, as requested.

ADMINISTRATION AND PASSWORD HELP
The avatar menu's Administration entry opens Users and permission groups.
Settings has a separate Administration navigation group containing Users and
groups, Invitations, Password-help requests and Email all users. These are
visible and accessible only to administrators, separate from personal Access.
The user directory renders 25 rows by default (50/100 selectable). Email-prefix
search and next/previous cursors run in Mailcow's database against the mailbox
username primary key, with a hard 100-row page limit. It does not fetch every
mailbox, every app user, recovery requests or password-reset forms for that list.
Membership lookups are restricted to the displayed mailboxes. Manage opens one
mailbox's form and returns to its search/page context after changes.
EXPLAIN checks confirmed primary-key use for first page, cursor page, prefix
search and single-mailbox lookup. This removes unbounded directory reads; the
whole Mailcow installation has not been benchmarked for millions of mailboxes.
Bulk announcement delivery and infrastructure capacity need separate sizing
and load tests for volumes of that scale.
The Administrators group is the existing KFC Mail ROLE_ADMIN permission.
Admins can update another mailbox's name, disable/reactivate it, change its
group, or reset its actual mailcow password. The target's browser sessions and
remembered devices are invalidated; encrypted mail credentials are refreshed.
Use your own Profile/Security settings for your account. Self-demotion/disable
through this panel is refused. New mailbox users must sign in once before they
can join Administrators. Use invitations to create new mailbox users.
Removing admin membership revokes integration-owned domain send-as grants.
Mailcow's own administrator accounts remain separate at /admin/.

Forgot password? now opens a real help-request form. It validates email syntax,
checks the active mailbox exists, and queues a notification from
support@kfc.network to every active KFC Mail Administrator. The public response
does not disclose whether a mailbox exists. Requests have CSRF protection,
a 3/hour/IP limit and a 24-hour duplicate limit per mailbox. An optional contact
address and user-supplied information are included. No password changes happen
automatically: verify the person independently, reset through Users if appropriate,
and mark the request resolved. The sender address does not create a support inbox.
Requests and announcement submission records are private root-only data in
/var/lib/plmail-registration/administration.json; include it in backups.

Email all users creates a plain-text announcement from KFC Mail Support
<support@kfc.network> to active @kfc.network mailboxes. Review the message and
recipient count before the separate Send announcement action. Addresses are
hidden from recipients. A changed recipient inventory requires another review;
submission nonces prevent replay. The announcement is queued through Mailcow's
local Postfix, retaining its existing relay configuration. No announcement was
sent to real users during installation or security checks.
Hosted-mailbox recipients are delivered locally by Postfix to Dovecot over LMTP
on port 24; they bypass the external/AWS relay. A real support-message test and
its Postfix queue log confirmed this local path. Mailbox existence validation
uses the local Mailcow database, with no AWS validation API calls.

SENDER SECURITY
Normal KFC Mail users can send only using their managed mailbox identity.
Trusted Administrators may use alternate addresses in active hosted domains;
external domains are refused. The composer, backend form and SMTP sender ACL
all enforce this. Direct requests cannot bypass the hidden UI controls.
External SMTP submission additionally requires exactly one visible From address,
matching the approved SMTP MAIL FROM address. This closes the separate SMTP
header-spoofing bypass found during verification; it also rejects duplicate From
headers and authenticated null-envelope attempts. Legitimate aliases must be
selected as both From and the envelope sender. Incoming unauthenticated email
and local system notifications are outside that authenticated-submission rule.
The rule is /opt/mailcow-dockerized/data/conf/rspamd/plugins.d/kfc_sender_guard.lua,
enabled by kfc_sender_guard {} in rspamd.conf.local. Installation/upgrades ensure
the rule is present, validate config, and restart Rspamd only when it changes.
Postfix currently uses milter_default_action=tempfail, so filter outages defer
mail rather than accepting unchecked submission. Keep this setting.
This is a focused implementation/security check, not a comprehensive penetration
test or a guarantee against every possible vulnerability.

ADMIN INVITATIONS
Open the avatar menu → Invitations, or Settings → Invitations.
Choose an expiry and click Create invite code. Copy the code immediately;
it is shown once. Give it to the recipient with the registration URL.
The page lists code status and expiry and can revoke unused invitations.
Each code creates one 1 GB mailbox. Registration offers a domain selector populated
from active primary domains in mailcow; kfc.network is the initial default.
Disabled or unknown domains are refused on submission. Used codes cannot be reused.
Registration rejects existing mailboxes, existing aliases, reserved names,
invalid/expired/revoked codes, weak passwords and mismatched confirmation.
A rejected address does not consume a valid invitation.
New users create their actual mailcow mailbox; their first login connects it
in KFC Mail automatically. No second password or manual connection is needed.
For emergency CLI administration, run as root from /opt/plmail:
  python3 deploy/mailcow/registration_broker.py invite --days 7
  python3 deploy/mailcow/registration_broker.py list
  python3 deploy/mailcow/registration_broker.py revoke --code THE_CODE
Codes are stored as hashes in /var/lib/plmail-registration/invites.json,
not in the application database or source archive. Keep this directory private.

MANAGED SETTINGS
KFC Mail has one active mailbox per mailcow user. The UI and backend both
block adding, reconnecting, deleting, disabling or replacing that connection,
adding local sending aliases, changing its server credentials, and rerunning
setup. The sidebar shows folders instead of a redundant Accounts section.
Existing extra account data is retained but disabled on the next login.
Password changes in Settings → Security authenticate the current password,
change it in mailcow, refresh encrypted IMAP/SMTP credentials, clear Dovecot's
password cache, reconnect mail clients, and invalidate other KFC Mail browser
sessions and remembered devices. The current browser session remains usable.
Profile display-name changes update mailcow and the outgoing sender name.
External password/display-name changes are picked up on the next KFC Mail login.
Mailcow UI 2FA is separate from mailbox IMAP authentication. KFC Mail's own
2FA, encryption passphrase, and app-access tokens remain independent features.
A disabled mailcow mailbox cannot sign in. Existing KFC Mail sessions follow
normal session lifetimes unless a password change through KFC Mail revokes them.
Mailcow receiving aliases still route mail normally. Registration cannot claim
an address belonging to an existing mailbox or alias.
Trusted KFC Mail administrators can type a From address in the composer, limited
to active hosted domains granted by mailcow. A new message defaults to their main
mailbox. Their main address uses their profile name; alternate addresses default
to a name derived from the local part (jeff -> Jeff, noreply -> No Reply).
The adjacent Name field can override the display name for that message, including
saved drafts and scheduled messages. Normal users cannot use this override.
This feature does not create receiving aliases or new mailboxes.
Sender permissions are reconciled on login, or explicitly as root:
  docker compose -f /opt/plmail/compose.mailcow.yaml exec -T php php bin/console app:mailcow:sender-access EMAIL_ADDRESS
Integration-owned domain grants are tracked separately from manual sender ACLs.
Removing the KFC Mail admin role blocks new arbitrary From submissions immediately;
the next login or command also removes integration-owned mailcow sender grants.
Appearance, signatures, templates, contacts, calendars, categories, labels,
filters, notifications and other client preferences remain available.
Webmail app-access tokens are for KFC Mail JMAP/CalDAV, not SMTP/IMAP passwords.
Filters and local client preferences are not mailcow server configuration.
Dusk is the default for new users and fresh login/registration pages. Existing
user theme choices are preserved. The reading pane uses the selected theme.
The KFC bucket logo is fixed for all accounts and anonymous pages. The upstream
logo picker, logo colour options and custom-logo upload/removal are unavailable.
The public app and modified source remain AGPL-3.0; source is offered in About.

SERVER LAYOUT
SSH: movinggun@10.0.2.160, then su - for root operations.
The account was not in sudoers during inspection; SSH/sudo policy was unchanged.
Working fork: /opt/plmail, branch mailcow
Local bare Git origin: /opt/plmail.git; no GitHub fork has been published.
Upstream: https://github.com/karatektus/pl_mail.git
Mailcow: /opt/mailcow-dockerized
  docker compose -f /opt/plmail/compose.mailcow.yaml ps
  docker compose -f /opt/plmail/compose.mailcow.yaml logs --tail 100 php worker
  systemctl status plmail-registration
The private broker listens only on a Unix socket mounted into the web container.
It verifies mailbox passwords before profile/password changes and checks the
KFC Mail admin role before invite operations. Mailcow database credentials and
a general-purpose mailcow admin API key are not shared with the webmail app.

MAIL CLIENTS / TLS
Server: mail.kfc.network; IMAP: 993 SSL/TLS; SMTP: 587 STARTTLS + authentication.
Use the full mailbox email address as username. The existing relay is preserved.
LAN TLS chain/hostname verification passed on SMTP 25, 465, 587 and IMAP 993.
Public-hostname checks passed on 25, 587 and 993. Public 465 was refused upstream
of this server; 465 is optional when clients use the working submission port 587.
A valid Let's Encrypt certificate is shared by nginx, Postfix and Dovecot.
Initial certificate expiry: 30 January 2027. Mailcow's ACME service renews it.
SKIP_LETS_ENCRYPT=n. Keep public port 80 available for HTTP-01 renewal.
  cd /opt/mailcow-dockerized
  docker compose logs --tail 80 acme-mailcow
Dovecot normally caches successful passwords for five minutes. KFC Mail's own
password-change operation flushes the affected mailbox immediately. For a change
made elsewhere, an administrator can force immediate cache invalidation:
  docker compose exec dovecot-mailcow doveadm auth cache flush EMAIL_ADDRESS

UPSTREAM UPDATES — MANUAL
Run as root from /opt/plmail:
  bash deploy/mailcow/update.sh RELEASE_TAG
  bash deploy/mailcow/update.sh main
The script verifies the published image matches the selected source revision,
merges upstream into the fork, pins the runtime by digest, and builds before
stopping the running webmail. Resolve any Git conflict before retrying; a failed
merge/build leaves the running services intact. It backs up PostgreSQL, keys,
mail files and invitation state, starts the new version, checks health, refreshes
the source archive, and pushes the local branch to /opt/plmail.git.
  bash deploy/mailcow/deploy.sh
rebuilds/deploys the checked-out revision and refreshes the private broker.
Always use compose.mailcow.yaml. Upstream compose.yaml defaults to ports 80/443,
which belong to mailcow on this host. No unattended updater was installed.

BACKUP AND RECOVERY
Initial mailcow configuration/TLS backup: see /opt/mailcow-backups/plmail-current.
KFC Mail snapshot: /opt/plmail-backups/installation; updates create dated backups.
Retain both the PostgreSQL dump and encryption-key backup. Neither Git nor the
public source archive contains passwords, encryption keys or mailbox contents.
Keep /var/lib/plmail-registration backed up separately. Do not roll its used-code
history backwards independently of the actual mailcow mailboxes.
To restore mailcow's original homepage without deleting KFC Mail data:
  bash /opt/plmail/deploy/mailcow/disable-webmail.sh
To enable it again, run deploy.sh, rename site.plmail.disabled back to
site.plmail.custom in mailcow data/conf/nginx, then nginx -t and nginx -s reload
inside nginx-mailcow. Valid certificates and mailcow/SOGo remain in place.
Rolling back a version after database migrations requires the old code and its
matching database dump. Stop php/worker, create a recovery branch at the commit
recorded in the backup's previous-commit.txt, restore the database with pg_restore
--clean --if-exists, restore the matching key/mail-file archives, and deploy.
Never restore a database over a running webmail service.

VERIFICATION
Integration checks in tests/mailcow use disposable test mailboxes. They exercise
login, parallel provisioning, password rotation, SMTP authentication, IMAP sync,
registration and collisions, invite permissions and revocation, all 27 retained
settings sections, profile synchronization, and other-session invalidation.
The tests append local mail fixtures; they send no external email. Test state
and passwords belong under /tmp, never Git. See their explicit staging paths.
KFC Mail's optional upstream administrator dashboard is still available through
an SSH tunnel to loopback port 8090; public /admin belongs to mailcow:
  ssh -L 8090:127.0.0.1:8090 movinggun@10.0.2.160
Then open http://localhost:8090/admin. Normal administration uses the
public Settings → Administration section and does not need this tunnel.

SELF-HOSTED APP NOTIFICATIONS
Settings → Administration → App notifications creates a separate SMTP password
or HTTPS API key for each app and revokes it independently. Secrets appear once.
SMTP host: mail.kfc.network; port: 587; encryption: STARTTLS, required.
Username and From: alerts@kfc.network. Password: the per-app SMTP password.
Send to admins@kfc.network for all active KFC Mail Administrators. Membership
is reconciled when an administrator's group changes. This alias is integration
owned; do not replace it with a mailbox or manually change its recipients.
SMTP credentials cannot read IMAP or log in to webmail, and may only send from
alerts@kfc.network. They may send to internal or external recipients. Existing
authenticated SMTP connections may survive password revocation until disconnect.
Internal addresses deliver locally via Postfix → Dovecot LMTP, without AWS SES.
External recipients use the existing Mailcow relay configuration. External RCPT
acceptance was checked; no external end-to-end delivery test was sent because
no external recipient was supplied. Use the hostname for TLS validation; LAN
split DNS may point mail.kfc.network at 10.0.2.160.

API: POST https://mail.kfc.network/api/notifications with Authorization: Bearer
YOUR_KEY and Content-Type: application/json. Body: subject and plain-text message;
optional to is restricted to the key's configured recipients (default admins).
From is fixed to alerts@kfc.network. Limits: 60/minute and 1000/day per key, plus
300/minute/IP ingress. Optional Idempotency-Key deduplicates successful retries.
202 means Postfix accepted the message, not a guarantee of final delivery.
The API cannot modify users, groups, invitations or Mailcow configuration.
Root-private state: /var/lib/plmail-registration/notifications.sqlite3. Use SQLite
online backup, not a live file copy. Update snapshots include this database.
The Alerts inbox tab files messages from alerts@kfc.network automatically.

SENDER ICONS AND TRACKING PROTECTION
Icons come from sender domains' favicons and homepage icon declarations, fetched
and cached by the server without browser requests to the sender. Registrable
domains use Mozilla's Public Suffix List. Exact-domain branding hints cover
mail-only domains such as just-eat.info. A logo is cosmetic, not authentication.
Initials remain underneath icons and show while loading, when blocked or missing.
Disable sender icons under Settings → Images if desired. Requests use HTTPS,
public DNS addresses pinned per connection and checked on every redirect; private
addresses, arbitrary ports and active image formats are refused.

Tracking protection runs when rendering both old and new HTML mail, even after
Show images. It blocks known tracking resources using the URL-matching subset
of EasyPrivacy's email-trackers and tracking-servers lists, plus hidden-pixel
heuristics. Common tracking query parameters are removed from ordinary links;
signed links are preserved. Rules restricted to images are not applied to links.
Expand Tracking protection on a message to see original URLs, reasons, list
sources and whether a resource was blocked or a link cleaned. This is not a
complete detector of new trackers or tracking hidden in unfamiliar redirects.
Daily root systemd job: plmail-tracker-lists.timer (03:15 UTC plus up to 1h jitter).
Last-good lists survive download errors in /opt/plmail-tracker-data, mounted read
only into the app. Initial fallback lists and attribution ship with the source.
EasyPrivacy is redistributed under GPL-3.0-or-later; Public Suffix List uses MPL2.
  systemctl status plmail-tracker-lists.timer
  journalctl -u plmail-tracker-lists.service --since today

Repeat privacy checks from /opt/plmail as root (no mail is sent):
  docker run --rm --entrypoint php --network plmail_default --volumes-from plmail-php-1 -v /opt/plmail/tests/mailcow:/checks:ro plmail-mailcow:local /checks/verify_privacy.php --network
The --network option additionally verifies real Deliveroo/Just Eat icon downloads.
From a source checkout with Node installed:
  node tests/mailcow/verify_icon_fallback.cjs

FILTERING AUDIT — 1 NOVEMBER 2026
Mailcow Rspamd handles spam, SPF/DKIM/DMARC, URL reputation and phishing heuristics
before KFC Mail sees a message. ClamAV and Olefy run, not skipped. ClamAV 1.4.6
signatures dated today were present. Dry-run standard GTUBE spam and EICAR test
signature both produced rejection; EICAR produced VIRUS_FOUND. No malware was
sent and these scanner tests did not deliver any mail.
Default scores: greylist 7, Spam header 8, reject 15; per-mailbox overrides apply.
The global Dovecot sieve files X-Spam-Flag: YES into Junk. KFC Mail's Spam action
moves the actual IMAP message to Junk; Mailcow's imapsieve scripts learn spam on
entry and ham when moved out (except Trash). Quarantine retention is currently
disabled (unset), with zero stored items. Rejected mail is not being retained
for review. Quarantine can be configured in native Mailcow administration and
is distinct from the user's Spam folder; no retention policy was changed here.
Attachment scan limits: ClamAV whole messages 20 MiB; Olefy parts 3 MiB. Encrypted
contents and larger messages are not covered by those scans. No scanner catches
every phishing message; KFC Mail also keeps remote images blocked by default,
checks sender mismatches and isolates message HTML in sandboxed frames.

DNS issue found and FIXED at 19:39 UTC, 1 November 2026: UniFi had intercepted
outbound DNS, while Mailcow forwarded to Cloudflare with DNSSEC validation off.
Spamhaus returned 127.255.255.254, URIBL returned its blocked code and SURBL failed.
After the user removed VLAN DNS filtering/redirection, direct authoritative UDP
and TCP queries worked. Stock Mailcow recursive Unbound configuration was restored
and the container recreated; DNSSEC validated a signed domain and correctly
refused dnssec-failed.org. Spamhaus ZEN now returns its test listings
127.0.0.2/4/10; URIBL returns 127.0.0.14; SURBL returns 127.0.0.254. Rspamd was
restarted to clear blocked-resolver answers. Repeated scanner tests no longer
reported resolver-block errors, and Unbound/ClamAV are healthy. Keep 10.0.2.160
exempt from DNS/ad-block redirection and allow outbound UDP/TCP 53 recursion.
Backup and exact DNS test results:
/opt/mailcow-backups/unbound-dns-repair-20261101T193909Z/
Optional OpenPhish/Phishtank feeds are disabled. OpenPhish's published terms limit
community-feed use; no new feed or broad score changes were enabled during audit.
Proxmox Mail Gateway is installed in VM 120 on pve4, static 10.0.2.161,
VLAN 4. Management: https://pmg.local.kfc.network (private networks only).
See deploy/mailcow/pmg/README.txt for routing, quarantine, certificate renewal,
backups and recovery. Client SMTP/IMAP and the AWS relay stay on Mailcow.
KFC MAIL ANDROID — NATIVE FORK
Authenticated APK download: https://mail.kfc.network/android/download
Package: network.kfc.mail; release 0.4.3-kfc.2 (version code 40302).
The APK is mounted read-only from /var/lib/kfc-mail-android/releases.
App Links: https://mail.kfc.network/.well-known/assetlinks.json
Mobile authorization: browser login/MFA -> /mobile/authorize -> single-use,
PKCE-bound /mobile/token exchange. Devices hold revocable app credentials.
Native settings/admin endpoints use the authenticated JMAP firewall under
/jmap/kfc; permissions and hosted sender domains are checked by the server.

Android fork: local kfc-mail branch of karatektus/pl_mail_android, with upstream
history preserved. See README.kfc.md in its source bundle for updates/builds.
Signing identity: /var/lib/kfc-mail-android/signing (private; never publish).
Firebase recovery: /var/lib/kfc-mail-android/firebase (private).
Recovery archive: /opt/plmail-backups/installation/android-private-identity.tar.gz.
An additional Windows recovery copy is in the Codex workspace's work/private-android
directory, with access limited to its Windows owner, SYSTEM and administrators.

Firebase project kfc-mail uses kfc-mail-push@kfc-mail.iam.gserviceaccount.com
with the Cloud Messaging API role. The private key was generated here; only its
public certificate was uploaded to Google. Configuration in PostgreSQL uses the
application's encrypted-string type. The uploaded certificate expires on
2 November 2027: rotate it beforehand, save both matching configuration files,
and restart the plMail worker after changing push credentials.
Normal pushes signal changes; content-bearing reminders use device encryption.
The native app fetches mail over HTTPS and does not contain the service key.
