From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#7589: smtpmail: bad line endings in queued mails on Windows Date: Fri, 10 Dec 2010 16:36:06 +0200 Message-ID: <83lj3x1yqx.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: dough.gmane.org 1291992350 903 80.91.229.12 (10 Dec 2010 14:45:50 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 10 Dec 2010 14:45:50 +0000 (UTC) Cc: 7589@debbugs.gnu.org To: Vida =?UTF-8?Q?G=C3=A1bor?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 10 15:45:46 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PR4ED-0000tH-4K for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 Dec 2010 15:45:45 +0100 Original-Received: from localhost ([127.0.0.1]:51099 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PR4EC-0004dh-K5 for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 Dec 2010 09:45:44 -0500 Original-Received: from [140.186.70.92] (port=59080 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PR4E5-0004co-P8 for bug-gnu-emacs@gnu.org; Fri, 10 Dec 2010 09:45:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PR4E4-0000fI-MR for bug-gnu-emacs@gnu.org; Fri, 10 Dec 2010 09:45:37 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44627) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PR4E4-0000fD-Jj for bug-gnu-emacs@gnu.org; Fri, 10 Dec 2010 09:45:36 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PR3zx-00084X-Qy; Fri, 10 Dec 2010 09:31:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Dec 2010 14:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7589 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 7589-submit@debbugs.gnu.org id=B7589.129199143730995 (code B ref 7589); Fri, 10 Dec 2010 14:31:01 +0000 Original-Received: (at 7589) by debbugs.gnu.org; 10 Dec 2010 14:30:37 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PR3zY-00083r-Rt for submit@debbugs.gnu.org; Fri, 10 Dec 2010 09:30:37 -0500 Original-Received: from mtaout22.012.net.il ([80.179.55.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PR3zW-00080y-GI for 7589@debbugs.gnu.org; Fri, 10 Dec 2010 09:30:35 -0500 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0LD700E00UZD2L00@a-mtaout22.012.net.il> for 7589@debbugs.gnu.org; Fri, 10 Dec 2010 16:35:57 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.229.142.197]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LD700CNXV7VNUG0@a-mtaout22.012.net.il>; Fri, 10 Dec 2010 16:35:57 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Fri, 10 Dec 2010 09:31:01 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:42380 Archived-At: > Date: Wed, 08 Dec 2010 00:26:15 +0100 > From: Vida G=C3=A1bor >=20 > This problem comes only if `smtpmail-queue-mail' is set to `t'. >=20 > When I'm ready with the mail, smtpmail-send-it is called and it tri= es to > save the mail to disk. It is ok, but if I open the file with > find-file-literally, then I see an additional ^M character at the e= nd of > each line. This causes problem (at least with MS Exchange) when I s= end > it: the mail received by the recipient has empty body. This is sure= that > this additional ^M causes the problem (if I set smtpmail-queue-mail= to > nil, the smtpmail trace shows only one ^M at the end of each line). >=20 > I tried to understand what and where is the problem in the code, bu= t the > only conclusion was that if smtpmail reads the saved mail without > conversion (coding-system-for-read set to 'no-conversion), then it > should save it using Unix-style line endings. I think your analysis is correct. Could you please try the patch below? If it works for you, I will install it on the Emacs 23 branch= , so that it will be available in the upcoming Emacs 23.3 release. Thanks. =3D=3D=3D modified file 'lisp/mail/smtpmail.el' --- lisp/mail/smtpmail.el=092010-12-09 01:46:03 +0000 +++ lisp/mail/smtpmail.el=092010-12-10 14:32:28 +0000 @@ -392,7 +392,13 @@ The list is in preference order.") =09=09(make-directory smtpmail-queue-dir t)) =09 (with-current-buffer buffer-data =09=09(erase-buffer) -=09=09(set-buffer-file-coding-system smtpmail-code-conv-from nil t) +=09=09(set-buffer-file-coding-system +=09=09 ;; We will be reading the file with no-conversion in +=09=09 ;; smtpmail-send-queued-mail below, so write it out +=09=09 ;; with Unix EOLs. +=09=09 (coding-system-change-eol-conversion smtpmail-code-conv-from +=09=09=09=09=09=09 'unix) +=09=09 nil t) =09=09(insert-buffer-substring tembuf) =09=09(write-file file-data) =09=09(set-buffer buffer-elisp)