वही Let’s Encrypt certificate जो आपकी website secure करता है, आपके email connections को भी encrypt कर सकता है। यह guide सबसे common email servers के लिए TLS configure करने को cover करती है।
Email को TLS की Need क्यों है
TLS के बिना, email traffic (passwords और message content सहित) plaintext में भेजा जाता है:
- SMTP (mail भेजना) — port 25/587 default रूप से unencrypted
- IMAP (mail पढ़ना) — port 143 default रूप से unencrypted
- POP3 (mail पढ़ना) — port 110 default रूप से unencrypted
TLS इन connections को उसी तरह encrypt करता है जैसे HTTPS web traffic को encrypt करता है। Modern email clients TLS expect करते हैं और unencrypted connections के बारे में users को warning देंगे।
Certificate Setup
आप अपने web server और email server दोनों के लिए GetHTTPS से same certificate files use कर सकते हैं — बशर्ते certificate उस hostname को cover करे जो आपका email server use करता है (जैसे, mail.example.com)।
अपने mail hostname को cover करने वाला certificate get करें:
- GetHTTPS में,
mail.example.comadd करें (या जो भी hostname आपका MX record point करता है) - आप इसे अपने web domain के साथ include कर सकते हैं:
example.com+www.example.com+mail.example.com - Files download करें:
fullchain.pem,privkey.pem
Postfix (SMTP)
/etc/postfix/main.cf edit करें:
# Outbound mail (भेजने) के लिए TLS
smtp_tls_security_level = may
smtp_tls_loglevel = 1
# Inbound mail (receive करने) के लिए TLS — port 25/587 पर STARTTLS
smtpd_tls_cert_file = /etc/ssl/gethttps/fullchain.pem
smtpd_tls_key_file = /etc/ssl/gethttps/privkey.pem
smtpd_tls_security_level = may
smtpd_tls_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
smtpd_tls_loglevel = 1
Submission (port 587) के लिए, /etc/postfix/master.cf edit करें:
submission inet n - y - - smtpd
-o syslog_name=postfix/submission
-o smtpd_tls_security_level=encrypt
-o smtpd_sasl_auth_enable=yes
Reload करें: sudo systemctl reload postfix
Dovecot (IMAP/POP3)
/etc/dovecot/conf.d/10-ssl.conf edit करें:
ssl = required
ssl_cert = </etc/ssl/gethttps/fullchain.pem
ssl_key = </etc/ssl/gethttps/privkey.pem
ssl_min_protocol = TLSv1.2
ssl_prefer_server_ciphers = no
File path से पहले < पर ध्यान दें — Dovecot file content को inline read करने के लिए इस syntax का use करता है।
Reload करें: sudo systemctl reload dovecot
IMAP/POP3 Ports
| Service | Unencrypted | STARTTLS | Implicit TLS (recommended) |
|---|---|---|---|
| IMAP | 143 | 143 (upgrade) | 993 |
| POP3 | 110 | 110 (upgrade) | 995 |
| SMTP submission | 587 | 587 (upgrade) | 465 (smtps) |
Modern email clients को implicit TLS ports (993, 995, 465) से connect होना चाहिए। इन्हें STARTTLS ports के साथ Dovecot और Postfix में configure करें।
Email TLS Verify करें
# SMTP STARTTLS test
openssl s_client -connect mail.example.com:587 -starttls smtp
# IMAP implicit TLS test
openssl s_client -connect mail.example.com:993
# SMTP implicit TLS (smtps) test
openssl s_client -connect mail.example.com:465
Verify return code: 0 (ok) और अपने certificate details देखें।
Renewal
जब आप अपना Let’s Encrypt certificate renew करें, तो files replace करें और अपने web server और email server दोनों को reload करें:
sudo systemctl reload nginx # Web
sudo systemctl reload postfix # SMTP
sudo systemctl reload dovecot # IMAP
अगर Certbot को --deploy-hook के साथ use कर रहे हैं, तो hook script में email server reload add करें।
FAQ
क्या मैं web और email के लिए same certificate use कर सकता हूं?
हां — बशर्ते certificate के SAN (Subject Alternative Name) में email server का hostname included हो। अगर आपका MX mail.example.com की ओर point करता है, तो certificate request करते समय उस name को include करें।
क्या Let’s Encrypt email server के लिए काम करता है?
हां। Let’s Encrypt certificates standard X.509 certificates हैं जो किसी भी TLS-enabled service के साथ काम करते हैं — सिर्फ web servers ही नहीं। Certificate को पता नहीं होता कि इसे HTTPS, SMTP, IMAP, या किसी और चीज़ के लिए use किया जा रहा है।
क्या मुझे हर email protocol के लिए अलग certificate चाहिए?
नहीं। एक certificate SMTP (Postfix), IMAP (Dovecot), और आपके web server के लिए एक साथ काम करता है। सभी services को same fullchain.pem और privkey.pem की ओर point करें।
Microsoft Exchange के बारे में क्या?
Exchange PFX/PKCS#12 format use करता है। अपनी PEM files को PFX में convert करें, फिर Exchange Admin Center → Servers → Certificates → Import के through import करें। Process IIS certificate installation के similar है।