r5047: Automatic commit for debian_version_1_8_2_1-1
[postoffice.git] / smtp.lisp
index 31a53c5f31091b997b3ca0c12cd9a8742a9b7c9a..88dc4942f1332950a0238cb5be4e8199b11c32ec 100644 (file)
--- a/smtp.lisp
+++ b/smtp.lisp
@@ -23,7 +23,7 @@
 ;; Suite 330, Boston, MA  02111-1307  USA
 ;;
 ;;
-;; $Id: smtp.lisp,v 1.1 2002/10/09 14:26:11 kevin Exp $
+;; $Id: smtp.lisp,v 1.4 2002/10/16 02:10:56 kevin Exp $
 
 ;; Description:
 ;;   send mail to an smtp server.  See rfc821 for the spec.
 
 
 
-(defpackage :net.post-office
-  (:use #:lisp #:excl
-       #+allegro #:socket
-       #-allegro #:acl-socket)
-  (:export 
-   #:send-letter
-   #:send-smtp
-   #:test-email-address))
-
 (in-package :net.post-office)
 
 
     (if* (null ipaddr)
        then (error "Can't determine ip addres for mail server ~s" server))
     
-    (setq sock (make-socket :remote-host ipaddr
-                                  :remote-port 25  ; smtp
-                                  ))
+    (setq sock (make-socket :remote-host #+allegro ipaddr #-allegro server
+                           :remote-port 25  ; smtp
+                           ))
     (unwind-protect
        (progn
          (response-case (sock msg)
                        (dotted-to-ipaddr name :errorp nil)))
        then ipaddr
        else ; do mx lookup if acldns is being used
-#|
-           (if* (or (eq *dns-mode* :acldns)
-                    (member :acldns *dns-mode* :test #'eq))
-              then (let ((res (dns-query name :type :mx)))
-                     (if* (and res (consp res))
-                        then (cadr res) ; the ip address
-                        else (dns-query name :type :a)))
-              else ; just do a hostname lookup
-|#
-       (ignore-errors (lookup-hostname name)))))
-;; )
+       #+allegro
+       (if* (or (eq *dns-mode* :acldns)
+               (member :acldns *dns-mode* :test #'eq))
+           then (let ((res (dns-query name :type :mx)))
+                  (if* (and res (consp res))
+                       then (cadr res) ; the ip address
+                       else (dns-query name :type :a)))
+           else ; just do a hostname lookup
+           (ignore-errors (lookup-hostname name)))
+       #-allegro
+       (ignore-errors (lookup-hostname name))
+       ))
+  )