remote api - mail_user_add help

Discussion in 'ISPConfig 3 Priority Support' started by Turbanator, Jul 12, 2016.

  1. Turbanator

    Turbanator Member HowtoForge Supporter

    I'm trying to use the remote api for adding an email user to a domain. I have it creating the user but a few db fields in dbispconfig.mail_user don't seem to update correctly. The main one is sysgroup_id. When I create using ispc, the sysgroup_id updates to 0 which works fine. When I use remote api, it updates to 1 by default.
    Can someone point me to the correct parameter to set that?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Please pass 0 as $client_id to the api call, $client_id = 0 is the admin.
     
  3. Turbanator

    Turbanator Member HowtoForge Supporter

    this didn't seem to help. it's still populating the db with sys_groupid = 1.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Which ISPConfig version do you use and please post the code that you use.
     
  5. Turbanator

    Turbanator Member HowtoForge Supporter

    ispc: 3.0.5.4p8

    Here are the params being passed.

    Code:
    $params = array(
                        "email" => $data["email"],
                        "login" => $data["email"],
                        "password" => $data["password"],
                        "name" => $data["name"],
                        "quota" => "0",
                        "disablepop3" => "y",
                        "server_id" => "2",
                        "uid" => "5000",
                        "gid" => "5000",
                        "client_id" => "0",
                        "maildir" => "/var/vmail/domain.com/" . $data["user"],
                        "homedir" => "/var/vmail",
                        "move_junk" => "Y",
                        "postfix" => "y"                   //Enable Receiving
                    );
    
    
                    $affected_rows = $client->mail_user_add($session_id, $client_id, $params);
    
    I decided to try and pass sys_groupid => "0" just to test , but it still stored as 1.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    The variable $client_id is not a value in the params array, please see function call:

    $affected_rows = $client->mail_user_add($session_id, $client_id, $params);
     
  7. Turbanator

    Turbanator Member HowtoForge Supporter

    Sorry Till, maybe I'm just not understanding it. I removed
    "client_id" => "0",
    from the params array and passed it as $client_id = 0; for the function, but it's still saving as sys_groupid = 1 in mail_user table.
     

Share This Page