From 4391ea04174182aa6d4c0a65ae80c80de5b7fb4a Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Sun, 24 Oct 2010 01:21:02 +0000 Subject: [PATCH] Kludge to fix pct-encoding of authority part of IMAP URLs in IMAIL. --- src/imail/imail-imap.scm | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/imail/imail-imap.scm b/src/imail/imail-imap.scm index 333b1d2c7..e8c4bb15f 100644 --- a/src/imail/imail-imap.scm +++ b/src/imail/imail-imap.scm @@ -112,16 +112,20 @@ USA. (define (make-imap-url-string url mailbox) (if (not mailbox) (error:wrong-type-argument mailbox string 'MAKE-IMAP-URL-STRING)) - (string-append "//" - (let ((user-id (imap-url-user-id url))) - (if (string=? user-id (current-user-name)) - "" - (string-append (url:encode-string user-id) "@"))) - (string-downcase (imap-url-host url)) - (let ((port (imap-url-port url))) - (if (= port 143) - "" - (string-append ":" (number->string port)))) + (string-append (call-with-output-string + (lambda (port) + (write-uri-authority + (make-uri-authority + (let ((user-id (imap-url-user-id url))) + (if (string=? user-id (current-user-name)) + #f + user-id)) + (string-downcase (imap-url-host url)) + (let ((port (imap-url-port url))) + (if (= port 143) + #f + port))) + port))) (if (or (string=? mailbox "") (string=? mailbox "/")) mailbox -- 2.25.1