To my dismay, I noticed the dreaded ^[-A and ^[-B markers in Jamie
Zawinski's recent message that contained literal Latin 1 characters.
Since Jamie does not appear to use a Mule-based mail reader, I
suspected the corruption happened somewhere on my part.
Sure enough, when I send myself a mail with embedded 8-bit characters,
it is sent correctly, but gets corrupted when retrieved with XEmacs's
`pop3.el'. pop3's code does half of the job by using `binary' coding
for reading and writing to the network -- but it fails to do the same
when appending the data to the crashbox. Since my default coding
system is ISO 8859-2, Mule helpfully decided to adorn the Latin 1
characters with ISO 2022 markup that Gnus doesn't know about or need.
I'm not sure how this kind of thing didn't get noticed before: I'm
beginning to wonder if I'm the only person on earth attempting to use
XEmacs/Mule with Latin 2 for anything more than casual editing.
Ironically, the `pop3.el' that ships with Gnus already contains the
fix, even though it's likely specific to XEmacs/Mule. Anyway, here is
the patch:
2003-09-12 Hrvoje Niksic <hniksic(a)xemacs.org>
* pop3.el (pop3-movemail): Use binary coding system when writing
to crashbox. Since binary was used to read the data from the
network, using it for writing guarantees that the same octets will
be stored that were retrieved from the server.
--- pop3.el.orig 2003-09-12 03:19:49.000000000 +0200
+++ pop3.el 2003-09-12 03:19:26.000000000 +0200
@@ -219,7 +219,8 @@
(setq n (+ 1 n)))
;; frob the crash buffer at the end
(set-buffer crashbuf)
- (append-to-file (point-min) (point-max) crashbox)
+ (let ((coding-system-for-write 'binary))
+ (append-to-file (point-min) (point-max) crashbox))
;; mark messages as read
(when pop3-leave-mail-on-server
(pop3-save-uidls))