Skip to content

Commit 38779d5

Browse files
committed
bug fix cPanel Importer: Import All emails folder
1 parent 6122859 commit 38779d5

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

plogical/backupSchedule.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ def createLocalBackup(virtualHost, backupLogPath):
8787
os.remove(pathToFile)
8888
except:
8989
pass
90-
logging.CyberCPLogFileWriter.writeToFile(tempStoragePath)
9190
return 1, tempStoragePath
9291

9392
elif status.find("[5009]") > -1:

plogical/cPanelImporter.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -784,26 +784,32 @@ def RestoreEmails(self):
784784

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

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

792+
command = 'rm -rf %s/Maildir' % (MailPath)
793+
ProcessUtilities.normalExecutioner(command)
794+
792795
MailPathInBackup = '%s/%s' % (FinalMailDomainPath, it)
793796

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

797800
else:
798801
eUser.mail = 'mdbox:/home/vmail/%s/%s/Mdbox' % (items, it)
799-
MailPath = '/home/vmail/%s/%s/Mdbox/' % (items, it)
802+
MailPath = '/home/vmail/%s/%s' % (items, it)
800803

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

807+
command = 'rm -rf %s/Mdbox' % (MailPath)
808+
ProcessUtilities.normalExecutioner(command)
809+
804810
MailPathInBackup = '%s/%s' % (FinalMailDomainPath, it)
805811

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

809815
## Also update password

0 commit comments

Comments
 (0)