Changeset 2855

Show
Ignore:
Timestamp:
04/03/08 06:15:06 (8 months ago)
Author:
hans
Message:

update cl-smtp from trunk

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/thirdparty/cl-smtp/CHANGELOG

    r2782 r2855  
     1Version 20080202.1 
     22007.02.02 
     3Added support for sending raw messages. (Hans Huebner) 
     4Fixed STARTTLS so that an EHLO command is sent after STARTTLS. (Hans Huebner) 
     5Changed Authentication functionality, the actual authentication method used is determined by looking at the advertised features of the SMTP server. (Hans Huebner) 
     6Added non-ASCII character quoting in email headers (according to RFC2047). (Hans Huebner) 
     7Added condition classes for error reporting. (Hans Huebner) 
     8Change cl-smtp.lisp, cl-smtp.asd, CHANGELOG 
     9Add smtp-output-stream.lisp 
     10 
    111Version 20071113.1 
    2122007.11.13 
  • trunk/thirdparty/cl-smtp/cl-smtp.asd

    r2790 r2855  
    1818 
    1919(asdf:defsystem :cl-smtp 
    20   :version "20071113.1" 
     20  :version "20080202.1" 
    2121  :perform (load-op :after (op webpage) 
    2222                    (pushnew :cl-smtp cl:*features*)) 
    23   :depends-on (:usocket #-allegro :cl-base64  
    24                         #-allegro :flexi-streams 
    25                         #-allegro :cl+ssl) 
     23  :depends-on (:usocket  
     24               :trivial-gray-streams 
     25               :flexi-streams 
     26               #-allegro :cl-base64  
     27               #-allegro :cl+ssl) 
    2628  :serial t 
    2729  :components ((:file "package") 
  • trunk/thirdparty/cl-smtp/cl-smtp.lisp

    r2792 r2855  
    8888 
    8989(defun smtp-command (stream command expected-response-code 
    90                      &key (condition-class 'smtp-error) condition-arguments) 
     90                     &key (condition-class 'smtp-protocol-error)  
     91                     condition-arguments) 
    9192  (when command 
    9293    (write-to-smtp stream command)) 
     
    237238  (when (keywordp (car authentication)) 
    238239    (pop authentication)) 
    239   (destructuring-bind (username password) authentication 
    240     (cond 
    241       ((member "AUTH PLAIN" features :test #'equal) 
    242        (smtp-command stream (format nil "AUTH PLAIN ~A"  
    243                                     (string-to-base64-string 
    244                                      (format nil "~A~C~A~C~A"  
    245                                              username 
    246                                              #\null username 
    247                                              #\null password))) 
    248                      235)) 
    249       ((member "AUTH LOGIN" features :test #'equal) 
    250        (smtp-command stream "AUTH LOGIN" 
    251                      334) 
    252        (smtp-command stream (string-to-base64-string username) 
    253                      334) 
    254        (smtp-command stream (string-to-base64-string password) 
    255                      235)) 
    256       (t 
    257        (error 'no-supported-authentication-method :features features))))) 
     240  (let ((server-authentication (loop for i in features 
     241                                  for e = (search "AUTH " i :test #'equal) 
     242                                  when (and e (= e 0)) 
     243                                  return i))) 
     244    (destructuring-bind (username password) authentication 
     245      (cond 
     246        ((search " PLAIN" server-authentication :test #'equal) 
     247         (smtp-command stream (format nil "AUTH PLAIN ~A"  
     248                                      (string-to-base64-string 
     249                                       (format nil "~A~C~A~C~A"  
     250                                               username 
     251                                               #\null username 
     252                                               #\null password))) 
     253                       235)) 
     254        ((search " LOGIN" server-authentication :test #'equal) 
     255         (smtp-command stream "AUTH LOGIN" 
     256                       334) 
     257         (smtp-command stream (string-to-base64-string username) 
     258                       334) 
     259         (smtp-command stream (string-to-base64-string password) 
     260                       235)) 
     261        (t 
     262         (error 'no-supported-authentication-method :features features)))))) 
    258263 
    259264(defun smtp-handshake (stream &key authentication ssl local-hostname) 
  • trunk/thirdparty/cl-smtp/package.lisp

    r2790 r2855  
    11;;; -*- mode: Lisp -*- 
    2          
     2        
    33;;; This file is part of CL-SMTP, the Lisp SMTP Client 
    44 
     
    2323  (:export "SEND-EMAIL" 
    2424           "WITH-SMTP-MAIL" 
    25  
    2625           "SMTP-ERROR" 
    2726           "SMTP-PROTOCOL-ERROR" 
  • trunk/thirdparty/cl-smtp/smtp-output-stream.lisp

    r2792 r2855  
    7676            do (format encapsulated-stream "=~2,'0X" byte)))) 
    7777      (setf previous-char char)) 
    78       (when (eql char #\Newline) 
     78      #+nil(when (eql char #\Newline) 
    7979        (write-char #\Return encapsulated-stream)) 
    8080      (unless (< 127 (char-code char))