- (let ((credentials
- (cond
- ((eq nnimap-stream 'network)
- (open-network-stream "*nnimap*" (current-buffer) nnimap-address
- (or nnimap-server-port "imap"))
- (netrc-credentials nnimap-address "imap"))
- ((eq nnimap-stream 'ssl)
- (open-tls-stream "*nnimap*" (current-buffer) nnimap-address
- (or nnimap-server-port "imaps"))
- (netrc-credentials nnimap-address "imaps" "imap")))))
+ (let* ((coding-system-for-read 'binary)
+ (coding-system-for-write 'binary)
+ (credentials
+ (cond
+ ((eq nnimap-stream 'network)
+ (open-network-stream "*nnimap*" (current-buffer) nnimap-address
+ (or nnimap-server-port "imap"))
+ (netrc-credentials nnimap-address "imap"))
+ ((eq nnimap-stream 'stream)
+ (nnimap-open-shell-stream
+ "*nnimap*" (current-buffer) nnimap-address
+ (or nnimap-server-port "imap"))
+ (netrc-credentials nnimap-address "imap"))
+ ((eq nnimap-stream 'ssl)
+ (open-tls-stream "*nnimap*" (current-buffer) nnimap-address
+ (or nnimap-server-port "imaps"))
+ (netrc-credentials nnimap-address "imaps" "imap")))))