From: okada Date: Sun, 21 Nov 1999 01:07:19 +0000 (+0000) Subject: STARTTLS support. X-Git-Tag: slim-1_13_1~2 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c960b326b9efad42dc08ce1d010f825c97263d1c;p=elisp%2Fflim.git STARTTLS support. * starttls.c: New file. * smtp.el (smtp-via-smtp): STARTTLS support. * SLIM-TIPS: New file. * starttls.c: Deleted. See SLIM-TIPS. * FLIM-ELS (flim-modules): Add `starttls' --- diff --git a/ChangeLog b/ChangeLog index 070a181..874297f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +1999-10-21 Kenichi OKADA + + * starttls.c: New file. + * smtp.el (smtp-via-smtp): STARTTLS support. + * SLIM-TIPS: New file. + * starttls.c: Deleted. See SLIM-TIPS. + * FLIM-ELS (flim-modules): Add `starttls' + 1999-10-21 Daiki Ueno * starttls.el: New file. @@ -31,7 +39,7 @@ 1999-10-19 Kenichi OKADA - * hmac-md5.el (hmac-md5): fixed for XEmacs's md5. + * hmac-md5.el (hmac-md5): Fixed for XEmacs's md5. 1999-10-19 Kenichi OKADA @@ -438,7 +446,7 @@ 1999-05-31 MORIOKA Tomohiko - * FLIM: Version 1.12.7 (Y~zaki) released. + * FLIM: Version 1.12.7 (Y-D~zaki) released. 1999-05-31 MORIOKA Tomohiko @@ -613,7 +621,7 @@ 1999-05-11 MORIOKA Tomohiko - * FLIM: Version 1.12.6 (Family-Krenmae) released. + * FLIM: Version 1.12.6 (Family-K-Drenmae) released. 1999-04-27 Shuhei KOBAYASHI @@ -730,7 +738,7 @@ 1999-01-23 MORIOKA Tomohiko - * FLIM: Version 1.12.3 (Kintetsu-Krriyama) released. + * FLIM: Version 1.12.3 (Kintetsu-K-Drriyama) released. 1999-01-23 MORIOKA Tomohiko @@ -773,7 +781,7 @@ 1999-01-21 MORIOKA Tomohiko - * FLIM: Version 1.12.2 (Kujr) released. + * FLIM: Version 1.12.2 (Kuj-Dr) released. 1999-01-16 MORIOKA Tomohiko @@ -959,7 +967,7 @@ 1998-12-02 MORIOKA Tomohiko - * FLIM: Version 1.12.1 (Nishinokyr) released. + * FLIM: Version 1.12.1 (Nishinoky-Dr) released. 1998-11-30 MORIOKA Tomohiko @@ -1177,7 +1185,7 @@ 1998-10-26 MORIOKA Tomohiko - * FLIM: Version 1.11.2 (Heijr) was released. + * FLIM: Version 1.11.2 (Heij-Dr) was released. * NEWS (Abolish variable `mime-temp-directory'): New subsection. @@ -1457,7 +1465,7 @@ 1998-10-12 MORIOKA Tomohiko - * FLIM: Version 1.10.4 (Shin-Hrsono) was released. + * FLIM: Version 1.10.4 (Shin-H-Drsono) was released. 1998-10-12 Katsumi Yamaoka @@ -1642,7 +1650,7 @@ 1998-09-29 MORIOKA Tomohiko - * FLIM: Version 1.10.0 (Krdo) was released. + * FLIM: Version 1.10.0 (K-Drdo) was released. * README.en (What's FLIM): Add mel-ccl.el. @@ -1929,7 +1937,7 @@ 1998-08-31 MORIOKA Tomohiko - * FLIM: Version 1.9.1 (Tonoshr) was released. + * FLIM: Version 1.9.1 (Tonosh-Dr) was released. * mime-en.sgml (mm-backend): Translate a little. @@ -2072,7 +2080,7 @@ 1998-07-07 MORIOKA Tomohiko - * FLIM-Chao: Version 1.8.0 (Shijr) was released. + * FLIM-Chao: Version 1.8.0 (Shij-Dr) was released. 1998-07-07 MORIOKA Tomohiko @@ -2184,7 +2192,7 @@ 1998-07-01 MORIOKA Tomohiko - * FLIM: Version 1.8.0 (Rkubo) was released. + * FLIM: Version 1.8.0 (-DRkubo) was released. * README.en: Delete `How to use'. @@ -2309,7 +2317,7 @@ 1998-06-28 MORIOKA Tomohiko - * FLIM-Chao: Version 1.7.0 (Gojr) was released. + * FLIM-Chao: Version 1.7.0 (Goj-Dr) was released. 1998-06-26 MORIOKA Tomohiko @@ -2568,7 +2576,7 @@ 1998-06-19 MORIOKA Tomohiko - * FLIM: Version 1.4.1 (Momoyama-Goryrmae) was released. + * FLIM: Version 1.4.1 (Momoyama-Gory-Drmae) was released. 1998-06-18 MORIOKA Tomohiko @@ -2688,7 +2696,7 @@ 1998-05-06 MORIOKA Tomohiko - * FLIM: Version 1.2.0 (J~jr) was released. + * FLIM: Version 1.2.0 (J-D~jr) was released. * README.en (What's FLIM): Delete description about std11-parse.el; add description about mailcap.el. @@ -2739,7 +2747,7 @@ 1998-05-05 MORIOKA Tomohiko - * FLIM: Version 1.1.0 (Trji) was released. + * FLIM: Version 1.1.0 (T-Drji) was released. 1998-05-04 MORIOKA Tomohiko @@ -2775,7 +2783,7 @@ 1998-04-17 MORIOKA Tomohiko - * FLIM: Version 1.0.1 (Kyrto) was released. + * FLIM: Version 1.0.1 (Ky-Drto) was released. * mime-def.el (mime-spadework-module-version-string): New constant. diff --git a/FLIM-ELS b/FLIM-ELS index dbe4721..11a40ba 100644 --- a/FLIM-ELS +++ b/FLIM-ELS @@ -13,7 +13,8 @@ smtp smtpmail sasl md5 md5-el md5-dl sha1 sha1-el sha1-dl - hmac-def hmac-util hmac-md5 hmac-sha1)) + hmac-def hmac-util hmac-md5 hmac-sha1 + starttls)) (unless (and (fboundp 'base64-encode-string) (subrp (symbol-function 'base64-encode-string))) diff --git a/SLIM-TIPS b/SLIM-TIPS new file mode 100644 index 0000000..997d848 --- /dev/null +++ b/SLIM-TIPS @@ -0,0 +1,3 @@ +To use starttls, get next package. + +http://www.ueda.info.waseda.ac.jp/~ueno/tmp/starttls-0.1.tar.gz diff --git a/sasl.el b/sasl.el index 9709927..66ac188 100644 --- a/sasl.el +++ b/sasl.el @@ -3,7 +3,7 @@ ;; Copyright (C) 1995, 1996, 1998, 1999 Free Software Foundation, Inc. ;; Author: Kenichi OKADA -;; Keywords: SMTP, SASL +;; Keywords: SMTP, SASL, RFC2222 ;; This file is part of FLIM (Faithful Library about Internet Message). diff --git a/smtp.el b/smtp.el index 3063a6a..1f35769 100644 --- a/smtp.el +++ b/smtp.el @@ -6,7 +6,7 @@ ;; Simon Leinen (ESMTP support) ;; Shuhei KOBAYASHI ;; Kenichi OKADA (SASL support) -;; Keywords: SMTP, mail +;; Keywords: SMTP, mail, SASL ;; This file is part of FLIM (Faithful Library about Internet Message). @@ -32,6 +32,7 @@ (require 'pcustom) (require 'mail-utils) ; mail-strip-quoted-names (require 'sasl) +(require 'starttls) (eval-when-compile (require 'cl)) ; push @@ -94,7 +95,7 @@ don't define this value." (error "Cannot generate valid FQDN. Set `smtp-local-domain' correctly."))))) (defun smtp-via-smtp (sender recipients smtp-text-buffer - &optional auth user passphrase) + &optional auth user passphrase starttls) (let ((server (if (functionp smtp-server) (funcall smtp-server sender recipients) smtp-server)) @@ -109,12 +110,19 @@ don't define this value." (unwind-protect (catch 'done - (setq process (open-network-stream-as-binary - "SMTP" (current-buffer) server smtp-service)) + (setq process + (if starttls + (starttls-open-stream + "SMTP" (current-buffer) server smtp-service) + (open-network-stream-as-binary + "SMTP" (current-buffer) server smtp-service))) (or process (throw 'done nil)) (set-process-filter process 'smtp-process-filter) + (if (eq starttls 'force) + (starttls-negotiate process)) + ;; Greeting (setq response (smtp-read-response process)) (if (or (null (car response)) @@ -150,6 +158,18 @@ don't define this value." (push (intern extension) extensions)) (setq extension-lines (cdr extension-lines))))) + ;; STARTTLS --- begin a TLS negotiation (RFC 2595) + (when (and starttls + (null (eq starttls 'force)) + (memq 'starttls extensions)) + (smtp-send-command process "STARTTLS") + (setq response (smtp-read-response process)) + (if (or (null (car response)) + (not (integerp (car response))) + (>= (car response) 400)) + (throw 'done (car (cdr response)))) + (starttls-negotiate process)) + ;; AUTH --- SMTP Service Extension for Authentication (RFC2554) (when auth (if (null (memq (intern auth) extensions))