DKIM Support.

This commit is contained in:
usmannasir
2018-05-01 00:49:47 +05:00
parent ff9161322a
commit 69a9dcd3d2
10 changed files with 326 additions and 18 deletions

View File

@@ -112,6 +112,7 @@
</navigator>
<panes>
<pane id="Scratches" />
<pane id="Scope" />
<pane id="ProjectPane">
<subPane>
<expand>
@@ -128,7 +129,6 @@
<select />
</subPane>
</pane>
<pane id="Scope" />
</panes>
</component>
<component name="PropertiesComponent">
@@ -166,11 +166,12 @@
<workItem from="1523948661253" duration="7874000" />
<workItem from="1524303326266" duration="7000" />
<workItem from="1524730597265" duration="8000" />
<workItem from="1525085664919" duration="10000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="36382000" />
<option name="totallyTimeSpent" value="36392000" />
</component>
<component name="ToolWindowManager">
<frame x="1466" y="-4" width="1303" height="780" extended-state="6" />
@@ -179,12 +180,12 @@
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
@@ -286,6 +287,35 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/php/caller.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="558">
<caret line="31" column="23" lean-forward="false" selection-start-line="31" selection-start-column="23" selection-end-line="31" selection-end-column="23" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/php/fileManager.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="n#listForTable#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#readFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#writeFileContents#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#createNewFolder#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#createNewFile#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#deleteFolderOrFile#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#compress#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#extract#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#moveFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#copyFileAndFolders#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#renameFileOrFolder#0;n#fileManager#0;n#!!top" expanded="false" />
<element signature="n#cleanInput#0;n#fileManager#0;n#!!top" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/php/fileManager.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">

View File

@@ -2514,6 +2514,96 @@ class preFlightsChecks:
logging.InstallLog.writeToFile(str(msg) + " [installTLDExtract]")
return 0
def installOpenDKIM(self):
try:
count = 0
while (1):
command = 'yum -y install opendkim'
cmd = shlex.split(command)
res = subprocess.call(cmd)
if res == 1:
count = count + 1
preFlightsChecks.stdOut("Trying to install opendkim, trying again, try number: " + str(count))
if count == 3:
logging.InstallLog.writeToFile("Unable to install opendkim, your mail may not end up in inbox. [installOpenDKIM]")
break
else:
logging.InstallLog.writeToFile("Succcessfully installed opendkim!")
preFlightsChecks.stdOut("Succcessfully installed opendkim!")
break
except OSError, msg:
logging.InstallLog.writeToFile(str(msg) + " [installOpenDKIM]")
return 0
except ValueError, msg:
logging.InstallLog.writeToFile(str(msg) + " [installOpenDKIM]")
return 0
return 1
def configureOpenDKIM(self):
try:
## Configure OpenDKIM specific settings
openDKIMConfigurePath = "/etc/opendkim.conf"
configData = """
Mode sv
Canonicalization relaxed/simple
KeyTable refile:/etc/opendkim/KeyTable
SigningTable refile:/etc/opendkim/SigningTable
ExternalIgnoreList refile:/etc/opendkim/TrustedHosts
InternalHosts refile:/etc/opendkim/TrustedHosts
"""
writeToFile = open(openDKIMConfigurePath,'a')
writeToFile.write(configData)
writeToFile.close()
## Configure postfix specific settings
postfixFilePath = "/etc/postfix/main.cf"
configData = """
smtpd_milters = inet:127.0.0.1:8891
non_smtpd_milters = $smtpd_milters
milter_default_action = accept
"""
writeToFile = open(postfixFilePath,'a')
writeToFile.write(configData)
writeToFile.close()
#### Restarting Postfix and OpenDKIM
command = "systemctl start opendkim"
subprocess.call(shlex.split(command))
command = "systemctl enable opendkim"
subprocess.call(shlex.split(command))
##
command = "systemctl start postfix"
subprocess.call(shlex.split(command))
except OSError, msg:
logging.InstallLog.writeToFile(str(msg) + " [configureOpenDKIM]")
return 0
except ValueError, msg:
logging.InstallLog.writeToFile(str(msg) + " [configureOpenDKIM]")
return 0
return 1
def main():
@@ -2588,6 +2678,12 @@ def main():
checks.download_install_CyberPanel(installCyberPanel.InstallCyberPanel.mysqlPassword)
checks.setup_cron()
checks.installTLDExtract()
## Install and Configure OpenDKIM.
checks.installOpenDKIM()
checks.configureOpenDKIM()
checks.modSecPreReqs()
checks.installation_successfull()