0135.html 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  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. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  7. <script type="text/javascript">
  8. $(function(){
  9. $('textarea').each(function(i,e){
  10. theTextarea = $(this);
  11. theTextarea.height((theTextarea[0].scrollHeight-5) +'px');
  12. });
  13. $('li').each(function(i,e){
  14. var uuid = 'li_' + Math.floor(Math.random() * Math.floor(1000000)).toString() + '_' + i.toString();
  15. $(this).contents().wrap('<span id="'+ uuid +'"><label for="cb_'+ uuid +'"></label></span>');
  16. $(this).prepend('<input type="checkbox" class="completeBox" id="cb_' + uuid +'" rel="'+ uuid +'" />')
  17. });
  18. $('code,div.codeBlock,textarea.codeBlock').each(function(i,e){
  19. theElement = $(this);
  20. var lines = theElement.html().split("\n");
  21. theElement.empty();
  22. for(l=0;l<lines.length;l++){
  23. if($.trim(lines[l]) != '' && $.trim(lines[l]).substr(0,1) != '#' && $.trim(lines[l]).indexOf(' #') == -1 && lines[l].substr(0, 4).toUpperCase() != 'REM '){
  24. theElement.append('<input type="image" src="images/clipboard.png" value="" class="copy-text" rel="copy_'+ i +'_'+ l +'" data-clipboard-text="'+ lines[l].replace(/"/g, '&quot;') +'" /><span id="copy_'+ i +'_'+ l +'">'+ lines[l] +'</span>');
  25. } else {
  26. theElement.append(lines[l]);
  27. }
  28. }
  29. });
  30. $(document).on('click','input.copy-text',function(){
  31. theButton = $(this);
  32. $('input.copy-text').attr('src','images/clipboard.png');
  33. $('span.copy-animation,span.copy-animation-ps').removeClass('copy-animation copy-animation-ps');
  34. try {
  35. if($('#'+ theButton.attr('rel')).parent('div').hasClass('PS')){
  36. $('#'+ theButton.attr('rel')).addClass('copy-animation-ps');
  37. } else {
  38. $('#'+ theButton.attr('rel')).addClass('copy-animation');
  39. }
  40. navigator.clipboard.writeText(theButton.data('clipboard-text').replace(/<[^>]*>?/gm, ''));
  41. theButton.attr('src','images/clipboard_active.png');
  42. } catch(err) {
  43. }
  44. return false;
  45. });
  46. $(document).on('click','input.completeBox',function(){
  47. theBox = $(this);
  48. $('#'+ theBox.attr('rel')).addClass('strikethrough');
  49. theBox.prop('disabled',true);
  50. theBox.parent('li').prevAll().each(function(i,e){
  51. theLI = $(this);
  52. if(theLI.find('input[type=checkbox]').not(':checked')){
  53. $('#'+ theLI.find('input[type=checkbox]').attr('rel')).addClass('strikethrough');
  54. theLI.find('input[type=checkbox]').prop('checked',true).prop('disabled',true);
  55. }
  56. });
  57. });
  58. if(window.self !== window.top){
  59. window.parent.$('iframe.stepsFrame').height((this['scrollingElement']['scrollHeight']+20) +'px');
  60. }
  61. });
  62. </script>
  63. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  64. </head>
  65. <body>
  66. <div id="gridContainer">
  67. <div class="topMargin"></div>
  68. <div id="listName" class="topMargin">
  69. <h1>Advanced Setup of hMailServer E-Mail Server Create and Apply SSL Cert</h1>
  70. </div>
  71. <div></div>
  72. <div id="content">
  73. <h2>Create Your SSL Certificate</h2>
  74. <ol>
  75. <li>Launch XCA</li>
  76. <li>Open the PKI database if it is not already (File &gt; Open DataBase), enter password</li>
  77. <li>Click on the Certificates tab, right click on your Intermediate CA certificate</li>
  78. <li>Select New</li>
  79. <li>On the Source tab, make sure Use this Certificate for signing is selected</li>
  80. <li>Verify your Intermediate CA certificate is selected from the drop down</li>
  81. <li>Click the Subject tab</li>
  82. <li>Complete the Distinguished Name section
  83. <p>internalName: Email Server SSL<br />
  84. countryName: US<br />
  85. stateOrProvinceName: Virginia<br />
  86. localityName: Northern<br />
  87. organizationName: i12bretro<br />
  88. organizationUnitName: i12bretro Certificate Authority<br />
  89. commonName: smtp.i12bretro.local</p>
  90. </li>
  91. <li>Click the Generate a New Key button</li>
  92. <li>Enter a name and set the key size to at least 2048</li>
  93. <li>Click Create</li>
  94. <li>Click on the Extensions tab</li>
  95. <li>Select End Entity from the type list</li>
  96. <li>Click Edit next to Subject Alternative Name</li>
  97. <li>Add any DNS or IP addresses that the certificate will identify<br />
  98. smtp.domain<br />
  99. imap.domain<br />
  100. pop3.domain</li>
  101. <li>Update the validity dates to fit your needs</li>
  102. <li>Click the Key Usage tab</li>
  103. <li>Under Key Usage select Digital Signature, Key Enchiperment</li>
  104. <li>Under Extended Key Usage select Web Server Authentication</li>
  105. <li>Click the Netscape tab</li>
  106. <li>Select SSL Server</li>
  107. <li>Click OK to create the certificate</li>
  108. </ol>
  109. <h2>Exporting Required Files</h2>
  110. <ol>
  111. <li>In XCA, click on the Certificates tab</li>
  112. <li>Right click the SSL certificate &gt; Export &gt; File</li>
  113. <li>Set the file name with a .crt extension and verify the export format is PEM (*.crt)</li>
  114. <li>Click OK</li>
  115. <li>Click the Private Keys tab</li>
  116. <li>Right click the private key generated for the SSL certificate &gt; Export &gt; File</li>
  117. <li>Set the file name with a .key extension and verify the export format is PEM private (*.pem)</li>
  118. <li>Click OK</li>
  119. </ol>
  120. <h2>Setting Up SSL in hMailServer</h2>
  121. <ol>
  122. <li>Launch hMailServer Administrator</li>
  123. <li>Select localhost &gt; Click Connect &gt; Login with the administrative password</li>
  124. <li>Expand Settings &gt; Advanced &gt; SSL Certificates &gt; Click Add...</li>
  125. <li>Give the certificate a friendly name</li>
  126. <li>Browse to the certificate and key files exported earlier
  127. <ul>
  128. <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>
  129. </ul>
  130. </li>
  131. <li>Click Save</li>
  132. <li>Expand Settings &gt; Advanced &gt; IP Ranges</li>
  133. <li>Select the LAN IP Range created previously</li>
  134. <li>Check the Require SSL/TLS for authentication box</li>
  135. <li>Click Save</li>
  136. <li>Expand Settings &gt; Advanced &gt; TCP/IP Ports</li>
  137. <li>Click on 0.0.0.0 / 25 / SMTP</li>
  138. <li>Update the port to 465, Select SSL/TLS from the Connection Security dropdown, Select the SSL certificate imported previously</li>
  139. <li>Click Save</li>
  140. <li>Click No to the popup to restart the service</li>
  141. <li>Click on 0.0.0.0 / 143 / IMAP</li>
  142. <li>Update the port to 993, Select SSL/TLS from the Connection Security dropdown, Select the SSL certificate imported previously</li>
  143. <li>Click Save</li>
  144. <li>Click Yesto the popup to restart the service</li>
  145. </ol>
  146. <h2>Setting Up SSL in the Client</h2>
  147. <ol>
  148. <li>Launch Thunderbird</li>
  149. <li>Right click on the e-mail address setup previously &gt; Settings &gt; Server Settings</li>
  150. <li>Set Connection security to SSL/TLS</li>
  151. <li>Verify the port updated to 993</li>
  152. <li>Click Outgoing Server (SMTP)</li>
  153. <li>Set Connection security to SSL/TLS</li>
  154. <li>Verify the port updated to 465</li>
  155. <li>Click OK</li>
  156. <li>Click OK</li>
  157. <li>Click Tools &gt; Options &gt; Advanced &gt; Security &gt; Manage Certificates</li>
  158. <li>Click Import...</li>
  159. <li>Browse to the CA-chain.pem file exported earlier</li>
  160. <li>Click OK</li>
  161. </ol>
  162. <h2>Testing Your New E-Mail Server</h2>
  163. <ol>
  164. <li>In hMailServer Administrator, Expand Utilities &gt; Server sendout</li>
  165. <li>Select Specific domain and select the domain created earlier from the dropdown</li>
  166. <li>Fill out the form to send a test e-mail &gt; Click Send</li>
  167. <li>Back in Thunderbird, click the Get Messages button</li>
  168. <li>The test email should arrive in the inbox</li>
  169. </ol>
  170. </div>
  171. </div>
  172. </body>
  173. </html>