When doing a broadcast message, create a list of pending recipients in new db tables, and processes each message in turn. Jobs can be cancelled/retried. Locking is in place to try and stop multiple concurrent jobs being run.
Adds db tables: broadcast_job, broadcast_job_domain and broadcast_recipient.
thanks @TrapoSAMA
Fixes#1208 - add reason phrase with http 419 response (used with invalid or missing CSRF token is answered with the "Session expired"), otherwise Apache returns a http 500 response instead.
thanks @vibpe
The administrator list shows a translated Yes/No MFA column immediately after Active.
Domains display an MFA badge only when at least one mailbox has a configured secret.
Add resetmfa task for the postfixadmin-cli command. ( postfixadmin-cli admin resetmfa <address> and
postfixadmin-cli mailbox resetmfa <address> )
thanks @TrapoSAMA
Create and edit forms currently lack a Cancel action, making administrators and mailbox users rely on browser navigation or menus to abandon changes. The individual and broadcast mail composers have the
same gap.
thanks @TrapoSAMA
fixes potential XSS issue with TOTP exception lists (which need escaping, see also #1185).
refactors Template escaping to use TemplateEscape enum (rather than the previous boolean).
thanks @TrapoSAMA
Move `<!DOCTYPE html>` below the opening PHP block in `public/setup.php`
so `common.php` initializes the session and sends headers before any
HTML output.
thanks @jfjauvin
Someone wishing to remain anonymous emailed @cboltz a number of security issues, summarised below.
1. fix sql injection bug in getPageBrowser - search keys bypass the field filter, due to 2a6f27c3 / #1127
2. when performing a password change, do not start the session before the new password has been validated for compexity etc - as things stand someone with a recovery code gets logged in even if their password gets
rejected. Also invalid recovery code on failure.
3. broadcast-message.php was using smtp_mail() with incorrect args, and passing the SMTP password in as the mail body. - probably related to commit 7f1d78e and 42a664e9c2
4. a regular (non-admin) user could submit an arbitrary username in the POST data and create/edit a TOTP exception for another user or entire domain
PR includes refactoring of the password change code (into PasswordChangeAttempt) to make it easier to test/verify.
- treat recipient_delimiter as a set of alternative characters, matching Postfix semantics
- centralize recipient-extension removal so alias status and mailbox classification cannot diverge
- restrict delimiter matching to the local part and document multi-character configuration
- add focused unit and alias-status regression coverage
See #1143
Thanks @TrapoSAMA
Alias destinations absent from local records previously shared the misleading “maybe UNDELIVERABLE” indicator, including valid external addresses such as Gmail. The indicator now distinguishes “Check local destination” (red) from “External destination” (blue), with short explanatory tooltips. An alias with both kinds of destinations can show
both indicators.
thanks @TrapoSAMA
Wenhao Wu emailed with the following security report, this affects master and postfixadmin-4.0.
High — mailbox takeover of mail flow for a 2FA-enrolled account by a password holder. CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N ≈ 8.1 (PR:L models possession of the first factor; impact is limited to the attacker's own mailbox account). CWE-308 (Use of Single-Factor Authentication with Two Factors), secondary CWE-287. Not related to the fixed TOTP-exception issue #1014.
....
With `$CONF['totp']='YES'` and a mailbox that has TOTP enrolled, logging in with **only the mailbox password** creates an MFA-incomplete session (`username` set, `roles=[]`, `mfa_complete=false`) that is parked at `users/login-mfa.php`. That half-session cannot open `users/main.php` (it has no `user` role), but `public/edit.php` never checks MFA completion:
- `public/edit.php:30` — `authentication_get_username()` (comment "enforce login") treats any session with a username as logged in; it never calls `authentication_mfa_incomplete()`.
- `public/edit.php:57-63` — for a non-admin session with a handler that has `user_hardcoded_field`, `require_role('admin')` is skipped entirely.
....
Wenhao Wu, Southeast University
thanks @d3do-23 (@cboltz and TrapoSAMA for reviewing etc)
Show DNS status for domains to administrators.
Adds new config setting domain_dns_status_check ( 0 - disabled, 1 authoritative zone, 2 usable MX )
Document installation, an optional CLI/cron command, permissions, networking, timeouts, and saved-result semantics.
thanks @TrapoSAMA
This is the second step of #1064, following #1090.
- replace `list-virtual.php`'s `cNav_bar` HTML renderer with normalized items for the shared `templates/_pagination.tpl`
- preserve the selected domain and nested search parameter in every page link
- use stable `#aliases` and `#mailboxes` anchors for the two independently rendered lists
- render the same accessible Bootstrap 5 pagination above and below each list
- remove the now-unused `arrow-l.png`, `arrow-r.png`, and `arrow-u.png` assets
- require a completed user or admin role before opening TOTP management
- remove TOTP through the existing password-verifying change path
- keep configured post-change hooks active when a secret is removed
- add regression coverage proving an invalid password cannot remove the stored secret
This is the first focused change for #1128.
thanks @TrapoSAMA
Require a validated canonical site_url for recovery links, keep responses uniform, and persist a five-minute per-account request limit.
The token update is atomic across supported database engines and performs the same password hashing work for unknown accounts.
Refs #1128
thanks @TrapoSAMA
Render log records through the default output sanitization path and
remove the inline JavaScript interpolation of log data.
Full log data remains available through a native details element without
placing it in a script context.
Refs #1128
thanks @TrapoSAMA
- validate domain password-expiration policies as whole numbers from 0 through 36500 days
- make password expiration optional and disabled by default
- make 0 consistently mean that passwords in the domain do not expire
- align administrator, recovery, mailbox-user, and XML-RPC password changes
- show each mailbox password-expiration state in lists and CSV output
- add the new labels to every language file
- document how to enable the feature in `config.local.php`
thanks @TrapoSAMA
- use a softer, consistent primary-blue focus treatment for standard
data-entry controls
- identify TOTP inputs as one-time codes and request numeric keyboards
on supported devices
- keep TOTP digits visible while they are entered
- fix the TOTP setup input ID so its label points to the actual control
thanks @TrapoSAMA
fix regression in MySQL schema upgrade from 3.3 where vacation.domain, vacation.email and quota2.username had the wrong collation.
thanks @TrapoSAMA + @Knofte
adds new db table admin_preferences to store a default goto for aliases etc, which when populated will prefil the forward form with that value.
thanks @mkocustos
Restrict recreating $_SESSION to only those where the user has been logged in previously; this should help stop anonymous users from failing a CSRF check.
thanks @TrapoSAMA
Adds a **Forward status: All / Active / Inactive** selector above the
alias (forwards) list in the domain overview (`list-virtual.php`).
see #1038, thanks @knofte
small UI and translation fixes for virtual/admin forms.
Changes:
- Adds PALANG entry for the domain search placeholder.
- Replaces the hardcoded domain search placeholder in edit forms.
- Shows the Domain label when creating aliases and mailboxes.
- Uses Bootstrap 5 form-select for generated select controls.
- Adds minor spacing for the virtual search field.
Thanks @trapoSAMA
Improve CSRF invalid error page
- Replaces the raw hardcoded error with localized PALANG text.
- Provides a simple Continue link back to main.php
Related to the 4.0 branch fix in PR #1055.
Adds an **"All domains"** option to the View Log domain dropdown, so an
admin managing many domains can see log entries across all of them in
one view instead of picking each domain individually.
Closes#1059.
Thanks @knofte
This PR includes two small UI improvements:
* Add horizontal scroll wrappers to virtual mailbox/alias lists so
action buttons and table content do not overflow narrow desktop/tablet
widths.
* Add a domain quota tooltip showing assigned quota and real used quota,
while preserving the existing visible assigned quota text and
usage-based bar color.
Tested locally with PHP lint for DomainHandler.php.
thanks @trapoSAMA
various patches from @trapoSama sent via email -
* Keeps the assigned domain quota text and uses real mailbox usage for
the quota bar color and fill.
* Shows a red count next to a domain when one or more mailboxes exceed
the configured quota alert threshold. Requires patch 1.
* Adds optional configuration to hide mailbox quota and password expiry
columns while retaining those values in the domain tooltip.
* Corrects the quota-bar markup and aligns domain-list columns.
* Replaces the quota bars in the domain overview and mailbox list with a
unified bar component, preventing the fill, label, and border from
separating. It hides Modified, Backup MX, and Transport progressively on
reduced desktop widths, then uses horizontal scrolling as the final
fallback.
* Uses icon-only controls with translated tooltips in domain and mailbox
lists: active state, SMTP active state, autoresponder, alias, edit, and
delete. Active-state tooltips show the current value, for example
`Activo: SI` or `Activo: NO`.
- Use context-specific top menu labels instead of reusing the first dropdown
item label.
- Compact the Bootstrap 5 top navbar spacing and switch collapse to xl to avoid wrapping on desktop widths.
- Move hardcoded main dashboard/search labels into PALANG entries, including Spanish
translations
thanks @TrapoSAMA
Adds a `description` field to the `alias` and `alias_domain` tables, so you can add a comment explaining why the alias exists.
Partially addresses #1036
thanks @jpwarren
Prepared statements were binding DB-specific boolean literals (`'t'/'f'`) produced by `db_get_boolean()`, which breaks PostgreSQL parameter typing in some paths (notably mailbox creation via handler flows).
This change standardizes bound boolean parameters to native PHP `true`/`false` (which are then cast to 0/1 which seems to work fine within PDO/PostgreSQL).
fixes https://github.com/postfixadmin/postfixadmin/issues/1017
* Fix privilege check ordering in TotpPf::addException() (#1012)
Global admins were incorrectly downgraded to regular admins because
authentication_has_role('admin') was checked before 'global-admin',
and global admins have both roles. Reorder to check global-admin first.
* Add missing isset() check on $_GET['abort'] in users/login-mfa.php (#1013)
Matches the admin version at public/login-mfa.php which already has
the isset() check.
* Add missing database indexes for domain_admins and fetchmail (see #972)
Adds composite index on domain_admins(username, domain, active) for
permission checks that run on every admin operation, and index on
fetchmail(mailbox) for domain deletion cascades.