bug fix cPanel Importer: Import All emails folder

This commit is contained in:
Usman Nasir
2019-08-23 01:18:16 +05:00
parent 61228595b2
commit 38779d5d4b
2 changed files with 10 additions and 5 deletions

View File

@@ -87,7 +87,6 @@ class backupSchedule:
os.remove(pathToFile)
except:
pass
logging.CyberCPLogFileWriter.writeToFile(tempStoragePath)
return 1, tempStoragePath
elif status.find("[5009]") > -1:

View File

@@ -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