Quoting Laurent Foucher <[email protected]>:
Hi,
Based on the script found on the wiki, default folders are created
if not exists with imp4. Here the script i use :
if (!function_exists('_imp_hook_postlogin')) {
function _imp_hook_postlogin($actionID, $isLogin)
{
global $prefs;
require_once '/usr/share/horde3/imp/lib/Folder.php';
$imp_folder = &IMP_Folder::singleton();
$folder_options = array(
'sent_mail_folder', 'drafts_folder', 'trash_folder',
'spam_folder'
);
foreach ($folder_options as $this_folder) {
$folder = $prefs->getValue($this_folder, true);
if ($folder) {
$folder = IMP::folderPref($folder, true);
if (!$imp_folder->exists($folder)) {
$imp_folder->create($folder, true);
}
}
}
}
}
These folders will all be auto-created the first time they are needed.
If you want to auto-create on first login so that the user actually
sees the mailbox in folder lists, you should use the authinitialized
hook.
michael
___________________________________
Michael Slusarz [[email protected]]
--
IMP mailing list
Frequently Asked Questions: http://horde.org/faq/
To unsubscribe, mail: [email protected]