Commit Graph
3469 Commits
Author SHA1 Message Date
Rodrigo Cortés Cano 755f6c3990 Reconcile 3.3 MySQL upgrades on master (#1089)
fix regression in MySQL database update order. See #971

thanks @TrapoSAMA and @csware
2026-07-23 09:31:31 +01:00
Rodrigo Cortés Cano 852cb6fb39 Test user alias creation guard directly 2026-07-22 18:13:16 +00:00
Rodrigo Cortés Cano d60ff99e77 Apply user alias ownership check consistently 2026-07-22 18:13:16 +00:00
Rodrigo Cortés Cano 3ab0104d1a Address forwarding editor review feedback 2026-07-22 18:13:16 +00:00
Rodrigo Cortés Cano 8d631d2ce8 Skip internal vacation target validation 2026-07-22 18:13:16 +00:00
Rodrigo Cortés Cano 9a9078ce21 Unify user and admin forwarding editor 2026-07-22 18:13:16 +00:00
Rodrigo Cortés Cano 10a76e8773 Preserve anonymous login sessions across repeated GETs (#1085)
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
2026-07-22 08:52:33 +01:00
Rodrigo Cortés Cano 63f91b649f Clarify sudoers rules across optional hook sets (#1082)
- Clarifies that the documented `sudoers` policy applies to every enabled PostfixAdmin hook, not only to the optional Rspamd integration.
- Explains which generic rules remain in place and when the composite Rspamd domain-deletion rule replaces the direct domain-deletion rule.

thanks @TrapoSAMA
2026-07-19 19:38:09 +01:00
Rodrigo Cortés Cano f3e10ce573 Harden optional mailbox hooks and add Rspamd DKIM examples (#1079)
- harden the existing optional Maildir domain, mailbox creation/deletion and Dovecot mail-crypt hooks
- validate hook argument contracts and keep all derived paths below their configured base directories
- quote filesystem operations, check command failures and make deletion hooks safely retryable
- update the Dovecot password example for the prompt behaviour available since Dovecot 2.3.19, with a Dovecot 2.4 setting note 
- add optional Rspamd DKIM creation/deletion helpers, a privilege-separated composite domain hook and deployment documentation

These hooks remain optional and disabled by default. Administrators must review the configured paths and service-account names before installation. The mail-crypt password example now requires Dovecot 2.3.19 or newer; its comment identifies the setting name needed by Dovecot 2.4.
2026-07-19 09:50:48 +01:00
Rodrigo Cortés Cano e280deb97a Document Dovecot 2.4 configuration (#1075)
Add Dovecot 2.4-oriented documentation for PostfixAdmin installations.

The new document covers:

- baseline Dovecot 2.4 SQL passdb/userdb configuration
- temporary weak password scheme compatibility for old MD5/MD5-CRYPT
hashes
- optional post-login password migration to ARGON2ID
- optional per-user Maildir to mdbox migration using a local mail_format
field
- quota warning delivery to the user's INBOX
- optional IMAPSieve/Rspamd spam and ham learning hooks
- security notes for userdb_plain_pass and verbose password logging

It also adds sanitized example files under DOCUMENTS/examples and
references the new Dovecot 2.4 document from the existing DOVECOT and
HASHING docs.

Thanks @TrapoSAMA
2026-07-13 08:49:50 +01:00
Özgür Konstantin Kazanççı bf5c3f7eb2 Update config.inc.php (#1074)
typo fixed (alteration) - thanks @ozgurkazancci
2026-07-12 09:13:30 +01:00
David Goodwin 7388aa17bd fix psalm annoyances 2026-07-07 21:27:27 +01:00
David Goodwin 94d8ffcf78 squash merge #1058 - add the ability to bulk delete forwards from the alias list, thanks @knofte
see https://github.com/postfixadmin/postfixadmin/pull/1058
2026-07-07 21:22:33 +01:00
Kent Riboe a400db12dc Add active-status filter to the alias (forwards) list (#1038) (#1056)
Adds a **Forward status: All / Active / Inactive** selector above the
alias (forwards) list in the domain overview (`list-virtual.php`). 

see #1038, thanks @knofte
2026-07-07 20:44:43 +01:00
Kent Riboe c51d00cefb docs: document the language-string workflow (#1070) (#1071)
Refresh the Translation process 
 * rename DOCUMENTS/LANGUAGE.txt to DOCUMENTS/Translations.md, attempt to format.
 * Removes the dead SVN / SourceForge references, points at GitHub.
 * Add a **"for developers"** section etc

Thanks @knofte
2026-07-07 20:37:59 +01:00
David Goodwin 0328f02ec9 update-languages.sh --patch -> adds session_expired_button, session_expired_message, session_expired_title, quota_not_managed, pAdminList_domain_maxquota and search_domains entries, remove stale entry from nl.lang (backupmx) and duplicate from en.lang (pMenu_app_passwords) 2026-07-05 20:27:22 +01:00
Kent Riboe 0f68dee15c viewlog: per-page selector + Bootstrap 5 pager, fix footer layout (#1062) (#1063)
Improve pagination on viewlog page (make page size configurable, use bootstrap 5 pager) 

Closes #1062. Thanks @knofte
2026-07-05 20:21:19 +01:00
snathan100 4b3f7e70ea Add docs: custom fields via *_struct_hook (with domain backend_host example) (#1069)
As discussed in #1068.

Adds `DOCUMENTS/CUSTOM_FIELDS.md`, a start-to-finish walkthrough for
adding a custom field to a built-in entity using the `*_struct_hook`
callbacks, no core patching required.
2026-07-05 20:12:02 +01:00
David Goodwin 97e17c41c1 allow users to configure a closure (anonymous function) as a *_struct_hook config setting as well
previously we required a named function, see #1069
2026-07-05 20:06:17 +01:00
Rodrigo Cortés Cano 1b3db6bbd3 Improve Spanish labels and domain quota text (#1051)
Changes:

* Improve Spanish translations for mail, DKIM, logs, quota and Backup MX labels.
* Use a shorter domain-list quota label while keeping the full domain quota label in edit forms. 
* Keep hidden domain-list values available in the domain tooltip without reusing form labels.
* Add explicit labels for max mailbox quota and unmanaged quota state.

Thanks @TrapoSAMA
2026-07-03 18:35:16 +01:00
Rodrigo Cortés Cano 43fbf7e56b UI improvements for virtual form labels and search spacing (#1052)
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
2026-07-03 18:33:55 +01:00
Rodrigo Cortés Cano 42fd9870d4 Improve invalid CSRF token response page (#1067)
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.
2026-07-03 18:31:55 +01:00
Kent Riboe 3f149ac219 CI: run the build workflow on pull requests (#1065) (#1066)
Implements #1065 — run github builds more often (on push, on PR)
2026-07-03 08:24:07 +01:00
Kent Riboe d6aabd7745 viewlog: add "All domains" option to the log viewer (#1059) (#1060)
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
2026-07-01 16:22:21 +01:00
David Goodwin a995eb3e27 language-update.sh --patch ... update translations and add missing keys with what is in en.lang 2026-07-01 15:04:28 +01:00
David Goodwin f96508af23 update language-update.sh and get it to work again 2026-07-01 15:04:04 +01:00
David Goodwin 6a45360d8c language-update.sh: token bug fixes (remove references to svn/sf.net, replace with github etc, remove svn info and use git log 2026-07-01 14:42:24 +01:00
Rodrigo Cortés Cano 730ddcb909 Improve virtual list responsiveness and quota tooltip (#1050)
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
2026-06-28 08:49:53 +01:00
David Goodwin 74c50fb12b update CHANGELOG.TXT 2026-06-27 16:31:22 +01:00
David Goodwin ff73976b72 UI enhancements around quota and icons for domain/mailbox lists
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`.
2026-06-27 16:22:33 +01:00
Rodrigo Cortés Cano e0067e4138 Improve top menu and main dashboard labels (#1047)
- 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
2026-06-26 08:54:08 +01:00
David Goodwin 30be899218 remove extra "D" from es.lang (thanks @trapoSama, see https://github.com/postfixadmin/postfixadmin/discussions/1039) 2026-06-14 09:56:18 +01:00
David Goodwin a83dc2f20e update spanish translation, thank you @trapoSAMA - see https://github.com/postfixadmin/postfixadmin/discussions/1039 2026-06-12 21:24:45 +01:00
David Goodwin 710e1acce9 update CHANGELOG.TXT 2026-06-08 09:15:20 +01:00
Justin Warren 2469e045d8 Add 'description' field to alias and alias_domain tables. (#1042)
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
2026-06-08 09:08:02 +01:00
Justin Warren 08cf7a8e6e Improve native (.deb) packaging for Debian/Ubuntu 24.04 (#1041)
thanks @jpwarren
2026-06-08 09:06:44 +01:00
David Goodwin 8696f300c5 formatting 2026-05-23 15:10:25 +01:00
Kent Riboe 650a91bd05 Improve DKIM: auto-generate keypair, descriptive signing table (#1029)
Implements the improvements suggested by @fredkilbourn in #1024, cleaned up for current master.

**Changes:**

1. **Auto-generate RSA 2048 keypair** when creating a new DKIM key. Only
generates on the create form, not on list views or edits.

2. **Descriptive signing table dropdown** shows `domain:selector
(description) [id]` instead of just the numeric ID.

3. **Domain:Selector and Description columns** in the signing table list
view via LEFT JOIN.

4. **Order by domain:selector** instead of raw dkim_id.

**Technical notes:**
- Uses `$this->new` check to avoid key generation overhead on list/edit
views
- Handles MySQL (`CONCAT()`) vs SQLite/PostgreSQL (`||`) string
concatenation
- Uses named arguments for `pacol()` per current conventions

Two separate commits. Credit to @fredkilbourn for the original patch.
2026-05-23 14:41:13 +01:00
Fredrik Boström 1024befd39 Fix pw recovery without totp (#1032)
Check if user has TOTP active, if so display input field in pw-change form and evaluate it.
2026-05-23 14:34:42 +01:00
Lombra f77f079d37 Update appearance for consistency (#1030)
- Make cards look closer to Bootstrap reference implementation by
removing padding and using the proper header element.
- Vertically center align table row content.
- Add a theme adaptive background to the navigation bar, and reuse the
design for non logged in pages.

thanks @Lombra
2026-05-09 09:32:24 +01:00
Copilot ae7339afd4 Use native booleans for prepared SQL params; stop binding db_get_boolean() values (#1019)
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
2026-04-23 19:28:01 +01:00
Kent Riboe 2cce49a657 Add tests for db_where_clause() and db_delete() with additional params (#1021)
Adds test coverage for the core query-building functions refactored in #1004:
 - db_where_clause()
 - db_delete()
2026-04-22 13:41:47 +01:00
David Goodwin b420341083 let down by formatting again :( 2026-04-21 09:17:57 +01:00
David Goodwin a762682d7c token test of PFAHandler::col() and 9th param rename from $options to $not_in_db 2026-04-21 09:15:20 +01:00
David Goodwin ca4dae3ffe Phpunit updates (fix phpunit run, should fix build) (#1016)
should fix build, which is currently failing due to a stale phpunit config and poor choice of class name
2026-04-18 10:42:02 +01:00
Kent Riboe c6773f8390 Migrate TOTP exceptions to TotpexceptionHandler class (#1007)
refactor code to use the PFAHandler approach, allowing re-use of list.php and edit.php.
2026-04-18 10:22:54 +01:00
Kent Riboe 8e6a4f0f4b Add developer documentation for Handler classes, update PFAHandler::pacol() params (#1008)
Add DOCUMENTS/HANDLER_CLASSES.md which attempts to document how the Handler classes work and help future developers/contributors. 

Changes spec of PFAHandler::pacol() to discourage the 9th parameter (was: multiopt) from being passed as an array (param renamed to not_in_db). Previous behaviour is maintained, but a deprecation error should be triggered.
2026-04-18 10:10:00 +01:00
Kent Riboe 2c0a06f932 Add Exec class to help refactor/reduce duplication of proc_open calls, update phpunit (see note) (#1009)
* code refactoring (adds Exec class to centralise proc_open like calls). 
* bump phpunit to ^11.0, as this is the last release that supports php8.2. Note, there is not (yet?) a phpunit release for php8.2 that fixes PKSA-z3gr-8qht-p93v or PKSA-5jz8-6tcw-pbk4, so ignore them for now in composer.json
2026-04-18 10:05:35 +01:00
Kent Riboe c376b56029 Add regression tests for global admin TOTP exception privileges (#1015)
* Add regression tests for global admin privilege check in TOTP exceptions (#1012)

Verifies that global admins with both 'admin' and 'global-admin' roles
can add TOTP exceptions for any domain, while regular admins are
restricted to their managed domains.

* Add tests for db_in_clause(): placeholders, empty array, unique keys, real query

Covers the parameterized query refactor from PR #1004.

* Move test cleanup to tearDown: add admin table delete and session unset

Prevents state leaking between tests, especially when expectException()
aborts the method before inline cleanup runs.

* Use assertEquals with exact expected SQL per review
2026-04-15 21:12:01 +01:00
Kent Riboe e546e6d593 Fix privilege check ordering for TotpPf::addException (global admin being treated like admin) (#1012)
* 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.
2026-04-14 21:17:03 +01:00