no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | tech:linux:postfix_client_tls [2014/11/15 15:13] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Postfix Client TLS Support ====== | ||
+ | |||
+ | ===== Resource ===== | ||
+ | http:// | ||
+ | |||
+ | ====== Instructions ====== | ||
+ | ===== Generating SSL Key ===== | ||
+ | Run the following commands: \\ | ||
+ | |||
+ | < | ||
+ | cd / | ||
+ | mkdir ssl | ||
+ | cd ssl | ||
+ | openssl genrsa -rand / | ||
+ | chmod 400 smtpd.key | ||
+ | openssl req -new -key smtpd.key > smtpd.csr | ||
+ | # Enter the certificate information. | ||
+ | # The " | ||
+ | </ | ||
+ | |||
+ | ===== Self-sign the certificate ===== | ||
+ | |||
+ | Run the following commands: | ||
+ | |||
+ | < | ||
+ | openssl req -days 36524 -x509 -key smtpd.key -in smtpd.csr > smtpd.crt | ||
+ | cat smtpd.crt smtpd.key > smtpd.pem | ||
+ | </ | ||
+ | |||
+ | ===== Configure Postfix to use SSL ===== | ||
+ | |||
+ | Edit main.cf (located in / | ||
+ | |||
+ | < | ||
+ | smtp_tls_cert_file=/ | ||
+ | smtp_tls_key_file=$smtp_tls_cert_file | ||
+ | smtp_tls_loglevel=1 | ||
+ | smtp_tls_note_starttls_offer=yes | ||
+ | smtp_use_tls=yes | ||
+ | smtpd_tls_cert_file=/ | ||
+ | smtpd_tls_key_file=$smtp_tls_cert_file | ||
+ | smtpd_use_tls=yes | ||
+ | smtpd_tls_received_header=yes | ||
+ | </ | ||
+ | |||
+ | ===== Configure Dovecot ===== | ||
+ | Edit dovecot.conf (typically located in /etc) adding the following lines: | ||
+ | |||
+ | < | ||
+ | ssl_cert_file = / | ||
+ | ssl_key_file = / | ||
+ | </ | ||
+ | |||
+ | ===== Restart ===== | ||
+ | Restart postfix and dovecot. | ||