Changeset 2785

Show
Ignore:
Timestamp:
03/23/08 16:01:52 (8 months ago)
Author:
hans
Message:

implement raw tls

Files:

Legend:

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

    r2784 r2785  
    103103    lines)) 
    104104 
    105 (defun do-with-smtp-mail (host port from to thunk &key authentication ssl local-hostname) 
     105(defun do-with-smtp-mail (host from to thunk &key port authentication ssl local-hostname) 
    106106  (usocket:with-client-socket (socket stream host port) 
    107107    (let ((stream (smtp-handshake stream 
     
    113113      (finish-smtp-mail stream)))) 
    114114 
    115 (defmacro with-smtp-mail ((stream-var host port from to &key authentication ssl local-hostname) 
     115(defmacro with-smtp-mail ((stream-var host from to &key ssl (port (if (eq :tls ssl) 465 25)) authentication local-hostname) 
    116116                          &body body) 
    117117  "Encapsulate a SMTP MAIl conversation.  A connection to the SMTP 
     
    121121   connected to the remote SMTP server.  BODY is expected to write the 
    122122   RFC2821 message (headers and body) to STREAM-VAR." 
    123   `(do-with-smtp-mail ,host ,port ,from ,to 
     123  `(do-with-smtp-mail ,host ,from ,to 
    124124                      (lambda (,stream-var) ,@body) 
     125                      :port ,port 
    125126                      :authentication ,authentication  
    126127                      :ssl ,ssl 
     
    128129 
    129130(defun send-email (host from to subject message  
    130                    &key (port 25) cc bcc reply-to extra-headers 
     131                   &key ssl (port (if (eq :tls ssl) 465 25)) cc bcc reply-to extra-headers 
    131132                   html-message display-name authentication 
    132                    attachments (buffer-size 256) ssl
     133                   attachments (buffer-size 256)
    133134  (send-smtp host from (check-arg to "to") subject (mask-dot message) 
    134135             :port port :cc (check-arg cc "cc") :bcc (check-arg bcc "bcc") 
     
    144145             :ssl ssl)) 
    145146 
    146 (defun send-smtp (host from to subject message  
    147                   &key (port 25) cc bcc reply-to extra-headers html-message  
    148                   display-name authentication attachments buffer-size ssl 
     147(defun send-smtp (host from to subject message 
     148                  &key ssl (port (if (eq :tls ssl) 465 25)) cc bcc 
     149                  reply-to extra-headers html-message display-name 
     150                  authentication attachments buffer-size 
    149151                  (local-hostname (usocket::get-host-name))) 
    150   (with-smtp-mail (stream host port from (append to cc bcc) 
     152  (with-smtp-mail (stream host from (append to cc bcc) 
     153                          :port port 
    151154                          :authentication authentication  
    152155                          :ssl ssl 
     
    306309         ;; Plain SSL connection 
    307310         (convert-connection-to-ssl) 
     311         (do-ehlo)) 
     312        ((nil) 
    308313         (do-ehlo)))) 
    309314    (when authentication