Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Create new account
PostPosted: 2009-11-17 12:26 
New user
New user

Joined: 2009-11-17 12:07
Posts: 2
Hello,

First, sorry for my english. I speak a broken english.

I'm doing a script in PHP for create a new account (version 5.3). I've alredy read others topic but I can´t resolve my problem. My problems is that the new account don't receive the messages in his folder.

1- I insert the new account in hm_accounts
Code:
$insertquery = mysql_query("INSERT INTO `hm_accounts` (`accountid`, `accountdomainid`, `accountadminlevel`, `accountaddress`, `accountpassword`,
     `accountactive`, `accountisad`, `accountaddomain`, `accountadusername`, `accountmaxsize`, `accountvacationmessageon`, `accountvacationmessage`,
     `accountvacationsubject`, `accountpwencryption`, `accountforwardenabled`, `accountforwardaddress`, `accountforwardkeeporiginal`,
     `accountenablesignature`, `accountsignatureplaintext`, `accountsignaturehtml`, `accountlastlogontime`, `accountvacationexpires`,
     `accountvacationexpiredate`, `accountpersonfirstname`, `accountpersonlastname`)
     VALUES
     (NULL, " . $domainid . ", 0, '" . $user . "@" . $domain . "', md5('" . $pass . "'), 1, 0, '', '', 0, 0, '', '',
     3, 0, '', 0, 0, '', '', '2009-06-12 10:47:55', 0, '2006-11-04 00:00:00', '', '')");



2- I create the new folder
Code:
$strBaseDataPath = 'd:\hmailserver\data\\'.$domain.'\\'. $user . '\\';
mkdir($strBaseDataPath );



3- Insert in hm_imapfolders the new account
Code:
$insertquery = mysql_query("INSERT INTO `hm_imapfolders` (`folderid`,`folderaccountid`,`folderparentid`,`foldername`,`folderissubscribed`,
     `foldercreationtime`,`foldercurrentuid`)
     VALUES
     (" . $idaccount . ", " . $idaccount . ", -1, INBOX, 1, now(), 0)");



The errors that produces are
Quote:
ERROR" 5444 "2009-11-17 01:18:18.651" "Severity: 2 (High), Code: HM4207, Source: DALRecordset::_ReportEOFError, Description: Trying to access data in recordset which was EOF. Column: folderid."
"ERROR" 5444 "2009-11-17 01:18:18.698" "Severity: 3 (Medium), Code: HM5209, Source: SMTPDeliverer::_DeliverToLocalAccount, Description: Unable to create account-level message of 16 for account UserF@127.0.0.1."



Thanks for your help


Top
 Profile  
 
 Post subject: Re: Create new account
PostPosted: 2009-11-17 14:19 
Site Admin

Joined: 2005-07-29 16:18
Posts: 13628
Location: UK
First make sure hMail has write permissions to the new directory you create. If it's not permissions the best thing to do is create an account with hMailAdmin. See what it adds to the database. Then repeat the procedure with your script. As far as I am aware though its only hm_accounts and hm_imapfolders that need to be added.

_________________
If at first you don't succeed, bomb disposal probably isn't for you! ヅ


Top
 Profile  
 
 Post subject: Re: Create new account
PostPosted: 2009-11-17 16:32 
New user
New user

Joined: 2009-11-17 12:07
Posts: 2
I did that but it isn't work. I did admin privileges and copy the data bases changes. I think that must be an index or link between the folder and the data bases.
For example, the messages for the script account have messagefolderid = 0 and the hMail create account have their corrects messagefolderid.

Has anyone done a similar script?? Are there information about de internal server work?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 


Who is online

Users browsing this forum: No registered users and 2 guests



Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group