I followed the tutorial "Virtual Users With Postfix, PostfixAdmin, Courier, Mailscanner, ClamAV On CentOS" and PostfixAdmin seems to work fine.
However, there seems to be a problem when I added the scripts to add/delete the mailboxes. The script are as follows
if [ ! -d $mail_home/$1 ] ; then
chown -R vmail:vmail $mail_home/$1
chmod -R 700 $mail_home/$1
echo "$mail_home/$1 CREATED"
if [ -d $mail_home/$1 ] ; then
echo "$mail_home/$1/$2 CREATED"
maildirmake -q "$3S" $2
echo "$3S $2 QUOTA CREATED"
chown -R vmail:vmail $mail_home/$1/$2
chmod -R 700 $mail_home/$1/$2
Running the script on the commandline works fine but when I run it in PostfixAdmin, no folders was created at all. This is how PostfixAdmin called the script
system("sudo /usr/sbin/maildirmake.sh ".$fDomain." ".$fUsername. " ". $quota);
I know that the script was run as apache and I have added apache to the sudoers file, but somehow, its still not creating the mail folders. No error was return at all.
Can someone please tell me what could be the problem. I have tried all permissions, even 777 but still nothing. Can someone please help me. Thanks.