mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-11 15:56:11 +01:00
bug fix cPanel Importer: Import All emails folder
This commit is contained in:
@@ -87,7 +87,6 @@ class backupSchedule:
|
|||||||
os.remove(pathToFile)
|
os.remove(pathToFile)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
logging.CyberCPLogFileWriter.writeToFile(tempStoragePath)
|
|
||||||
return 1, tempStoragePath
|
return 1, tempStoragePath
|
||||||
|
|
||||||
elif status.find("[5009]") > -1:
|
elif status.find("[5009]") > -1:
|
||||||
|
|||||||
@@ -784,26 +784,32 @@ class cPanelImporter:
|
|||||||
|
|
||||||
if self.mailFormat == cPanelImporter.MailDir:
|
if self.mailFormat == cPanelImporter.MailDir:
|
||||||
eUser.mail = 'maildir:/home/vmail/%s/%s/Maildir' % (items, it)
|
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)
|
command = 'mkdir -p %s' % (MailPath)
|
||||||
ProcessUtilities.normalExecutioner(command)
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
|
command = 'rm -rf %s/Maildir' % (MailPath)
|
||||||
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
MailPathInBackup = '%s/%s' % (FinalMailDomainPath, it)
|
MailPathInBackup = '%s/%s' % (FinalMailDomainPath, it)
|
||||||
|
|
||||||
command = 'cp -R %s/* %s' % (MailPathInBackup, MailPath)
|
command = 'mv %s %s/Maildir' % (MailPathInBackup, MailPath)
|
||||||
subprocess.call(command, shell=True)
|
subprocess.call(command, shell=True)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
eUser.mail = 'mdbox:/home/vmail/%s/%s/Mdbox' % (items, it)
|
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)
|
command = 'mkdir -p %s' % (MailPath)
|
||||||
ProcessUtilities.normalExecutioner(command)
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
|
command = 'rm -rf %s/Mdbox' % (MailPath)
|
||||||
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
MailPathInBackup = '%s/%s' % (FinalMailDomainPath, it)
|
MailPathInBackup = '%s/%s' % (FinalMailDomainPath, it)
|
||||||
|
|
||||||
command = 'cp -R %s/* %s' % (MailPathInBackup, MailPath)
|
command = 'mv %s %s/Mdbox' % (MailPathInBackup, MailPath)
|
||||||
subprocess.call(command, shell=True)
|
subprocess.call(command, shell=True)
|
||||||
|
|
||||||
## Also update password
|
## Also update password
|
||||||
|
|||||||
Reference in New Issue
Block a user