LetsEncrypt

# Using LetsEncrypt with SurgeMail

This pages shows how to use letsencrypt with SurgeMail to create SSL certificates.

# Windows Instructions (Linux below)

1. Install SurgeMail 7.3f-40 or later!
2. Set g_ssl_per_dom "true" if you want certificates for each domain. (optional)
3. Download and uncompress https://github.com/PKISharp/win-acme/releases --> c:\letsencrypt
4. Modifying /etc/surgemail.ini and adjust g_webmail_port "80" and g_webmail_secure_port "443" and restart surgemail
5. tellmail letsencrypt
6. cd \letsencrypt
7. \surgemail\lets.cmd
8. In surgemail.ini set g_letsencrypt "C:\ProgramData\win-acme\httpsacme-v01.api.letsencrypt.org"
9. tellmail reload
10. tellmail letsencrypt_copy

Test the new certificate. Browse to your secure url:

https://mail.your.domain.name

# Linux Instructions

1. Stop Apache if its running, and uninstall it (unless you want it, in which case use apache to generate the certificates and then copy them to surgemail)
2. Install letsencrypt certbot if it isn't on your system:
3. Install 'cerbot' instructions are here: https://certbot.eff.org/
4. Modifying /etc/surgemail.ini and adjust g_webmail_port "80" and g_webmail_secure_port "443" and restart surgemail.
5. Set g_ssl_per_dom "true" if you want certificates for each domain.
6. tellmail letsencrypt
7. cd (path to certbot)
8. source \surgemail\lets.cmd
9. set g_letsencrypt "/etc/letsencrypt/live/"
10. tellmail letsencrypt_copy

Test the new certificate. Browse to your secure url:

https://mail.your.domain.name