git.fiddlerwoaroof.com
Browse code

2006-03-24 Kevin Layer <layer@gemini>

layer authored on 24/03/2006 21:21:21
Showing 2 changed files
... ...
@@ -1,5 +1,6 @@
1 1
 2006-03-24  Kevin Layer  <layer@gemini>
2 2
 
3
+	* smtp.cl: rfe6507: fix for socket:ipaddrp being 8.0 only
3 4
     from dancy:
4 5
 	* smtp.cl: rfe6507: add :port argument to send-letter, send-smtp,
5 6
 	  send-smtp-auth
... ...
@@ -38,7 +38,7 @@ v3: add :port argument to send-letter, send-smtp, send-smtp-auth."
38 38
 ;; Suite 330, Boston, MA  02111-1307  USA
39 39
 ;;
40 40
 ;;
41
-;; $Id: smtp.cl,v 1.16 2006/03/24 20:05:15 layer Exp $
41
+;; $Id: smtp.cl,v 1.17 2006/03/24 21:21:21 layer Exp $
42 42
 
43 43
 ;; Description:
44 44
 ;;   send mail to an smtp server.  See rfc821 for the spec.
... ...
@@ -611,6 +611,11 @@ Attachments must be filenames, streams, or mime-part-constructed, not ~s"
611 611
 
612 612
       (setq last-ch ch))))
613 613
 
614
+(eval-when (compile eval)
615
+  (defmacro ipaddrp (obj)
616
+    #+(version>= 8 0) (socket:ipaddrp ,obj)
617
+    #-(version>= 8 0) (and (integerp ,obj) (<= 0 ,obj #.(1- (expt 2 32)))))
618
+  )
614 619
 
615 620
 (defun determine-mail-server (name)
616 621
   ;; return the ipaddress to be used to connect to the 
... ...
@@ -623,10 +628,9 @@ Attachments must be filenames, streams, or mime-part-constructed, not ~s"
623 628
   ;; we just return the ipaddress for what we were given
624 629
   ;;
625 630
   (let (ipaddr)
626
-    (if* (socket:ipaddrp name)
631
+    (if* (ipaddrp name)
627 632
        then name
628
-     elseif (socket:ipaddrp (setq ipaddr
629
-			      (socket:dotted-to-ipaddr name :errorp nil)))
633
+     elseif (ipaddrp (setq ipaddr (socket:dotted-to-ipaddr name :errorp nil)))
630 634
        then ipaddr
631 635
        else ; do mx lookup if acldns is being used
632 636
 	    (if* (or (eq socket:*dns-mode* :acldns)