PostfixAdmin Cannot Create Maildir

Discussion in 'HOWTO-Related Questions' started by asyadiqin, Apr 6, 2008.

  1. asyadiqin

    asyadiqin New Member

    Hi,

    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

    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

    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.
     
  2. falko

    falko Super Moderator ISPConfig Developer

    What happens when you run the script as the Apache user on the shell?
     
  3. asyadiqin

    asyadiqin New Member

    I have no idea how to run the script or anything as user apache. How can I do this? I tried su apache and it gave me an error.
     
  4. falko

    falko Super Moderator ISPConfig Developer

    What error?
    Is apache the Apache user? Take a look at your Apache configuration to find out who's the Apache user.
     
  5. asyadiqin

    asyadiqin New Member

    Apache is running as user and group apache. I have tried testing some by creating a page and adding the following :-

    Both gave me the right results. But putting the command to run the scripts are just not working and I get no errors at all. I even added apache to the sudoers file with full access to see it that works but still doesn't work.

    I don't know what else could be wrong. As far as I know, the scripts work as I am able to do it in the commandline. So I'm still confused about this.
     
  6. topdog

    topdog New Member HowtoForge Supporter

    Thats not very prudent. It means when you apache is compromised then the attacker can run any command on your system without requiring a password
     
  7. asyadiqin

    asyadiqin New Member

    I know. Its merely for me to test. But still it doesn't work. I've removed that from the sudoers file as soon as I know it doesn't work.

    What else could be the problem? Anyone have similar issues installing the current version of PostfixAdmin?
     
  8. topdog

    topdog New Member HowtoForge Supporter

    Are you sure the variables you are passing from php are actually getting to the shell script ?

    Add a debug section at the top to echo the values to a temp file and see if the shell script actually got the values.
     
  9. asyadiqin

    asyadiqin New Member

    Yes. I did test it before as follows

    I can see the command on the browser, and it shows that it was running as user 'apache' but the directory is still not created. Any ideas?
     
  10. topdog

    topdog New Member HowtoForge Supporter

    Thats not what i mean am talking of the shell not php

    something like

    echo "$1 -> $2 -> $3" >> /tmp/shell-test

    inside /usr/sbin/maildirmake.sh
     
  11. asyadiqin

    asyadiqin New Member

    - Closing Thread -

    Hi guys .... I've decided to close this thread as its taking too much time for me to find a solution to fix this. As I need to get the server up ASAP, I would have to look for alternative ways to manage mail user rather than use PostfixAdmin and find a fix to using it.

    Thanks to those who submitted post to this thread.

    Regards,

    Allie Syadiqin
     
  12. eliufoo

    eliufoo New Member

    Hi,

    I know you have close this thread but, I'm facing the same problem and i'm curios if a solution was found?

    Regards,
    Elly
     
  13. asyadiqin

    asyadiqin New Member

    Hi, I have decided not to use the latest version of PostfixAdmin as I had issues with it, as you can see from my post. I had similar issues with the last version but I managed to sort it out by editing some of the codes. However, its been more than a year since I did that and I can't really recall what I did.
     
  14. space007

    space007 New Member

    Virtual Users With Postfix, PostfixAdmin, Courier, Mailscanner, ClamAV On CentOS

    too bad, I have the same problem with mailbox creation in postfix admin.

    The howto does not reflect the current version :(

    Code:
    tar -zxvf postfixadmin-2.*.*.tgz 
    I used the postfixadmin-2.2.1.1 version, and now I dont know further steps on the p5 related to changing phpcode to use custom bash script for mailbox creation and deletion.

    I do have just index.php in the admin..
    I changed the second line with the first line above.


    again, I have just index.php in the admin..
    no idea what to change into what :(

    Can anybody help me into the right direction?

    Regrds,
    Space
     
  15. eliufoo

    eliufoo New Member

    Hi space007,

    It took me a some time to get my MTA working using the that tutorial. Hence, will be glad to help with your problem.

    Can you post the error logs?

    My problem was related to file directory permission.

    Elly
     
  16. space007

    space007 New Member

    Thanks for the interest eliufoo,

    As said above, my problem is the configuration of postfixadmin with maildirmake
    I dont know where to put the code inside postfixadmin to use the mentioned bash scripts to create and delete mailboxes :confused:
    In the tutorial i didnt find where to put and/or change the php code to use this bash scripts :eek:

    Can you help me ?

    S.
     
  17. eliufoo

    eliufoo New Member

    Please post your log file errors.
    It could be a permission issue

    Elly
     
  18. space007

    space007 New Member

    I said I didnt arrive to the part of running it. I said exactly where am I stuck.
    How can I give you logs then ?

    I dont think is logical to avoid the step of creating/deleting the mailbox within postfix admin, and then post the error logs :(

    regrds
     
  19. milandred

    milandred New Member

    was any one able to solved the problem.

    on page5.. create-mailbox.php and delete.php



    Next we will tweak Postfix Admin. Change both create_mailbox.php in the main and admin folder.




    system("sudo /usr/sbin/maildirmake.sh ".$fDomain." ".$fUsername. " ". $quota);
    db_log ($SESSID_USERNAME, $fDomain, "create mailbox","$fUsername");


    Change both delete.php in the main and admin folder.

    Code:

    db_query ("DELETE FROM vacation WHERE email='$fDelete' AND domain='$fDomain'");
    $userarray=explode("@",$fDelete);
    $user=$userarray[0];
    $domain=$userarray[1];
    system("sudo /usr/sbin/maildirdel.sh ".$domain.” “.$user);
    db_log ($SESSID_USERNAME, $fDomain, "delete mailbox", $fDelete);




    any clue???

    thanks.
     
  20. space007

    space007 New Member

    B'cause of the tight schedule, I moved to a complete solution untangle.com/. My co-workers are happy, shiny icons, clicks, graphs ...
    Non associated with them in any way, besides using they product.


    Regards
     

Share This Page