diff --git a/postfix/HISTORY b/postfix/HISTORY index fd640a950..e0592bc05 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -19559,14 +19559,32 @@ Apologies for any names omitted. Workaround: require that a queue file is older than $minimal_backoff_time, before falling back from failed TLS - (both during or after the TLS handshake) to plaintext - delivery. Viktor Dukhovni. Files: smtp/smtp.h, smtp/smtp.c, + to plaintext (both during or after the TLS handshake). + Viktor Dukhovni. Files: smtp/smtp.h, smtp/smtp.c, smtp/lmtp_params.c, smtp/smtp_params.c. -20140219 +20140220 - Workaround: disable the fallback to plaintext when all - recipients have already been bounced or deferred. This - happens for example when TLS breaks after the TLS handshake - while talking to the "final" SMTP server. Wietse and Viktor. - Files: smtp/smtp.h. + Workaround: in case "minimal_backoff_time = $queue_run_delay". + Files: smtp/smtp.c, smtp/smtp_params.c, smtp/lmtp_params.c. + + Cleanup: consolidate the code to log the start of a new + mail transaction in one place, so that code can easily be + added to log TLS status information in addition to the + existing client and SASL status information. Files: + smtpd/smtpd_sasl_proto.h, smtpd/smtpd_sasl_proto.c, + smtpd/smtpd.c. + +20140223 + + Workaround: when a session breaks after the TLS handshake, + do not fall back from TLS to plaintext when all recipients + were deferred or rejected during the TLS phase. Files: + smtp/smtp.h, smtp/smtp_rcpt.c. + + Logging: the TLS client logged that an "Untrusted" TLS + connection was established instead of "Anonymous". + Viktor Dukhovni. File: tls/tls_client.c. + + Documentation: new self-signed certificate example and + updated private CA example. File: proto/TLS_README.html. diff --git a/postfix/README_FILES/TLS_README b/postfix/README_FILES/TLS_README index 404bde7c5..148f721ce 100644 --- a/postfix/README_FILES/TLS_README +++ b/postfix/README_FILES/TLS_README @@ -2011,12 +2011,37 @@ key certificates of remote hosts. In the examples below, user input is shown in bboolldd font, and a "#" prompt indicates a super-user shell. - * Become your own Certificate Authority, so that you can sign your own public - keys. This example uses the CA.pl script that ships with OpenSSL. On some - systems, OpenSSL installs this as /usr/local/ssl/misc/CA.pl. Some systems - install this as part of a package named openssl-perl or something similar. - The script creates a private key in ./demoCA/private/cakey.pem and a public - key in ./demoCA/cacert.pem. + * Self-signed server certificate. + + * Private Certificate Authority. + +SSeellff--ssiiggnneedd sseerrvveerr cceerrttiiffiiccaattee + +The following commands (credits: Viktor Dukhovni) generate and install a +private key and 10-year self-signed certificate for the local Postfix system. +This requires super-user privileges. + + # dir="$(postconf -h config_directory)" + # fqdn=$(postconf -h myhostname) + # ymd=$(date +%Y-%m-%d) + # key="${dir}/key-${ymd}.pem"; rm -f "${key}" + # cert="${dir}/cert-${ymd}.pem"; rm -f "${cert}" + # (umask 077; openssl genrsa -out "${key}" 2048) && + openssl req -new -key "${key}" \ + -x509 -subj "/CN=${fqdn}" -days 3650 -out "${cert}" && + postconf -e \ + "smtpd_tls_cert_file = ${cert}" \ + "smtpd_tls_key_file = ${key}" + +PPrriivvaattee CCeerrttiiffiiccaattee AAuutthhoorriittyy + + * Become your own Certificate Authority, so that you can sign your own + certificates, and so that your own systems can authenticate certificates + from your own CA. This example uses the CA.pl script that ships with + OpenSSL. On some systems, OpenSSL installs this as /usr/local/openssl/misc/ + CA.pl. Some systems install this as part of a package named openssl-perl or + something similar. The script creates a private key in ./demoCA/private/ + cakey.pem and a public key in ./demoCA/cacert.pem. % //uussrr//llooccaall//ssssll//mmiisscc//CCAA..ppll --nneewwccaa CA certificate filename (or enter to create) @@ -2032,8 +2057,7 @@ indicates a super-user shell. * Create an unpassworded private key for host foo.porcupine.org and create an unsigned public key certificate. - % ooppeennssssll rreeqq --nneeww --nnooddeess --kkeeyyoouutt ffoooo--kkeeyy..ppeemm --oouutt ffoooo--rreeqq..ppeemm --ddaayyss - 336655 + % ooppeennssssll rreeqq --nneeww --nnooddeess --kkeeyyoouutt ffoooo--kkeeyy..ppeemm --oouutt ffoooo--rreeqq..ppeemm Using configuration from /etc/ssl/openssl.cnf Generating a 1024 bit RSA private key ........................................++++++ @@ -2065,7 +2089,7 @@ indicates a super-user shell. * Sign the public key certificate for host foo.porcupine.org with the Certification Authority private key that we created a few steps ago. - % ooppeennssssll ccaa --oouutt ffoooo--cceerrtt..ppeemm --iinnffiilleess ffoooo--rreeqq..ppeemm + % ooppeennssssll ccaa --oouutt ffoooo--cceerrtt..ppeemm --ddaayyss 336655 --iinnffiilleess ffoooo--rreeqq..ppeemm Using configuration from /etc/ssl/openssl.cnf Enter PEM pass phrase:wwhhaatteevveerr Check that the request matches the signature @@ -2089,6 +2113,10 @@ indicates a super-user shell. Certification Authority certificate files. This requires super-user privileges. + The following commands assume that the key and certificate will be + installed for the local Postfix MTA. You will need to adjust the commands + if the Postfix MTA is on a different host. + # ccpp ddeemmooCCAA//ccaacceerrtt..ppeemm ffoooo--kkeeyy..ppeemm ffoooo--cceerrtt..ppeemm //eettcc//ppoossttffiixx # cchhmmoodd 664444 //eettcc//ppoossttffiixx//ffoooo--cceerrtt..ppeemm //eettcc//ppoossttffiixx//ccaacceerrtt..ppeemm # cchhmmoodd 440000 //eettcc//ppoossttffiixx//ffoooo--kkeeyy..ppeemm diff --git a/postfix/html/TLS_README.html b/postfix/html/TLS_README.html index 50713e4e0..8c653c776 100644 --- a/postfix/html/TLS_README.html +++ b/postfix/html/TLS_README.html @@ -2635,10 +2635,44 @@ font, and a "#" prompt indicates a super-user shell.

+ +

Self-signed server certificate

+ +

The following commands (credits: Viktor Dukhovni) generate +and install a private key and 10-year self-signed certificate for +the local Postfix system. This requires super-user privileges.

+ +
+
+# dir="$(postconf -h config_directory)"
+# fqdn=$(postconf -h myhostname)
+# ymd=$(date +%Y-%m-%d)
+# key="${dir}/key-${ymd}.pem"; rm -f "${key}"
+# cert="${dir}/cert-${ymd}.pem"; rm -f "${cert}"
+# (umask 077; openssl genrsa -out "${key}" 2048) &&
+  openssl req -new -key "${key}" \
+    -x509 -subj "/CN=${fqdn}" -days 3650 -out "${cert}" &&
+  postconf -e \
+    "smtpd_tls_cert_file = ${cert}" \
+    "smtpd_tls_key_file = ${key}"
+
+
+ +

Private Certificate Authority

+ +