X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=smtp.lisp;h=d639abbcb02f287296ed0fa0476702e4c0db277b;hb=7eded1aff6a3e38b36308fe2a223964a9fb42ea0;hp=31a53c5f31091b997b3ca0c12cd9a8742a9b7c9a;hpb=3982daabce7eab2cac2fad524e3bae9c3fec3fef;p=postoffice.git diff --git a/smtp.lisp b/smtp.lisp index 31a53c5..d639abb 100644 --- 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$ ;; Description: ;; send mail to an smtp server. See rfc821 for the spec. @@ -36,15 +36,6 @@ -(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) @@ -260,9 +251,9 @@ (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) @@ -472,17 +463,19 @@ (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)) + )) + )