;;; -*-Scheme-*-
;;;
-;;; $Id: imail-imap.scm,v 1.111 2000/06/05 20:56:48 cph Exp $
+;;; $Id: imail-imap.scm,v 1.112 2000/06/05 21:25:34 cph Exp $
;;;
;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology
;;;
(imap-connection-capabilities connection)))
(error "Server doesn't support IMAP4rev1:" url))
(let ((response
- (imail-call-with-pass-phrase url
+ (imail-ui:call-with-pass-phrase url
(lambda (pass-phrase)
(imap:command:login connection
(imap-url-user-id url)
(close-imap-connection connection)))))))))
(if (imap:response:no? response)
(begin
- (imail-delete-stored-pass-phrase url)
+ (imail-ui:delete-stored-pass-phrase url)
(error "Unable to log in:"
(imap:response:response-text-string response))))))
#t)))
(define (read-message-headers! folder start)
(if (imap-folder-uidvalidity folder)
- ((imail-message-wrapper "Reading message UIDs")
+ ((imail-ui:message-wrapper "Reading message UIDs")
(lambda ()
(imap:command:fetch-range (imap-folder-connection folder)
start #f '(UID))))))
(with-interrupt-mask interrupt-mask
(lambda (interrupt-mask)
interrupt-mask
- ((imail-message-wrapper "Reading message UIDs")
+ ((imail-ui:message-wrapper "Reading message UIDs")
(lambda ()
(imap:command:fetch-range (imap-folder-connection folder)
0 #f '(UID))))))
(let ((suffix
(string-append " UID for message "
(number->string (+ index 1)))))
- ((imail-message-wrapper "Reading" suffix)
+ ((imail-ui:message-wrapper "Reading" suffix)
(lambda ()
(imap:command:fetch connection index '(UID))
(if (not (initpred message))
(string-append
" " noun " for message "
(number->string (+ (message-index message) 1)))))
- ((imail-message-wrapper "Reading" suffix)
+ ((imail-ui:message-wrapper "Reading" suffix)
(lambda ()
- (imap:read-literal-progress-hook imail-progress-meter
+ (imap:read-literal-progress-hook imail-ui:progress-meter
(lambda ()
(imap:command:uid-fetch connection uid keywords)
(if (not (initpred message))
(if (equal? section '(TEXT)) "" " part")
" for message "
(number->string (+ (message-index message) 1)))))
- ((imail-message-wrapper "Reading" suffix)
+ ((imail-ui:message-wrapper "Reading" suffix)
(lambda ()
- (imap:read-literal-progress-hook imail-progress-meter
+ (imap:read-literal-progress-hook imail-ui:progress-meter
(lambda ()
(imap:command:uid-fetch
(imap-folder-connection (message-folder message))
(imap:command:no-response connection 'CAPABILITY))
(define (imap:command:login connection user-id pass-phrase)
- ((imail-message-wrapper "Logging in as " user-id)
+ ((imail-ui:message-wrapper "Logging in as " user-id)
(lambda ()
(imap:command:no-response connection 'LOGIN user-id pass-phrase))))
(define (imap:command:select connection mailbox)
- ((imail-message-wrapper "Select mailbox " mailbox)
+ ((imail-ui:message-wrapper "Select mailbox " mailbox)
(lambda ()
(imap:command:no-response connection 'SELECT mailbox))))
(imap:command:no-response connection 'UID 'STORE uid 'FLAGS flags))
(define (imap:command:expunge connection)
- ((imail-message-wrapper "Expunging messages")
+ ((imail-ui:message-wrapper "Expunging messages")
(lambda ()
(imap:command:no-response connection 'EXPUNGE))))
(error "Server shut down connection:" text)))
(if (or (imap:response:no? response)
(imap:response:bad? response))
- (imail-present-user-alert
+ (imail-ui:present-user-alert
(lambda (port)
(write-string "Notice from IMAP server:" port)
(newline port)
(define (process-response-text connection command code text)
command
(cond ((imap:response-code:alert? code)
- (imail-present-user-alert
+ (imail-ui:present-user-alert
(lambda (port)
(write-string "Alert from IMAP server:" port)
(newline port)
;;; -*-Scheme-*-
;;;
-;;; $Id: imail-top.scm,v 1.132 2000/06/05 21:09:30 cph Exp $
+;;; $Id: imail-top.scm,v 1.133 2000/06/05 21:25:36 cph Exp $
;;;
;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology
;;;
((string-ci=? protocol "umail") (make-umail-url "~/inbox.mail"))
(else (error:bad-range-argument protocol)))))
-(define (imail-present-user-alert procedure)
+(define (imail-ui:present-user-alert procedure)
(call-with-output-to-temporary-buffer " *IMAP alert*"
'(READ-ONLY SHRINK-WINDOW
FLUSH-ON-SPACE)
procedure))
-(define (imail-message-wrapper . arguments)
+(define (imail-ui:message-wrapper . arguments)
(let ((prefix (string-append (message-args->string arguments) "...")))
(lambda (thunk)
(fluid-let ((*imail-message-wrapper-prefix* prefix))
(message prefix "done")
v)))))
-(define (imail-progress-meter current total)
+(define (imail-ui:progress-meter current total)
(if (and *imail-message-wrapper-prefix* (< 0 current total))
(message *imail-message-wrapper-prefix*
(string-pad-left
(and folder
(imail-folder->buffer folder #f)))))
\f
-(define (imail-call-with-pass-phrase url receiver)
+(define (imail-ui:call-with-pass-phrase url receiver)
(let ((key (url-pass-phrase-key url))
(retention-time (ref-variable imail-pass-phrase-retention-time #f)))
(let ((entry (hash-table/get memoized-pass-phrases key #f)))
entry)))
(receiver pass-phrase)))))))
-(define (imail-delete-stored-pass-phrase url)
+(define (imail-ui:delete-stored-pass-phrase url)
(hash-table/remove! memoized-pass-phrases (url-pass-phrase-key url)))
(define (set-up-pass-phrase-timer! entry key retention-time)