0135.html 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Advanced Setup of hMailServer E-Mail Server Create and Apply SSL Cert</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta charset="UTF-8">
  7. <meta name="keywords" content="HMailServer,E-Mail Server,Self-Hosted,SSL,PKI,Home Lab,Private Key Infrastructure,Windows,Home Lab Ideas,Certificate Authority,Certificates,Certificate,Encryption,SSL Certificates,Secure Communication,Self-Signed SSL,System Administration,X Certificate And Key Management,X Certificate Key Manager,XCA,Self-Signed PKI,Public Key Infrastructure,System Administrator,SMTP,Mail Server,How To,Tutorial,i12bretro">
  8. <meta name="author" content="i12bretro">
  9. <meta name="description" content="Advanced Setup of hMailServer E-Mail Server Create and Apply SSL Cert">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. <meta name="revised" content="04/08/2022 05:26:46 AM" />
  12. <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
  13. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  14. <script type="text/javascript" src="includes/js/steps.js"></script>
  15. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  16. </head>
  17. <body>
  18. <div id="gridContainer">
  19. <div class="topMargin"></div>
  20. <div id="listName" class="topMargin">
  21. <h1>Advanced Setup of hMailServer E-Mail Server Create and Apply SSL Cert</h1>
  22. </div>
  23. <div></div>
  24. <div id="content">
  25. <h2>Create Your SSL Certificate</h2>
  26. <ol>
  27. <li>Launch XCA</li>
  28. <li>Open the PKI database if it is not already (File &gt; Open DataBase), enter password</li>
  29. <li>Click on the Certificates tab, right click on your Intermediate CA certificate</li>
  30. <li>Select New</li>
  31. <li>On the Source tab, make sure Use this Certificate for signing is selected</li>
  32. <li>Verify your Intermediate CA certificate is selected from the drop down</li>
  33. <li>Click the Subject tab</li>
  34. <li>Complete the Distinguished Name section
  35. <p>internalName: Email Server SSL<br />
  36. countryName: US<br />
  37. stateOrProvinceName: Virginia<br />
  38. localityName: Northern<br />
  39. organizationName: i12bretro<br />
  40. organizationUnitName: i12bretro Certificate Authority<br />
  41. commonName: smtp.i12bretro.local</p>
  42. </li>
  43. <li>Click the Generate a New Key button</li>
  44. <li>Enter a name and set the key size to at least 2048</li>
  45. <li>Click Create</li>
  46. <li>Click on the Extensions tab</li>
  47. <li>Select End Entity from the type list</li>
  48. <li>Click Edit next to Subject Alternative Name</li>
  49. <li>Add any DNS or IP addresses that the certificate will identify<br />
  50. smtp.domain<br />
  51. imap.domain<br />
  52. pop3.domain</li>
  53. <li>Update the validity dates to fit your needs</li>
  54. <li>Click the Key Usage tab</li>
  55. <li>Under Key Usage select Digital Signature, Key Enchiperment</li>
  56. <li>Under Extended Key Usage select Web Server Authentication</li>
  57. <li>Click the Netscape tab</li>
  58. <li>Select SSL Server</li>
  59. <li>Click OK to create the certificate</li>
  60. </ol>
  61. <h2>Exporting Required Files</h2>
  62. <ol>
  63. <li>In XCA, click on the Certificates tab</li>
  64. <li>Right click the SSL certificate &gt; Export &gt; File</li>
  65. <li>Set the file name with a .crt extension and verify the export format is PEM (*.crt)</li>
  66. <li>Click OK</li>
  67. <li>Click the Private Keys tab</li>
  68. <li>Right click the private key generated for the SSL certificate &gt; Export &gt; File</li>
  69. <li>Set the file name with a .key extension and verify the export format is PEM private (*.pem)</li>
  70. <li>Click OK</li>
  71. </ol>
  72. <h2>Setting Up SSL in hMailServer</h2>
  73. <ol>
  74. <li>Launch hMailServer Administrator</li>
  75. <li>Select localhost &gt; Click Connect &gt; Login with the administrative password</li>
  76. <li>Expand Settings &gt; Advanced &gt; SSL Certificates &gt; Click Add...</li>
  77. <li>Give the certificate a friendly name</li>
  78. <li>Browse to the certificate and key files exported earlier
  79. <ul>
  80. <li>NOTE: The .crt and .key files need to stay on the file system to be read by hMailServer. I place them in the hMailServer installation directory in a real world scenario</li>
  81. </ul>
  82. </li>
  83. <li>Click Save</li>
  84. <li>Expand Settings &gt; Advanced &gt; IP Ranges</li>
  85. <li>Select the LAN IP Range created previously</li>
  86. <li>Check the Require SSL/TLS for authentication box</li>
  87. <li>Click Save</li>
  88. <li>Expand Settings &gt; Advanced &gt; TCP/IP Ports</li>
  89. <li>Click on 0.0.0.0 / 25 / SMTP</li>
  90. <li>Update the port to 465, Select SSL/TLS from the Connection Security dropdown, Select the SSL certificate imported previously</li>
  91. <li>Click Save</li>
  92. <li>Click No to the popup to restart the service</li>
  93. <li>Click on 0.0.0.0 / 143 / IMAP</li>
  94. <li>Update the port to 993, Select SSL/TLS from the Connection Security dropdown, Select the SSL certificate imported previously</li>
  95. <li>Click Save</li>
  96. <li>Click Yesto the popup to restart the service</li>
  97. </ol>
  98. <h2>Setting Up SSL in the Client</h2>
  99. <ol>
  100. <li>Launch Thunderbird</li>
  101. <li>Right click on the e-mail address setup previously &gt; Settings &gt; Server Settings</li>
  102. <li>Set Connection security to SSL/TLS</li>
  103. <li>Verify the port updated to 993</li>
  104. <li>Click Outgoing Server (SMTP)</li>
  105. <li>Set Connection security to SSL/TLS</li>
  106. <li>Verify the port updated to 465</li>
  107. <li>Click OK</li>
  108. <li>Click OK</li>
  109. <li>Click Tools &gt; Options &gt; Advanced &gt; Security &gt; Manage Certificates</li>
  110. <li>Click Import...</li>
  111. <li>Browse to the CA-chain.pem file exported earlier</li>
  112. <li>Click OK</li>
  113. </ol>
  114. <h2>Testing Your New E-Mail Server</h2>
  115. <ol>
  116. <li>In hMailServer Administrator, Expand Utilities &gt; Server sendout</li>
  117. <li>Select Specific domain and select the domain created earlier from the dropdown</li>
  118. <li>Fill out the form to send a test e-mail &gt; Click Send</li>
  119. <li>Back in Thunderbird, click the Get Messages button</li>
  120. <li>The test email should arrive in the inbox</li>
  121. </ol>
  122. </div>
  123. </div>
  124. </body>
  125. </html>