mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 13:56:01 +01:00
possible fix of https://community.cyberpanel.net/t/snappymail-does-not-show-email-folders-for-subdomain-domain-com-websites/40026
This commit is contained in:
@@ -569,6 +569,59 @@ $cfg['Servers'][$i]['LogoutURL'] = 'phpmyadminsignin.php?logout';
|
||||
# WriteToFile.write(lines)
|
||||
# WriteToFile.close()
|
||||
|
||||
### Enable plugins and enable mailbox creation plugin
|
||||
|
||||
labsDataLines = open(labsPath, 'r').readlines()
|
||||
PluginsActivator = 0
|
||||
WriteToFile = open(labsPath, 'w')
|
||||
for lines in labsDataLines:
|
||||
if lines.find('[plugins]') > -1:
|
||||
PluginsActivator = 1
|
||||
WriteToFile.write(lines)
|
||||
elif PluginsActivator and lines.find('enable = '):
|
||||
WriteToFile.write(f'enable = On\n')
|
||||
elif PluginsActivator and lines.find('enabled_list = '):
|
||||
WriteToFile.write(f'enabled_list = "mailbox-detect"\n')
|
||||
PluginsActivator = 0
|
||||
else:
|
||||
WriteToFile.write(lines)
|
||||
WriteToFile.close()
|
||||
|
||||
## enable auto create in the enabled plugin
|
||||
PluginsFilePath = '/usr/local/lscp/cyberpanel/rainloop/data/_data_/_default_/configs/plugin-mailbox-detect.json'
|
||||
|
||||
WriteToFile = open(PluginsFilePath, 'w')
|
||||
WriteToFile.write("""{
|
||||
"plugin": {
|
||||
"autocreate_system_folders": true
|
||||
}
|
||||
}
|
||||
""")
|
||||
WriteToFile.close()
|
||||
|
||||
command = f'chown lscpd:lscpd {PluginsFilePath}'
|
||||
Upgrade.executioner(command, 'verify certificate', 0)
|
||||
|
||||
command = f'chmod 600 {PluginsFilePath}'
|
||||
Upgrade.executioner(command, 'verify certificate', 0)
|
||||
|
||||
### now download and install actual plugin
|
||||
|
||||
command = f'mkdir /usr/local/lscp/cyberpanel/rainloop/data/_data_/_default_/plugins/mailbox-detect'
|
||||
Upgrade.executioner(command, 'verify certificate', 0)
|
||||
|
||||
command = f'chmod 700 /usr/local/lscp/cyberpanel/rainloop/data/_data_/_default_/plugins/mailbox-detect'
|
||||
Upgrade.executioner(command, 'verify certificate', 0)
|
||||
|
||||
command = f'wget -O /usr/local/lscp/cyberpanel/rainloop/data/_data_/_default_/plugins/mailbox-detect/index.php https://raw.githubusercontent.com/the-djmaze/snappymail/master/plugins/mailbox-detect/index.php'
|
||||
Upgrade.executioner(command, 'verify certificate', 0)
|
||||
|
||||
command = f'chmod 644 /usr/local/lscp/cyberpanel/rainloop/data/_data_/_default_/plugins/mailbox-detect/index.php'
|
||||
Upgrade.executioner(command, 'verify certificate', 0)
|
||||
|
||||
command = f'chown lscpd:lscpd /usr/local/lscp/cyberpanel/rainloop/data/_data_/_default_/plugins/mailbox-detect/index.php'
|
||||
Upgrade.executioner(command, 'verify certificate', 0)
|
||||
|
||||
|
||||
os.chdir(cwd)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user