;; 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))
+ ))
+ )