diff options
| author | Simon Josefsson | 2005-07-17 07:43:29 +0000 |
|---|---|---|
| committer | Simon Josefsson | 2005-07-17 07:43:29 +0000 |
| commit | 4effb112160584e65a2d87f9f9838a052187cc0a (patch) | |
| tree | 0efaafc25e66f7c3db68d8c38cbd3aada5ec8e80 | |
| parent | 9b0c2c5620765e9e512259e1423e0c0afabb1c47 (diff) | |
| download | emacs-4effb112160584e65a2d87f9f9838a052187cc0a.tar.gz emacs-4effb112160584e65a2d87f9f9838a052187cc0a.zip | |
(smtpmail-auth-supported): Added the 'plain auth method
(smtpmail-try-auth-methods): added the AUTH PLAIN dialog
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/mail/smtpmail.el | 22 |
2 files changed, 25 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c91ec623ed3..31a034e54e9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2005-07-16 Jose E. Marchesi <jemarch@gnu.org> | ||
| 2 | |||
| 3 | * lisp/mail/smtpmail.el (smtpmail-auth-supported): Added the | ||
| 4 | 'plain auth method | ||
| 5 | (smtpmail-try-auth-methods): added the AUTH PLAIN dialog | ||
| 6 | |||
| 1 | 2005-07-17 Kim F. Storm <storm@cua.dk> | 7 | 2005-07-17 Kim F. Storm <storm@cua.dk> |
| 2 | 8 | ||
| 3 | * ido.el (dired-other-window): Add ido property. | 9 | * ido.el (dired-other-window): Add ido property. |
diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el index 0c076011044..480062286e0 100644 --- a/lisp/mail/smtpmail.el +++ b/lisp/mail/smtpmail.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; smtpmail.el --- simple SMTP protocol (RFC 821) for sending mail | 1 | ;;; smtpmail.el --- simple SMTP protocol (RFC 821) for sending mail |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1995, 1996, 2001, 2002, 2003, 2004 | 3 | ;; Copyright (C) 1995, 1996, 2001, 2002, 2003, 2004, 2005 |
| 4 | ;; Free Software Foundation, Inc. | 4 | ;; Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Author: Tomoji Kagatani <kagatani@rbc.ncl.omron.co.jp> | 6 | ;; Author: Tomoji Kagatani <kagatani@rbc.ncl.omron.co.jp> |
| @@ -207,7 +207,7 @@ This is relative to `smtpmail-queue-dir'.") | |||
| 207 | (defvar smtpmail-queue-index (concat smtpmail-queue-dir | 207 | (defvar smtpmail-queue-index (concat smtpmail-queue-dir |
| 208 | smtpmail-queue-index-file)) | 208 | smtpmail-queue-index-file)) |
| 209 | 209 | ||
| 210 | (defconst smtpmail-auth-supported '(cram-md5 login) | 210 | (defconst smtpmail-auth-supported '(cram-md5 login plain) |
| 211 | "List of supported SMTP AUTH mechanisms.") | 211 | "List of supported SMTP AUTH mechanisms.") |
| 212 | 212 | ||
| 213 | ;;; | 213 | ;;; |
| @@ -559,8 +559,24 @@ This is relative to `smtpmail-queue-dir'.") | |||
| 559 | (not (integerp (car ret))) | 559 | (not (integerp (car ret))) |
| 560 | (>= (car ret) 400)) | 560 | (>= (car ret) 400)) |
| 561 | (throw 'done nil))) | 561 | (throw 'done nil))) |
| 562 | ((eq mech 'plain) | ||
| 563 | (smtpmail-send-command process "AUTH PLAIN") | ||
| 564 | (if (or (null (car (setq ret (smtpmail-read-response process)))) | ||
| 565 | (not (integerp (car ret))) | ||
| 566 | (not (equal (car ret) 334))) | ||
| 567 | (throw 'done nil)) | ||
| 568 | (smtpmail-send-command process (base64-encode-string | ||
| 569 | (concat "\0" | ||
| 570 | (smtpmail-cred-user cred) | ||
| 571 | "\0" | ||
| 572 | (smtpmail-cred-passwd cred)))) | ||
| 573 | (if (or (null (car (setq ret (smtpmail-read-response process)))) | ||
| 574 | (not (integerp (car ret))) | ||
| 575 | (not (equal (car ret) 235))) | ||
| 576 | (throw 'done nil))) | ||
| 577 | |||
| 562 | (t | 578 | (t |
| 563 | (error "Mechanism %s not implemented" mech))) | 579 | (error "Mechanism %s not implemented" mech))) |
| 564 | ;; Remember the password. | 580 | ;; Remember the password. |
| 565 | (when (and (not (stringp smtpmail-auth-credentials)) | 581 | (when (and (not (stringp smtpmail-auth-credentials)) |
| 566 | (null (smtpmail-cred-passwd cred))) | 582 | (null (smtpmail-cred-passwd cred))) |