server disaster

Discussion in 'Installation/Configuration' started by chief, Jul 2, 2018.

  1. chief

    chief Member HowtoForge Supporter

    Hi,
    My original server was on debian. fairly up to date, like a 2 weeks ago. The raid died, i managed to backup all databases, websites.I wasnt so lucky with the emails, i had to use a recovery cd and i managed to mount the raid drives. scp all mail directories to another pc.
    As a temporary measure i have moved all those domains to another server i have while i create seperate dns, web, database, control panel etc installation on 5 machines i have ready.
    My issue is:
    how can i move on to temporary machine with different hostname the content of vmail/domains/emails for those users. i see a hostname in the name of each email and the ending part is different.
    is there any way i can convert, rename etc those email file to work on a different named server.
    I would have used imapsync but server wont boot, like i said earlier.

    dave
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    I don't understand that part. What mail server does that?
    I use postfix + dovecot. E-mails are stored under /var/vmail. First subdir is mail domain, then mailbox name. Create on new host a mail account, then copy the mail files into that users directory.
    Use Internet search engines with
    Code:
    move email directory to new host
     
  3. chief

    chief Member HowtoForge Supporter

    Hi thanks for the reply
    The files inside /var/vmail/domain.name/user/Maildir/cur/******7401.M2721******.odin,S=***05,W=***57:2,RSa
    all show the hostname odin inside the email name. and the other server where i want to move the emails also has the hostname in those emails also.
    check yours to see if yours also has hostname. I did try dropping an email in to /var/vmail/domain.name/user/Maildir/cur and while i was logged in to webmail, it errored. when i removed the test email it worked again, so name is key. not sure how i proceed.
    both servers are different hostnames.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    I copied many mail servers in the past years, the name of the actual mail files does not matter. You just have to copy over the complete maildir as it is from server a to server b, that's all. Hostnames of the servers are not relevant for that.
     
  5. chief

    chief Member HowtoForge Supporter

    does it matter as if they started using the email account on new machine and im adding older emails?
     
  6. chief

    chief Member HowtoForge Supporter

    sorry
    thank for reply
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    No, as each mail is in it's own file, so no emails get overwritten. The dovecot index might get corrupted though, but dovecot recognizes and fixes that automatically. Just ensure that both servers use maildir, but that's the default for an ISPConfig setup.
     
  8. chief

    chief Member HowtoForge Supporter

    cool, thanks till
     
  9. chief

    chief Member HowtoForge Supporter

    hmm,
    Im getting this
    ERROR: Connection dropped by IMAP server.
    Query: FETCH 2800:2814 (FLAGS UID RFC822.SIZE INTERNALDATE BODY.PEEK[HEADER.FIELDS (Date To Cc From Subject X-Priority Importance Priority Content-Type)])
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Which message do you get in the mail.log file of the server?
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    and you are sure that all files and folders that you copied are owned by the correct user and group 'vmail'?
     
  12. chief

    chief Member HowtoForge Supporter

    Jul 3 17:49:26 odin dovecot: imap-login: Login: user=<user@domain>, method=PLAIN, rip=::1, lip=::1, mpid=29082, secured, session=<abPOGBtwwwAAAAAAAAAAAAAAAAAAAAAB>
    Jul 3 17:49:26 odin dovecot: imap(usero@domain): Error: open(/var/vmail/domain/user/Maildir/cur/1530012403.M938601P18862.freya,S=3046868,W=3086663:2,Sa) failed: Permission denied (euid=5000(vmail) egid=5000(vmail) missing +r perm: /var/vmail/domain/user/Maildir/cur/1530012403.M938601P18862.hostname,S=3046868,W=3086663:2,Sa)
    Jul 3 17:49:26 hostname dovecot: imap(user@domain): Disconnected: Internal error occurred. Refer to server log for more information. [2018-07-03 17:49:26] in=290 out=14837
     
  13. chief

    chief Member HowtoForge Supporter

    hah..
    /var/vmail/domain/user/Maildir/cur# chown -R vmail:vmail *
    sorted,
    thanks till
     

Share This Page