- Added email settings' option to specify Maildir directory (depending on postfix version this is ./Maildir/, .maildir/ or, optionally, one can choose to leave Maildir file structure directly on user's directory. - Fixed database 'insert' command to describe the new structure using specified Maildir directory into new accounts. - Fixed maildirExists function to the new file structure - Fixed older bug that email exclusions that were scheduled (task 7) were not being displayed on overview. - Added entries on 'english' language file for the new entries on panel - Changed task id 6 (delete customer) behavior on scrips/jobs/cron_tasks.php to assure email account is owned to mail uid/gid and the target is an actual directory before zapping it. - Fixed task id 7 (delete customer mail data) behavior on script above to correctly fill and find Maildir and also do additional paranoid checks before zapping the mail account directory. Notice this is not the same from above directory-wise: here we erase a single account's data, while in task id a entire customer set of accounts and domains are eliminated.
44 lines
1.3 KiB
PHP
44 lines
1.3 KiB
PHP
<?php
|
|
|
|
/**
|
|
* This file is part of the Froxlor project.
|
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
|
*
|
|
* For the full copyright and license information, please view the COPYING
|
|
* file that was distributed with this source code. You can also view the
|
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
|
*
|
|
* @copyright (c) the authors
|
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
|
* @package Functions
|
|
*
|
|
*/
|
|
|
|
/**
|
|
* check whether a maildir exists on the filesystem
|
|
*
|
|
* @param array $result all mail-info of customer
|
|
*
|
|
* @return boolean
|
|
*/
|
|
function maildirExists($result = null)
|
|
{
|
|
global $settings;
|
|
|
|
if(is_array($result))
|
|
{
|
|
$loginname = getCustomerDetail($result['customerid'], 'loginname');
|
|
if($loginname !== false) {
|
|
$email_user=substr($result['email_full'],0,strrpos($result['email_full'],"@"));
|
|
$email_domain=substr($result['email_full'],strrpos($result['email_full'],"@")+1);
|
|
$maildirname=trim($settings['system']['vmail_maildirname']);
|
|
$maildir = makeCorrectDir($settings['system']['vmail_homedir'] .'/'. $loginname .'/'. $email_domain .'/'. $email_user . (!empty($maildirname)?'/'.$maildirname:''));
|
|
if(@file_exists($maildir)) {
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
return false;
|
|
}
|