emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/mail/smtpmail.el


From: Simon Josefsson
Subject: [Emacs-diffs] Changes to emacs/lisp/mail/smtpmail.el
Date: Sun, 17 Jul 2005 03:43:17 -0400

Index: emacs/lisp/mail/smtpmail.el
diff -c emacs/lisp/mail/smtpmail.el:1.75 emacs/lisp/mail/smtpmail.el:1.76
*** emacs/lisp/mail/smtpmail.el:1.75    Mon Jul  4 17:46:22 2005
--- emacs/lisp/mail/smtpmail.el Sun Jul 17 07:43:16 2005
***************
*** 1,6 ****
  ;;; smtpmail.el --- simple SMTP protocol (RFC 821) for sending mail
  
! ;; Copyright (C) 1995, 1996, 2001, 2002, 2003, 2004
  ;;   Free Software Foundation, Inc.
  
  ;; Author: Tomoji Kagatani <address@hidden>
--- 1,6 ----
  ;;; smtpmail.el --- simple SMTP protocol (RFC 821) for sending mail
  
! ;; Copyright (C) 1995, 1996, 2001, 2002, 2003, 2004, 2005
  ;;   Free Software Foundation, Inc.
  
  ;; Author: Tomoji Kagatani <address@hidden>
***************
*** 207,213 ****
  (defvar smtpmail-queue-index (concat smtpmail-queue-dir
                                     smtpmail-queue-index-file))
  
! (defconst smtpmail-auth-supported '(cram-md5 login)
    "List of supported SMTP AUTH mechanisms.")
  
  ;;;
--- 207,213 ----
  (defvar smtpmail-queue-index (concat smtpmail-queue-dir
                                     smtpmail-queue-index-file))
  
! (defconst smtpmail-auth-supported '(cram-md5 login plain)
    "List of supported SMTP AUTH mechanisms.")
  
  ;;;
***************
*** 559,566 ****
                (not (integerp (car ret)))
                (>= (car ret) 400))
            (throw 'done nil)))
         (t
!         (error "Mechanism %s not implemented" mech)))
        ;; Remember the password.
        (when (and (not (stringp smtpmail-auth-credentials))
                 (null (smtpmail-cred-passwd cred)))
--- 559,582 ----
                (not (integerp (car ret)))
                (>= (car ret) 400))
            (throw 'done nil)))
+        ((eq mech 'plain)
+       (smtpmail-send-command process "AUTH PLAIN")
+       (if (or (null (car (setq ret (smtpmail-read-response process))))
+               (not (integerp (car ret)))
+               (not (equal (car ret) 334)))
+           (throw 'done nil))
+       (smtpmail-send-command process (base64-encode-string
+                                       (concat "\0"
+                                               (smtpmail-cred-user cred)
+                                               "\0"
+                                               (smtpmail-cred-passwd cred))))
+       (if (or (null (car (setq ret (smtpmail-read-response process))))
+               (not (integerp (car ret)))
+               (not (equal (car ret) 235)))
+           (throw 'done nil)))
+ 
         (t
!       (error "Mechanism %s not implemented" mech)))
        ;; Remember the password.
        (when (and (not (stringp smtpmail-auth-credentials))
                 (null (smtpmail-cred-passwd cred)))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]