As this took considerable time to put together, I am happy sell the whole php script...
but if you are well versed ...heres the sql to insert into vmail:
--just replace "email" with the username and 'example.com" with your domain
--also replace pasword 1234568 with a random or entered password
--Note the password is in plaintext, urging the user to change on first login, this is because i couldnt find the salt roundcube uses
use vmail;
insert into mailbox (username,password,name,language,storagebasedirectory,storagenode,maildir,quota,domain,transport,department,rank,employeeid,isadmin,isglobaladmin,enablesmtp,enablesmtpsecured,enablepop3,enablepop3secured,enableimap,enableimapsecured,enabledeliver,enablelda,enablemanagesieve,enablemanagesievesecured,enablesieve,enablesievesecured,enableinternal,enabledoveadm,`enablelib-storage`,`enableindexer-worker`,enablelmtp,enabledsync,allow_nets,lastlogindate,lastloginipv4,lastloginprotocol,disclaimer,allowedsenders,rejectedsenders,allowedrecipients,rejectedrecipients,settings,passwordlastchange,created,modified ,expired,active,local_part)
values ('email@example.com','{PLAIN}12345678','email','en_US','/var/vmail','vmail1',concat('example.com/',left('email',1),'/',substring('email',2,1),'/',substring('email',3,1),'/','email-',date_format(now(),'%Y.%m.%d.%H.%i.%s'),'/'),2,'example.com','','','normal','email',0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,NULL,'0000-00-00 00:00:00',0,'',NULL,NULL,NULL,NULL,NULL,NULL,'0000-00-00 00:00:00',now(),now(),'9999-12-31 00:00:00',1,'email');
insert into alias (address,goto,name,moderators,accesspolicy,domain,islist,created,modified,expired,active )
values ('email@example.com','email@example.com','',NULL,'','example.com',0,now(),'0000-00-00 00:00:00','9999-12-31 00:00:00',1);