Commit Graph
524 Commits
Author SHA1 Message Date
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 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 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
David Goodwin b6e6c49642 if templates_c is not writeable fall back to using sys_get_temp_dir() and add a error_log warning 2026-01-30 11:05:48 +00:00
Sven Strickroth 49c0099146 Check for address validity before checking domain existence
get_domain_properties might throw.

Signed-off-by: Sven Strickroth <email@cs-ware.de>
2026-01-25 16:10:11 +01: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 0d5edbf099 move pacol() into PFAHandler class, I think it makes more sense for it to be there given the dependency between the two 2025-07-13 10:12:22 +01:00
David Goodwin a0a6944f3a fix wrong name for table_name 2025-06-17 19:19:00 +01:00
David Goodwin edb368edb0 merge postfixadmin_4.0 in, fix conflicts in model/TotpPf.php 2025-06-17 19:18:03 +01:00
David Goodwin 986aefbdd0 stfu psalm - Encoding definitely takes a value 2025-06-11 21:26:34 +01:00
David Goodwin 5f9d0f5223 try and allow endroid\qrcode v5 to be installed, if the version of PHP supports it ... this reduces the number of deprecation warnings shown (but does not remove them all) 2025-06-11 21:25:09 +01:00
David Goodwin 1a1d3f4977 token tidy up to TotpPF 2025-06-01 20:04:53 +01:00
David Goodwin e7e59bc4ae remove x/y suffix, improve error handling message when failing to delete a totp exception 2025-06-01 18:59:54 +01:00
David Goodwin 838144bfa0 typo fix (tablename/table_name) 2025-05-26 19:42:52 +01:00
Christian Boltz b71df0b403 TotoPf: use correct table name 2025-05-26 19:41:24 +01:00
Christian Boltz 0e7099c862 TotoPf: use correct table name 2025-05-26 20:04:17 +02: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 cb12b6f3ec formatting 2025-04-21 19:33:48 +01:00
David Goodwin ee3329a91c i think this is an actual fix for #913 - add a htmlentities_no_double_encode modifier to smarty and use it to hopefully escape the itemkey variable... 2025-04-11 09:56:56 +01:00
David Goodwin c8bf8ec642 register htmlentities earlier, although i do not think this changes anything 2025-04-11 09:26:42 +01:00
David Goodwin 759304ecb8 apparently these all need reformatting 2024-12-05 14:33:41 +00:00
David Goodwin 8ec9140673 fix: "PHP Deprecated: Using unregistered function "htmlentities" in a template..." from Smarty, see https://github.com/postfixadmin/postfixadmin/issues/872 2024-11-22 20:28:34 +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
Gianluca Giacometti 5bcfc0f613 Fix typo (#867)
typo fix in config file for mailbox_postcreation_hook; thanks @gianlucagiacometti
2024-11-11 08:54:35 +00:00
Christian Boltz dc51b00ce1 Fix formatting 2024-11-10 22:19:22 +01:00
David Goodwin 25bab8d7a2 code formatting 2024-11-09 14:47:28 +00:00
Gianluca Giacometti bfebea5f3c Create new_mailbox_hook function (#864)
* Add new postcreate mailbox hook ( mailbox_postcreation_hook ) - which can be called after a mailbox is created (similar to mailbox_postcreation_script). 

Thanks @gianlucagiacometti !
2024-11-09 08:23:26 +00:00
Gianluca Giacometti 9b169e27f9 smtp_active should be a checkboox (#861) 2024-11-05 19:08:26 +00:00
David Goodwin e1c64f887f reformat code 2024-10-30 19:29:55 +00:00
kvassss 5de5fb2719 Fix deprecated config parameter error (#859)
add create_mailbox_subdirs to deprecated list - stop error_log() call for it from Config.
see also #812 
Co-authored-by: Sergey Lisenko <lisenkosergey@loc.tashkent.uz>
2024-10-30 15:04:19 +00:00
David Goodwin 519c934ed3 Add minimal cron job to remove old vacation alias records - see https://github.com/postfixadmin/postfixadmin/issues/832 2024-05-31 19:25:53 +01:00
David Goodwin f3ce7e232d token formatting changes 2024-05-17 22:03:55 +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 d3dfe6382b fix syntax error added in 4ae78cd172 and #823 2024-04-22 21:00:12 +01:00
Nuno TavaresandNuno Tavares 4ae78cd172 dont assume 'quota' will be in the values, just like block before wasn't assuming (#823)
Co-authored-by: Nuno Tavares <n.tavares@portavita.eu>
2024-04-22 08:35:55 +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 279e7f682d underlying db field is set to an int (for mysql and pgsql), pgsql does not cope with t/f being set for an inty field, so change the model definition .... - see #814 2024-04-07 19:37:41 +01:00
David Goodwin 62a76734c9 see #812 - remove config options for create_mailbox_subdirs_* due to the php-imap module being deprecated; leave in an error_log message to perhaps avoid future support tickets asking why this does not work 2024-04-01 19:38:31 +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
David Goodwin c422a4bad2 see #808 - db_log expects 3 strings ... make sure we do not pass in a null 2024-03-08 11:46:14 +00:00
David Goodwin eda637df1a Merge branch 'master' into michaelkrieger-patch-1 2024-01-11 08:51:17 +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
David Goodwin 6e6e4301ed an empty check would catch null ... while != "" will also match null it feels wrong 2024-01-05 19:31:54 +00:00
David Goodwin 6b5801c666 typo fixes 2024-01-05 19:30:16 +00:00
David Goodwin 39e378c783 improve type hinting 2023-12-27 16:17:55 +00:00
David Goodwin dc792a0222 add unit test to cover some of Login::addAppPassword() 2023-12-27 16:17:55 +00:00