Commit Graph
137 Commits
Author SHA1 Message Date
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 bc80d14b76 4.x: scope Roundcube TOTP preference updates (#1139)
Limit the Roundcube preference update to the selected user and prevent serialized preferences from instantiating classes.

This ports PR #1133 with PHP 7.4 compatibility and validates the script arguments before accessing them.

Refs #1128

Thanks @TrapoAMA
2026-09-02 20:30:36 +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 4a23d84ac4 4.x: enforce SMTP protocol state (#1138)
Improve SMTP (see smtp_mail()) - treat unexpected SMTP replies, incomplete writes, and failed TLS
negotiation as delivery failures. 

Refs #1128

thanks @TrapoSAMA
2026-09-02 20:15:54 +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 852e719183 4.x: fix legacy md5crypt compatibility (#1126)
- restore `md5crypt` as the PostfixAdmin 3.x-compatible alias for MD5-CRYPT
- verify stored unprefixed MD5-CRYPT, prefixed MD5-CRYPT, bcrypt, and SHA512 crypt hashes from their stored format
- document the canonical `MD5-CRYPT` setting, the legacy alias, and the 3.x upgrade implications

This addresses #1123 on `postfixadmin_4.0`. The `master` correction is in #1125 so each maintained branch can be reviewed and tested against its own PHP requirements.

thanks @TrapoSAMA
2026-08-29 15:11:10 +01:00
Rodrigo Cortés Cano e971465a5a pacrypt - be more tolerant of doveadm output (#1122)
- port the `doveadm pw` stderr and exit-status handling from #1121 to
`postfixadmin_4.0`
- preserve PHP 7.4-compatible syntax and the branch-specific password flow
- add the same portable regression coverage for password generation and verification

See #1119.

thanks @TrapoSAMA
2026-08-26 09:08:48 +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 3bdb75b633 Distinguish mailbox and domain quota validation errors on 4.x (#1097)
- distinguish the per-mailbox maximum quota error from insufficient remaining domain quota
- add the domain-quota error message to every language catalog 
- add focused coverage for both quota failure causes

see also #1096 (same changes on master).
2026-08-03 21:01:24 +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
David Goodwin 7f175f9da8 remove reference to _pacrypt_crypt (deadcode) 2025-06-01 15:57:58 +01:00
David Goodwin 830160303f format 2025-06-01 15:52:25 +01:00
David Goodwin 6086cebacf remove more dead tests/code 2025-06-01 15:48:57 +01:00
David Goodwin 999bfcfc54 drop support for mysql_encrypt, given MySQL after 5.7 has dropped it and we had not wired it into the pacrypt() function anyway, try and improve docs in config.inc.php 2025-05-28 09:41:22 +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 759304ecb8 apparently these all need reformatting 2024-12-05 14:33:41 +00:00
David Goodwin 24b3b12581 MailboxHandler: change mailbox_postcreation_hook and maildir_name_hook CONF callable check to use is_callable() and not is_string() && function_exists() - this should allow someone to define a PHP 7+ style anonymous function within their config, add unit test to illustrate behaviour etc
see also #869 and #812
2024-11-12 20:12:53 +00:00
David Goodwin 476b203c0d tidy up unit tests (phpunit warnings) 2024-11-12 20:10:09 +00:00
David Goodwin b726c7aba8 ensure {MD5-CRYPT}$1$ and $1$... are treated the same .. see also #843 2024-07-16 11:16:48 +01:00
David Goodwin 2eb7f34844 try and fix phpunit deprecation warning - assertRegExp => assertMatchesRegularExpression 2024-04-22 21:08:57 +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
Shao Yu-Lung (Allen) 0876c368e4 feat: support Dovecot DIGEST-MD5 (#816)
Add support for dovecot DIGEST-MD5 auth (using : $CONF['pacrypt'] = 'dovecot:DIGEST-MD5') 

This also changes the pacrypt() function to take an optional 3rd argument (username). 
Thanks @bestlong
2024-04-12 09:57:19 +01:00
David Goodwin dc792a0222 add unit test to cover some of Login::addAppPassword() 2023-12-27 16:17:55 +00:00
David Goodwin 2ee4b3832e formatting 2023-12-24 19:40:49 +00:00
David Goodwin a368104fad token test 2023-12-24 19:39:47 +00:00
David Goodwin 605a019a24 better test coverage - make sure pacrypt() respects php_crypt:MD5 and makes something like $1$..... 2023-03-09 21:57:58 +00:00
David Goodwin 6f3c5a73ad add unit test for https://github.com/postfixadmin/postfixadmin/issues/647 2022-08-11 20:21:16 +01:00
David Goodwin d3e101e9d8 Merge remote-tracking branch 'origin/master' into feature/dkim 2022-07-18 08:55:07 +01:00
David Goodwin 2d6ded2786 PSR2 -> PSR12 formatting 2022-06-28 13:46:11 +01:00
David Goodwin bed0300fae fix tests (pacrypt/{md5raw} etc) 2022-06-23 22:18:16 +01:00
Fredrik Falk 9e73025058 Add Domain Key handling 2022-06-23 20:40:06 +02:00
David Goodwin 35486a2ca9 remove dead code 2022-06-06 20:35:53 +01:00
David Goodwin 760600cb56 one or more of something needs {1,} not {1} ... 2022-02-13 20:32:39 +00:00
Oliver Cooper 35ecb62730 Add password special character support 2022-02-13 17:21:20 +00:00
David Goodwin 4bc3e1464c make sure php_crypt:BLOWFISH works 2021-11-14 20:50:41 +00:00
David Goodwin 598f7db2e7 skip ARGON2ID* things if using an old PHP variant 2021-09-29 21:27:28 +01:00
David Goodwin 91a3dde446 older php variants do not have argon2i 2021-09-29 21:23:18 +01:00
David Goodwin 40101c84d4 fix formatting 2021-09-29 21:10:43 +01:00
David Goodwin ac13219894 improve test coverage / compatability 2021-09-29 21:05:19 +01:00
David Goodwin 309b4a84aa get legacy test case to pass 2021-09-29 18:32:46 +01:00
David Goodwin 0b9b7db917 Merge remote-tracking branch 'origin/master' into feature-improve-pacrypt 2021-09-29 18:04:49 +01:00
David Goodwin 561216c83d composer format 2021-09-25 20:34:32 +01:00
David Goodwin 55e7515c9c more testings (pacrypt() related) 2021-09-25 20:33:15 +01:00
David Goodwin 284e1f7eb2 fix test after language change 2021-07-08 19:44:11 +01:00
David Goodwin 179dd4c6e2 try and improve hashing, remove duplicate code, try and cope with the algorithm/method in $pw_db being different from the configured one; add tests 2021-05-11 21:56:48 +01:00
David Goodwin 543285a203 add SSHA format, add some specific courier algorithms, try and partially update docs 2021-05-09 21:31:53 +01:00
David Goodwin 71ee810891 try and implement more hash mechanisms - see e.g. https://github.com/postfixadmin/postfixadmin/issues/479 and https://github.com/postfixadmin/postfixadmin/issues/379 2021-05-08 21:47:45 +01:00
David Goodwin 2edabc3e03 phpcs insists on some brace changes 2021-04-13 21:19:16 +01:00
David Goodwin c300a8070e ensure timestamps are non-empty after update for mailbox 2021-04-05 21:11:39 +01:00