Skip to content
Permalink
Browse files

bug fix cPanel Importer: Import All emails folder

  • Loading branch information...
usmannasir committed Aug 22, 2019
1 parent 6122859 commit 38779d5d4bd73f5e2e86323f2f65ce2e5d5cf02f
Showing with 10 additions and 5 deletions.
  1. +0 −1 plogical/backupSchedule.py
  2. +10 −4 plogical/cPanelImporter.py
@@ -87,7 +87,6 @@ def createLocalBackup(virtualHost, backupLogPath):
os.remove(pathToFile)
except:
pass
logging.CyberCPLogFileWriter.writeToFile(tempStoragePath)
return 1, tempStoragePath

elif status.find("[5009]") > -1:
@@ -784,26 +784,32 @@ def RestoreEmails(self):

if self.mailFormat == cPanelImporter.MailDir:
eUser.mail = 'maildir:/home/vmail/%s/%s/Maildir' % (items, it)
MailPath = '/home/vmail/%s/%s/Maildir/' % (items, it)
MailPath = '/home/vmail/%s/%s' % (items, it)

command = 'mkdir -p %s' % (MailPath)
ProcessUtilities.normalExecutioner(command)

command = 'rm -rf %s/Maildir' % (MailPath)
ProcessUtilities.normalExecutioner(command)

MailPathInBackup = '%s/%s' % (FinalMailDomainPath, it)

command = 'cp -R %s/* %s' % (MailPathInBackup, MailPath)
command = 'mv %s %s/Maildir' % (MailPathInBackup, MailPath)
subprocess.call(command, shell=True)

else:
eUser.mail = 'mdbox:/home/vmail/%s/%s/Mdbox' % (items, it)
MailPath = '/home/vmail/%s/%s/Mdbox/' % (items, it)
MailPath = '/home/vmail/%s/%s' % (items, it)

command = 'mkdir -p %s' % (MailPath)
ProcessUtilities.normalExecutioner(command)

command = 'rm -rf %s/Mdbox' % (MailPath)
ProcessUtilities.normalExecutioner(command)

MailPathInBackup = '%s/%s' % (FinalMailDomainPath, it)

command = 'cp -R %s/* %s' % (MailPathInBackup, MailPath)
command = 'mv %s %s/Mdbox' % (MailPathInBackup, MailPath)
subprocess.call(command, shell=True)

## Also update password

0 comments on commit 38779d5

Please sign in to comment.
You can’t perform that action at this time.