- 论坛徽章:
- 0
|
我印象中以前版本的postfixadmin是不能建立maildir的
要在postfixadmin的create-mailbox.php中加入一些代码
这个
http://blog.chinaunix.net/u/22557/showart_245777.html
是我之前做的,有兴趣的,可以看看
##<---------- SECTION 5 postfixadmin --------->##
主要是这个
##############################################################################################
#
# When using postfixadmin creat a user,it just add the user infor into database(Mysql).
# It does not creat the Maildir for that user,so we change a little bit code of
# the creat-mailbox.php to make postfixadmin create the Maildir for a user when creating it
#
##############################################################################################
cm_dir='/var/www/pa/admin/create-mailbox.php'
toadd1='$fullmaildir = "/vmail/" . $maildir;'
toadd2='$userhome = "/vmail/" . $fDomain . "/" . $myusername;'
toadd3='system("sudo -u vmail mkdir -p $userhome");'
toadd4='system("sudo -u vmail maildirmake $fullmaildir");'
sed -i "176s#\(.*\)#\1\n$toadd1\n\n$toadd2\n$toadd3\n$toadd4#g" $cm_dir
sed -i '60s/\(.*\)/$myusername = escape_string ($_POST['fUsername']);\n\1/g' $cm_dir
sed -i '149s/.*/$maildir = $fDomain . \"\/\" . $myusername . \"\/\" . \"Maildir\/\";/g' $cm_dir
##############################################################################################
#
# When using postfixadmin DELETE a user,it just DELETE the user infor from database(Mysql).
# It does not DELETE the Maildir for that user,so we change a little bit code of
# the delete.php to make postfixadmin DELETE the Maildir for a user when DELETing it
#
##############################################################################################
toaddone='$pieces = explode("@", $fDelete);'
toaddtwo='$todel = "/vmail/" . $fDomain . "/" . $pieces[0];'
toaddthree='system("sudo -u vmail rm -rf $todel");'
sed -i "93s#\(.*\)#\1\n$toaddone\n$toaddtwo\n$toaddthree#g" /var/www/pa/admin/delete.php
##########################################################################################
#
# create the sudoers entry:
# to make apache has permistion to excute the cmd (maildirmake and mkdir )as Vmail ID
#
##########################################################################################
echo "www-data ALL=(vmail)NOPASSWD: ALL" >> /etc/sudoers |
|