From 38779d5d4bd73f5e2e86323f2f65ce2e5d5cf02f Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Fri, 23 Aug 2019 01:18:16 +0500 Subject: [PATCH] bug fix cPanel Importer: Import All emails folder --- plogical/backupSchedule.py | 1 - plogical/cPanelImporter.py | 14 ++++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/plogical/backupSchedule.py b/plogical/backupSchedule.py index ce4f933a3..126e0f84d 100755 --- a/plogical/backupSchedule.py +++ b/plogical/backupSchedule.py @@ -87,7 +87,6 @@ class backupSchedule: os.remove(pathToFile) except: pass - logging.CyberCPLogFileWriter.writeToFile(tempStoragePath) return 1, tempStoragePath elif status.find("[5009]") > -1: diff --git a/plogical/cPanelImporter.py b/plogical/cPanelImporter.py index df0d238f3..d5720728c 100644 --- a/plogical/cPanelImporter.py +++ b/plogical/cPanelImporter.py @@ -784,26 +784,32 @@ class cPanelImporter: 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