Migrating from qmail toaster

I’d like to migrate accounts from qmail toaster over to interworx. It uses qmail and vpopmail also, but vpopmail is under /home/vpopmail instead of /var/vpopmail. Also under the user accounts in the maildir folder there is 2 additional folders on the interworx server, .Learn Ham and .Learn Spam. So the question is can i just copy the user folders over to interworx and recreate the .Learn Ham and .Learn Spam folders or should i recreate the users and just copy over the messages? What’s the easiest way? Any help would be greatly appreciated. Thanks.


You’ll need to setup the e-mail accounts in IWorx-CP first so that the user login info is in the vpop db. After that you should be good to copy over Maildirs from the old box to the new. The “learn” directories are specific to the spam filtering that iworx-cp uses and they are optional. Leaving them there is probably the best bet.


Bulk email account creation

Thanks for the response Chris. Next question would be if there is a bulk mail account creation utility or script. Thanks again.

Once you have the siteworx account setup you can use the “vadduser” vpopmail binary to add users just as you would under the toaster. You can script based on that pretty easily.


vadduser script

Thanks Chris. I got the import working very nicely. If some one knows an easy way to export from a qmail toaster please feel free to share. It would come in handy for someone trying to migrate hundreds of accounts. Here is the import info. works like a charm.

Create a File containing the data to be imported in tab delimited format


This is a sample bulkload file. Columns are separated by TABS.

#Remove this header before running the perl script

format: email password fullname

vince@domain.com mypassword Vince Hughs
idan@domain.com password Idan Green

Then run this perl script to import the data and create accounts using vadduser

open (in,addemail) || die “cannot open file $filename: $!”;

@VARS = split(/ /,$
$NAME = $VARS[2];

print "Creating user $USERNAME…$PASSWORD…$NAME…TEST

system("/home/vpopmail/bin/vadduser -c ‘$NAME’ -q 10000000 $USERNAME $PASSWORD");

print "Added mail account for $USERNAME


close(in) || die “cannot close file $filename: $!”;

The export script

Here is the script to export the mail accounts. This should work on any vpopmail install. Hope this comes in handy for someone else.


open VDOM, “/home/vpopmail/bin/vdominfo -d |” or die (“failed to open pipe”);
open(FD,">emaillist") or die("Couldn’t open emaillist
") ;
while (my $line = <VDOM>) {
#process line
#print "$line
@VARS = split(///, $line);
$DOMAIN =~s/^\s+//; # replace leading spaces with nothing
$DOMAIN =~s/\s+$//; #replace trailing spaces with nothing
if ( $DOMAIN eq “” )


#print "$DOMAIN

my @VUSER = /home/vpopmail/bin/vuserinfo -ncCD $DOMAIN;
my $a = 1;
foreach $user (@VUSER) {
#print “$user
if ( $user eq “” ){
if ($a eq 1){
$email = $user.”@”.$DOMAIN;
if ($a eq 2){
$pass = $user;
if ($a eq 3){
$full = $user;
if ($a eq 4){
$a = 1;
print FD "$email $pass $full




Thanks for the script. It came in handy for me while doing a migration from Interworx to another cPanel.


I copied this script to a file named mail-export.pl and ran “perl mail-export.pl” with no console output, nor can I determine any other output. Ideas?