ISPconfig 3.1 mailbox creation method

Discussion in 'Tips/Tricks/Mods' started by Boruzs Gergely, Jan 21, 2019.

  1. Boruzs Gergely

    Boruzs Gergely New Member

    Hi,
    I migrated our old Postfixadmin+courier mailserver to ISPconfig 3.14.
    I used these SQL commands to migrate the database.

    Code:
    insert into mail_domain (sys_userid,sys_groupid,sys_perm_user,sys_perm_group,server_id,domain) select
    '0','1','riud','riud','1',domain from postfix.domain;
    Code:
    insert into mail_user (sys_userid,sys_groupid,sys_perm_user,sys_perm_group,server_id,email,login,password,maildir,quota,homedir)
    select '0','1','riud','riud','1',username,username,password,concat('/var/mail/',maildir),quota,'/var/vmail'
    from postfix.mailbox;
    Code:
    insert into mail_forwarding (sys_userid,sys_groupid,sys_perm_user,sys_perm_group,server_id,source,destination,type)
    select '0','1','riud','riud','1',alias.address,alias.goto,'forward' from
    postfix.alias where (postfix.alias.address != postfix.alias.goto);
    Code:
    update mail_domain set active='y';
    update mail_forwarding set active='y';
    update mail_user set postfix='y';
    Mail domains and mailboxes shown good on the ISPconfig interface.
    I did a resync for all ISPconfig services so it created the mailbox folders in the filesystem.
    I copied te mails and courier files from the old server to the correct locations (../$mailbox/Maildir/).
    I run the courier->dovecot migrate script from the dowecot wiki page.

    It seemed good.
    But,

    When I try to change anything in a user mailbox on the ISPconfig interface randomly recreate the mail folder of the mailbox.
    It worked good with some mailbox and not with another ones.
    I found in the database some user maildir location ended with /.
    All of these mailbox recreated when I click o it on the interface and all mails gone.
    I corrected the maidir fields in the database but some mailbox still recreated when I change it.

    My questions:
    How the ISPconfig mailbox creation method works?
    How th ISPconfig check the mailbox is exist or need maildir creation?

    Thanks,
    Greg
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Create a new mailbox in ISPConfig and compare the paths in the database with the ones you inserted. ISPConfig check if 'maildir' + /Maildir/new and maildir + /Maildir/cur exists. And the old maildir has not been deleted, it got moved to /var/vmail/corrupted/ folder because it did not contain the expected folders.
     
  3. Boruzs Gergely

    Boruzs Gergely New Member

    Ok. I will retest the whole migration proccess considering this information.

    Thanks for the info and the very fast response!!
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    If you like to see the actual code which does the check and creates the maildirs, take a look at /usr/local/ispconfig/server/plugins-available/mail_plugin.inc.php
     

Share This Page