Skip to content

Commit

Permalink
see #812 - remove config options for create_mailbox_subdirs_* due to …
Browse files Browse the repository at this point in the history
…the php-imap module being deprecated; leave in an error_log message to perhaps avoid future support tickets asking why this does not work
  • Loading branch information
DavidGoodwin committed Apr 1, 2024
1 parent 81a1d45 commit 62a7673
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 49 deletions.
27 changes: 0 additions & 27 deletions config.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -700,20 +700,6 @@ function x_struct_admin_modify($struct) {
// $CONF['domain_postdeletion_script']='sudo -u courier /usr/local/bin/postfixadmin-domain-postdeletion.sh';
$CONF['domain_postdeletion_script'] = '';

// Optional:
// Sub-folders which should automatically be created for new users.
// The sub-folders will also be subscribed to automatically.
// Will only work with IMAP server which implement sub-folders.
// Will not work with POP3.
// If you define create_mailbox_subdirs, then the
// create_mailbox_subdirs_host must also be defined.
// Note: requires imap extension within PHP
// $CONF['create_mailbox_subdirs']=array('Spam');
$CONF['create_mailbox_subdirs'] = array();
$CONF['create_mailbox_subdirs_host']='localhost';
//
// Specify '' for Dovecot and 'INBOX.' for Courier.
$CONF['create_mailbox_subdirs_prefix']='INBOX.';

// Optional:
// Show used quotas from Dovecot dictionary backend in virtual
Expand All @@ -727,19 +713,6 @@ function x_struct_admin_modify($struct) {
// Note about dovecot config: table "quota" is for 1.0 & 1.1, table "quota2" is for dovecot 1.2 and newer
$CONF['new_quota_table'] = 'YES';

//
// Normally, the TCP port number does not have to be specified.
// $CONF['create_mailbox_subdirs_hostport']=143;
//
// If you have trouble connecting to the IMAP-server, then specify
// a value for $CONF['create_mailbox_subdirs_hostoptions']. These
// are some examples to experiment with:
// $CONF['create_mailbox_subdirs_hostoptions']=array('notls');
// $CONF['create_mailbox_subdirs_hostoptions']=array('novalidate-cert','norsh');
// See also the "Optional flags for names" table at
// http://www.php.net/manual/en/function.imap-open.php
$CONF['create_mailbox_subdirs_hostoptions'] = array();

// Optional:
// Allows a user to reset his forgotten password with a code sent by email/SMS
$CONF['forgotten_user_password_reset'] = true;
Expand Down
28 changes: 6 additions & 22 deletions model/MailboxHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -728,38 +728,22 @@ protected function mailbox_postdeletion()
}



/**
* Called by postSave() after a mailbox has been created.
* Immediately returns, unless configuration indicates
* that one or more sub-folders should be created.
*
* Triggers E_USER_ERROR if configuration error is detected.
*
* If IMAP login fails, the problem is logged to the system log
* (such as /var/log/httpd/error_log), and the function returns
* FALSE.
*
* Doesn't clean up, if only some of the folders could be
* created.
*
* @return boolean TRUE if everything succeeds, FALSE on all errors
*
* @todo rewrite/remove dependency on php-imap and use instead something like : https://www.php-imap.com/api/client
* Effectively deprecated - see linked issues
* @see https://github.com/postfixadmin/postfixadmin/issues/472
* @see https://github.com/postfixadmin/postfixadmin/issues/812
*/
protected function create_mailbox_subfolders()
{
// no longer implemented; code relied on deprecated PHP imap extension.
// no longer implemented; code relied on deprecated PHP imap extension, output some sort of error message
// if it looks like the installation used to support it.

$create_mailbox_subdirs = Config::read('create_mailbox_subdirs');
if (empty($create_mailbox_subdirs)) {
return true;
}

// see https://github.com/postfixadmin/postfixadmin/issues/472
// see https://github.com/postfixadmin/postfixadmin/issues/812 etc
error_log(__FILE__ . ' WARNING : PostfixAdmin no longer supports the imap folder population via config parameters: create_mailbox_subdirs, create_mailbox_subdirs_host, create_mailbox_subdirs_hostport and create_mailbox_subdirs_hostoptions ');

error_log(__FILE__ . ' WARNING : PostfixAdmin no longer supports the imap folder population via config parameters, see https://github.com/postfixadmin/postfixadmin/issues/812');
return true;
}

Expand Down

0 comments on commit 62a7673

Please sign in to comment.