Change the domain user without using the panel
Massive change is possible with remote api-mail accounts? For example, change a user's maildir. Just as when you create a mailbox with the following function:
$params = array( 'server_id' => 1,
'name' => 'name of user1',
'email' => 'email@example.com',
'password' => 'somepass',
'quota' => '0',
'maildir' => '/var/vmail/domain.tld/user1'
'homedir' => '/var/vmail','uid' => '5000',
'gid' => '5000',
'postfix' => 'y',
'disableimap' => '0',
'disablepop3' => '0');
$client_id = 0;
$domain_id = $client->mail_user_add($session_id,$client_id, $params);
What would happen if I just change by sql query maildir field value of a user? It would make the mailbox pass another location in /var/vmail/? For example, I need to change a user firstname.lastname@example.org email@example.com, as you might do this?
user1 maildir is /var/vmail/domain1.tld/user1 and need to be /var/vmail/domain2.tld/user1
But the function you posted above is wrong for that purpose as it will add a new user instaed of modifying a existing account. To modify existing accounts, use the update function.
For example in your case above, the direct change in the sql db will result in two mailboxes, a complete old one which is inaccessible and a partly created new one which misses functions like quota etc.
Where to find documentation on the update function?
The remote api documentation has been released as part of the current beta. You can find it in the beta tar.gz in the file in the remot_client sub directory:
|All times are GMT +2. The time now is 01:39.|
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.