GNU bug report logs - #7589
smtpmail: bad line endings in queued mails on Windows

Previous Next

Package: emacs;

Reported by: Vida Gábor <vidagabor <at> gmail.com>

Date: Tue, 7 Dec 2010 23:24:03 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 7589 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Vida Gábor <vidagabor <at> gmail.com>
Cc: 7589 <at> debbugs.gnu.org
Subject: Re: bug#7589: smtpmail: bad line endings in queued mails on Windows
Date: Sat, 11 Dec 2010 12:07:39 +0200
> Date: Sat, 11 Dec 2010 10:43:47 +0100
> From: Vida Gábor <vidagabor <at> gmail.com>
> Cc: 7589 <at> debbugs.gnu.org
> 
> smtpmail-code-conv-from is nil and the return value of
> (coding-system-change-eol-conversion ...) is also nil right after the
> function call of (set-buffer-file-coding-system ...) that you modified
> in your patch.

Sorry, missed that use-case.  How about the patch below?  (It is
relative to the original version of smtpmail.el.)

=== modified file 'lisp/mail/smtpmail.el'
--- lisp/mail/smtpmail.el	2010-12-09 01:46:03 +0000
+++ lisp/mail/smtpmail.el	2010-12-11 10:03:04 +0000
@@ -392,7 +392,14 @@ The list is in preference order.")
 		(make-directory smtpmail-queue-dir t))
 	      (with-current-buffer buffer-data
 		(erase-buffer)
-		(set-buffer-file-coding-system smtpmail-code-conv-from nil t)
+		(set-buffer-file-coding-system
+		 ;; We will be reading the file with no-conversion in
+		 ;; smtpmail-send-queued-mail below, so write it out
+		 ;; with Unix EOLs.
+		 (coding-system-change-eol-conversion
+		  (or smtpmail-code-conv-from 'undecided)
+		  'unix)
+		 nil t)
 		(insert-buffer-substring tembuf)
 		(write-file file-data)
 		(set-buffer buffer-elisp)






This bug report was last modified 14 years and 193 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.