Commit Graph
302 Commits
Author SHA1 Message Date
David Goodwin 2ee2504e56 should not need to pass in false here, as the init_session should have written mfa_complete to true etc 2026-09-29 12:05:32 +00:00
David Goodwin 77ccefdbf2 fix incomplete MFA logins having the ability to change state
when a user is part way through an MFA login (username/password auth done, but not the MFA bit),
authentication_get_username() will return their current username. This function is used in various other places
and historically it was a suitable check to determine if someone was also authenticated.

Commit updates authentication_get_username() to include a call to authentication_mfa_incomplete() by default, the only exclusion being on the login-mfa.php pages.

Thanks to Wenhao Wu (Southeast University) for the security report "MFA-incomplete (password-only) mailbox session can rewrite its own alias forwarding via /edit.php (CWE-308)"
2026-09-29 12:05:32 +00:00
David Goodwin 02305b0dd5 see #1162 - avoid passing null into explode(), thanks @danielsdadm-commits 2026-09-26 09:25:26 +01:00
Rodrigo Cortés Cano b5198b3ab3 4.x: require reauthentication for TOTP removal (#1135)
Require a completed authenticated role for TOTP management and verify the current password before removing a TOTP secret. 

See #1129 and #1128

thanks @TrapoSAMA
2026-09-16 15:00:47 +01:00
Rodrigo Cortés Cano f29ac152fb 4.x: harden password recovery requests (#1136)
Require a validated canonical site_url for recovery links, keep responses uniform, and persist a five-minute per-account request limit.

This ports the behavior of PR #1130 while preserving PHP 7.4 compatibility and the 4.x database boolean handling.

Refs #1128

Thanks @TrapoSAMA
2026-09-02 20:29:26 +01:00
Rodrigo Cortés Cano f6a29e570c 4.x: enforce TOTP policy for XML-RPC login (#1137)
Reject password-only XML-RPC authentication for mailbox accounts that require TOTP while preserving existing behavior for accounts without TOTP.

This ports PR #1131 with PHP 7.4 compatibility and includes the documented XML-RPC/TOTP limitation requested during master review.

Refs #1128

thanks @TrapoSAMA
2026-09-02 20:17:45 +01:00
Rodrigo Cortés Cano b07850f2d6 4.x: escape viewlog output by default (#1140)
Restore default output sanitisation for viewlog records and replace the
inline JavaScript detail popup with native details markup.

This ports PR #1134 while preserving Smarty 3/4 and Bootstrap 3
compatibility.

Refs #1128

Thanks @TrapoSAMA
2026-09-02 20:09:20 +01:00
Rodrigo Cortés Cano 6e93d57766 Fix password expiration handling and visibility on 4.x (#1110)
- port the password-expiration correction to `postfixadmin_4.0`
- make password expiration optional and disabled by default
- make 0 consistently mean that domain passwords do not expire
- validate whole-day policies from 0 through 36500
- align password-change paths and preserve the existing Login fallback
- show mailbox expiration states in lists and CSV output
- add the new labels to every 4.x language file
- document how to enable the feature in `config.local.php`

thanks @TrapoSAMA
2026-08-11 09:28:19 +01:00
Rodrigo Cortés Cano a1724aa59a Reconcile 3.3 MySQL upgrades on 4.x (#1088)
fix regression in MySQL schema upgrade from 3.3 where vacation.domain, vacation.email and quota2.username had the wrong collation. (Thanks @TrapoSAMA + @knofte)
2026-07-28 16:25:09 +01:00
Rodrigo Cortés Cano 26c56cf0e8 Keep 4.x login CSRF token stable across repeated GETs (#1087)
Do not recreate the CSRF token in the session if one already exists, this should avoid people seeing an expired CSRF token error
thanks @TrapoSAMA
2026-07-22 08:55:32 +01:00
Rodrigo Cortés Cano bfe0b8cfd0 Avoid restarting anonymous login sessions on 4.x (#1086)
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:51:38 +01:00
Rodrigo Cortés Cano dcf9318d27 Fix 4.0.x UI layout and Spanish i18n issues (#1077)
This PR contains corrective UI and Spanish i18n fixes for the 4.0.x
branch.

Fixes included:
- Fix domain list layout stability by adding explicit column classes and
widths.
- Fix horizontal overflow in the domain list so wide tables remain
usable on smaller screens.
- Fix quota bar rendering consistency in domain and mailbox listings.
- Fix action buttons in list views by using compact icon buttons with
title and aria-label attributes.
- Fix top menu spacing and labels so the navigation remains readable in
constrained widths.
- Fix untranslated dashboard/global search labels by adding language
strings.
- Fix Spanish labels and wording used by the affected 4.0.x screens.
- Fix the total quota label shown in the domain list.

Thanks @TrapoSAMA
2026-07-13 08:47:57 +01:00
Rodrigo Cortés Cano 719935d17a Improve error message for expired CSRF token errors
This backports the invalid-token/session-expired UX improvement to the 4.0 branch.

When a session expires and an old CSRF token is submitted, PostfixAdmin 
currently shows a raw invalid token error. 

This change renders a translated session-expired page instead, returning HTTP 419.

thanks @TrapoSAMA
2026-07-03 18:38:14 +01:00
David Goodwin 75dfa2fec1 psalm 2026-06-13 09:42:28 +01:00
David Goodwin 0be8a6c7af formatting 2026-06-13 09:39:16 +01:00
Fredrik Boström 8e6457e15b 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:29:38 +01:00
David Goodwin 5fb080f79b minor code refactoring (login / TotpPf) 2025-11-23 16:04:53 +00:00
David Goodwin 5249a4e28a global search -> avoid shortcut of empty list for super-admin, always populate list, and only allow a search if $list_domains is not empty 2025-10-28 13:48:09 +00:00
David Goodwin d0372d4db1 token renames (a variable called SESSID_USERNAME makes me think it is reserved by PHP or something, which I do not think it actually is, so just user a more meaningful $username 2025-10-28 09:49:29 +00:00
David Goodwin 915c390f42 fixes #947 - restrict global search to domains the admin type user has visibility for 2025-10-28 09:48:42 +00:00
Christian Boltz 4b20d2be2b Fix hardcoded table name mailbox_app_password
... which exploded when using custom table names.
2025-09-11 22:39:57 +02:00
Christian Boltz d50d171914 Fix 404 when loading css etc. for admins
For admins, the relative path to css etc. is '', not '../'
2025-09-11 21:56:35 +02:00
David Goodwin 460c624275 remove more references to sourceforge 2025-07-13 18:29:37 +01:00
David Goodwin 2330b94439 list.php: just exit() after outputting a csv, which allows us to remove the else indentation 2025-07-12 19:10:45 +01:00
David Goodwin 6dff69392c typo fix 2025-05-27 08:46:34 +01:00
David Goodwin b97d89c280 try and only moan about db drivers missing if the specific driver is in the config, try and improve rendering of warnings/errors etc 2025-05-26 19:40:08 +01:00
David Goodwin 72c0dd1184 token code refactor 2025-05-26 15:53:33 +01:00
David Goodwin 4c01abf440 try and ensure core db tables are InnoDB format for MySQL users upgrading. 2025-05-26 15:51:48 +01:00
David Goodwin de50ba1d30 only moan about database extensions missing if there are none found. 2025-05-26 15:50:42 +01:00
David Goodwin 5f46bdedaf respect db prefix stuff for the TOTP database tables. 2025-05-26 15:49:29 +01:00
David Goodwin 798e8b269c Topt app passwords fixes (WIP) (#805)
various improvements to the TOTP code see also:  #802
2025-05-16 20:31:20 +01:00
David Goodwin 2669045ed8 formatting 2025-02-23 20:25:02 +00:00
David Goodwin d250a47e4a fix tag nesting etc (broken footer) on setup.php 2025-02-23 20:23:30 +00:00
James Lucas III dce68cdf50 Update upgrade.php (#906)
fix upgrade.php - admin.totp_secret field was not being added in the right place which caused an error. 

see also #899, thanks @jimlucas
2025-02-23 20:21:27 +00:00
David Goodwin b30af8fc6a upgrade moment.js to v2.30.1 - should fix issue with ReDOS (regex denial of service) - see #902 2025-02-21 09:55:20 +00:00
David Goodwin 8461afb4ff add {BOOLEAN_TRUE} for pgsql, see #891 2025-01-18 09:01:35 +00:00
David Goodwin 9ac03371ce formatting 2025-01-17 11:20:22 +00:00
David Goodwin f61266cd7d see https://github.com/postfixadmin/postfixadmin/issues/891 - fix addition of mailbox.smtp_active to work on postgresql, add {BOOLEAN_TRUE} placeholder for mysql (not sure how this did not exist) 2025-01-17 10:43:20 +00:00
David Goodwin 759304ecb8 apparently these all need reformatting 2024-12-05 14:33:41 +00:00
David Goodwin 5047f9d1d4 stop smarty moaning about an undefined div on list.php 2024-11-22 20:32:56 +00:00
David Goodwin 5f5c52257d add token "global search" on the frontpage for superadmins to perhaps find some things quickly 2024-07-23 20:57:39 +01:00
David Goodwin 56dd787ce2 when going through password recovery, only wipe the recovery token after the user has updated their password
see https://github.com/postfixadmin/postfixadmin/issues/550
2024-05-17 22:02:01 +01:00
David Goodwin f01274ec94 try relaxing composer dependencies to allow php8.2 dev support, reformat so composer format passes 2024-04-22 21:02:01 +01:00
David Goodwin 81a1d45617 drop use of the deprecated PHP imap extension (php-imap) - see #472 and #812 2024-04-01 19:32:47 +01:00
Gabriel Sambarino f81a070cc9 Fix typo ( s/pasword/password/ ) 2024-02-15 15:56:57 +01:00
David Goodwin 8c1369068f fix #801 - incorrect path for common.php 2024-02-06 08:29:54 +00:00
David Goodwin 64c34b2c0a fix deletion of app password - see #800 2024-02-05 20:30:31 +00:00
David Goodwin 45557a6ed4 code formatting fix 2024-01-11 08:57:27 +00:00
David Goodwin c700f3c9c7 update mailbox - add smtp_active for #796 2024-01-10 10:02:07 +00:00
John Fawcett 668960ccf6 Add a flag to mailbox table for enable/disable smtp protocol. The table column name
is "smtp_active". This enables use of this flag instead of active flag for postfix
mysql queries. There is a new configuration parameter $CONF['smtp_active_flag'] =
YES or NO, which defaults to NO, providing the existing behaviour. When set to YES
the active_smtp field is displayed in the edit mode and can be modified.
The commit includes update to the language files and documentation.

The commit does not include the code to add the field to existing installs,
which I presume can be added during the release cycle in upgrade.php along the
lines of:

_db_add_field('mailbox',  'smtp_active', 'int DEFAULT 1');
2024-01-09 20:50:49 +01:00