diff --git a/scheme/lib/smtp.scm b/scheme/lib/smtp.scm index 5afa711..09bbdb4 100644 --- a/scheme/lib/smtp.scm +++ b/scheme/lib/smtp.scm @@ -34,7 +34,7 @@ ;;; [Andreas:] I've inserted a way to do this. It works fine on my ;;; system. Does it work on your, too? -;;; (sendmail to-list body [host]) +;;; (send-mail-via-smtp from to-list body [host]) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Mail message to recipients in list TO-LIST. Message handed off to server ;;; running on HOST; default is the local host. Returns two values: code and @@ -47,7 +47,7 @@ ;;; ;;; BODY is a string or an input port. -(define (sendmail to-list body . maybe-host) +(define (send-mail-via-smtp from to-list body . maybe-host) (call-with-current-continuation (lambda (bailout) (let ((local (host-info:name (host-info (system-name)))) @@ -55,14 +55,13 @@ (receive (code text) (smtp-transactions/no-close socket ; Do prologue. (smtp/helo local) - (smtp/mail (string-append (user-login-name) - "@" local))) + (smtp/mail from)) (if (>= code 400) (values code text) ; error ;; Send over recipients and collect the losers. (let ((losers (filter-map (lambda (to) - (receive (code text) (smtp/rcpt socket to) + (receive (code text) ((smtp/rcpt to) socket) (and (>= code 400) ; Error (cond ((>= code 600) (smtp/quit socket) @@ -87,15 +86,6 @@ (cdr lis)) (reverse ans)))) -(define (%sendmail from local-host to dest-host message) - (let ((socket (smtp/open dest-host))) - (smtp-transactions socket - (smtp/helo local-host) - (smtp/mail from) - (smtp/rcpt to) - (smtp/data message)))) - - ;;; EXPN, VRFY, MAIL-HELP ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; These three are simple queries of the server. diff --git a/scheme/packages.scm b/scheme/packages.scm index 9e7d9ac..e20c7da 100644 --- a/scheme/packages.scm +++ b/scheme/packages.scm @@ -32,7 +32,7 @@ emit-text)) (define-interface smtp-interface - (export sendmail %sendmail + (export send-mail-via-smtp expn vrfy mail-help smtp-transactions smtp-transactions/no-close