Change default names of special IMAP folders

Aside from Inbox folder, WebMail uses a number of other special folders: Sent, Trash, Drafts and Spam. Upon first login into particular account, WebMail runs a check for each of those folders if there are folders with matching names on IMAP folder tree, otherwise such folder will be created.

The idea behind this plugin is to let you configure folder names automatically recognized as special ones. For example, if accounts on your server contain JunkMail folder and you'd like it to be used as Spam folder by WebMail, you can achieve that using this plugin.

Upon downloading and extracting plugin package, rename its main directory from:

plugin-change-default-folders-master

to:

change-default-folders

Then you'll need to deploy the plugin so that its index file is available at the following location:

data/plugins/change-default-folders/index.php

To enable the plugin, add the following to array defined in data/settings/config.php file:

'plugins.change-default-folders' => true, 

Once the plugin is installed, modify its code and make sure the list of folders includes folder names and types you need to recognize, for example:

public function PluginDomainConstruct(&$oDomain)
{
	$aFolderMap =& $oDomain->GetFoldersMap();
	$aFolderMap = array(
		EFolderType::Inbox => array ('INBOX','Inbox'),
		EFolderType::Sent => array ('Sent','Sent Items'),
		EFolderType::Drafts => 'Drafts',
		EFolderType::Trash => 'Trash',
		EFolderType::Spam => array ('Spam','Junk','JunkMail','Junk Mail')
	);
}