(filter (lambda (msg) (not (deliver-message msg config)))
messages))
-(define (get-local-addresses config)
- (map (lambda (p) (cons
- (conc "<" (car p) "@" (config-host config) ">")
- (cdr p)))
- (map (lambda (file)
- (list (pathname-file file) file
- (let ((password-file (conc file ".auth")))
- (if (file-exists? password-file)
- (with-input-from-file password-file read-line)
- #f))))
- (filter directory-exists?
- (glob (conc (config-spool-dir config) "/*"))))))
-
-(define (deliver-message-local msg dest-dir)
- (with-output-to-file (conc dest-dir "/" (current-seconds))
- (lambda ()
- (print (message-text msg)))))
-
-(define (deliver-message-remote msg)
- (print "TODO"))
-
(define (deliver-message msg config)
(let* ((local-addresses (get-local-addresses config))
(dest (assoc (message-to msg) local-addresses))
(print " * To: " (message-to msg))
#t)
+;; Local delivery
+
+(define (get-local-addresses config)
+ (map (lambda (p) (cons
+ (conc "<" (car p) "@" (config-host config) ">")
+ (cdr p)))
+ (map (lambda (file)
+ (list (pathname-file file) file
+ (let ((password-file (conc file ".auth")))
+ (if (file-exists? password-file)
+ (with-input-from-file password-file read-line)
+ #f))))
+ (filter directory-exists?
+ (glob (conc (config-spool-dir config) "/*"))))))
+
+(define (deliver-message-local msg dest-dir)
+ (with-output-to-file (conc dest-dir "/" (current-seconds))
+ (lambda ()
+ (print (message-text msg)))))
+
+
+;; Remote delivery
+
+(define (deliver-message-remote msg)
+ (print "TODO"))
+
;;; Command line argument parsing
;;