+1999-10-21 Kenichi OKADA <okada@opaopa.org>
+
+ * 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 <ueno@ueda.info.waseda.ac.jp>
* starttls.el: New file.
1999-10-19 Kenichi OKADA <okada@opaopa.org>
- * 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 <okada@opaopa.org>
\f
1999-05-31 MORIOKA Tomohiko <tomo@m17n.org>
- * FLIM: Version 1.12.7 (Y\ e~\ fzaki) released.
+ * FLIM: Version 1.12.7 (Y\e-D\ e~\ fzaki) released.
1999-05-31 MORIOKA Tomohiko <tomo@m17n.org>
\f
1999-05-11 MORIOKA Tomohiko <tomo@m17n.org>
- * FLIM: Version 1.12.6 (Family-K\ er\ fenmae) released.
+ * FLIM: Version 1.12.6 (Family-K\e-D\ er\ fenmae) released.
1999-04-27 Shuhei KOBAYASHI <shuhei@aqua.ocn.ne.jp>
\f
1999-01-23 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * FLIM: Version 1.12.3 (Kintetsu-K\ er\ friyama) released.
+ * FLIM: Version 1.12.3 (Kintetsu-K\e-D\ er\ friyama) released.
1999-01-23 MORIOKA Tomohiko <morioka@jaist.ac.jp>
\f
1999-01-21 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * FLIM: Version 1.12.2 (Kuj\ er\ f) released.
+ * FLIM: Version 1.12.2 (Kuj\e-D\ er\ f) released.
1999-01-16 MORIOKA Tomohiko <morioka@jaist.ac.jp>
\f
1998-12-02 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * FLIM: Version 1.12.1 (Nishinoky\ er\ f) released.
+ * FLIM: Version 1.12.1 (Nishinoky\e-D\ er\ f) released.
1998-11-30 MORIOKA Tomohiko <morioka@jaist.ac.jp>
\f
1998-10-26 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * FLIM: Version 1.11.2 (Heij\ er\ f) was released.
+ * FLIM: Version 1.11.2 (Heij\e-D\ er\ f) was released.
* NEWS (Abolish variable `mime-temp-directory'): New subsection.
\f
1998-10-12 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * FLIM: Version 1.10.4 (Shin-H\ er\ fsono) was released.
+ * FLIM: Version 1.10.4 (Shin-H\e-D\ er\ fsono) was released.
1998-10-12 Katsumi Yamaoka <yamaoka@jpl.org>
\f
1998-09-29 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * FLIM: Version 1.10.0 (K\ er\ fdo) was released.
+ * FLIM: Version 1.10.0 (K\e-D\ er\ fdo) was released.
* README.en (What's FLIM): Add mel-ccl.el.
\f
1998-08-31 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * FLIM: Version 1.9.1 (Tonosh\ er\ f) was released.
+ * FLIM: Version 1.9.1 (Tonosh\e-D\ er\ f) was released.
* mime-en.sgml (mm-backend): Translate a little.
\f
1998-07-07 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * FLIM-Chao: Version 1.8.0 (Shij\ er\ f) was released.
+ * FLIM-Chao: Version 1.8.0 (Shij\e-D\ er\ f) was released.
1998-07-07 MORIOKA Tomohiko <morioka@jaist.ac.jp>
\f
1998-07-01 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * FLIM: Version 1.8.0 (\ eR\ fkubo) was released.
+ * FLIM: Version 1.8.0 (\e-D\ eR\ fkubo) was released.
* README.en: Delete `How to use'.
\f
1998-06-28 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * FLIM-Chao: Version 1.7.0 (Goj\ er\ f) was released.
+ * FLIM-Chao: Version 1.7.0 (Goj\e-D\ er\ f) was released.
1998-06-26 MORIOKA Tomohiko <morioka@jaist.ac.jp>
\f
1998-06-19 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * FLIM: Version 1.4.1 (Momoyama-Gory\ er\ fmae) was released.
+ * FLIM: Version 1.4.1 (Momoyama-Gory\e-D\ er\ fmae) was released.
1998-06-18 MORIOKA Tomohiko <morioka@jaist.ac.jp>
\f
1998-05-06 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * FLIM: Version 1.2.0 (J\ e~\ fj\ er\ f) was released.
+ * FLIM: Version 1.2.0 (J\e-D\ e~\ fj\ er\ f) was released.
* README.en (What's FLIM): Delete description about
std11-parse.el; add description about mailcap.el.
\f
1998-05-05 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * FLIM: Version 1.1.0 (T\ er\ fji) was released.
+ * FLIM: Version 1.1.0 (T\e-D\ er\ fji) was released.
1998-05-04 MORIOKA Tomohiko <morioka@jaist.ac.jp>
\f
1998-04-17 MORIOKA Tomohiko <morioka@jaist.ac.jp>
- * FLIM: Version 1.0.1 (Ky\ er\ fto) was released.
+ * FLIM: Version 1.0.1 (Ky\e-D\ er\ fto) was released.
* mime-def.el (mime-spadework-module-version-string): New
constant.
;; Simon Leinen <simon@switch.ch> (ESMTP support)
;; Shuhei KOBAYASHI <shuhei@aqua.ocn.ne.jp>
;; Kenichi OKADA <okada@opaopa.org> (SASL support)
-;; Keywords: SMTP, mail
+;; Keywords: SMTP, mail, SASL
;; This file is part of FLIM (Faithful Library about Internet Message).
(require 'pcustom)
(require 'mail-utils) ; mail-strip-quoted-names
(require 'sasl)
+(require 'starttls)
(eval-when-compile (require 'cl)) ; push
(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))
(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))
(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))