From unknown Mon Aug 18 20:50:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7589: smtpmail: bad line endings in queued mails on Windows Resent-From: Vida =?UTF-8?Q?G=C3=A1bor?= Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Dec 2010 23:24:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 7589 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 7589@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.129176421218561 (code B ref -1); Tue, 07 Dec 2010 23:24:03 +0000 Received: (at submit) by debbugs.gnu.org; 7 Dec 2010 23:23:32 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PQ6sd-0004pJ-Qi for submit@debbugs.gnu.org; Tue, 07 Dec 2010 18:23:32 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PQ6pe-0004iy-AU for submit@debbugs.gnu.org; Tue, 07 Dec 2010 18:20:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PQ6vM-0004XK-To for submit@debbugs.gnu.org; Tue, 07 Dec 2010 18:26:22 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:40730) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PQ6vM-0004XF-QA for submit@debbugs.gnu.org; Tue, 07 Dec 2010 18:26:20 -0500 Received: from [140.186.70.92] (port=57161 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQ6vL-0007xq-75 for bug-gnu-emacs@gnu.org; Tue, 07 Dec 2010 18:26:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PQ6vJ-0004Wj-CP for bug-gnu-emacs@gnu.org; Tue, 07 Dec 2010 18:26:19 -0500 Received: from b.relay.invitel.net ([62.77.203.4]:39996) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PQ6vI-0004WW-Ts for bug-gnu-emacs@gnu.org; Tue, 07 Dec 2010 18:26:17 -0500 Received: from mail.invitel.hu (mail.invitel.hu [213.163.59.4]) by b.relay.invitel.net (Invitel Core SMTP Transmitter) with ESMTP id 004C931A3FB for ; Wed, 8 Dec 2010 00:26:15 +0100 (CET) Received: from nedu.dyndns.org ([91.82.32.120]) by mail.invitel.hu (Invitel Messaging Server) with ESMTPA id <0LD2009MIZRR0SF0@invitel.hu> for bug-gnu-emacs@gnu.org; Wed, 08 Dec 2010 00:26:15 +0100 (CET) Received: from EV001A4B593FDA (localhost [127.0.0.1]) by nedu.dyndns.org (Postfix) with ESMTP id 1BF1E397D83 for ; Wed, 08 Dec 2010 01:03:10 +0100 (CET) Date: Wed, 08 Dec 2010 00:26:15 +0100 From: Vida =?UTF-8?Q?G=C3=A1bor?= Message-id: MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-transfer-encoding: quoted-printable User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (windows-nt) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Spam-Score: -5.9 (-----) X-Mailman-Approved-At: Tue, 07 Dec 2010 18:23:30 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) Hi! I've already sent this bug to help-emacs-windows (as advised by M-x report-emacs-bug in Windows port of "GNU Emacs 23.1.50.1 (i386-mingw-nt6.0.6001) of 2009-11-04 on LENNART-69DE564 (patched)"), but I think that is not the best place, so do I report it here. [h-e-w] 23.1.50; smtpmail: bad line endings in queued mails From: G=C3=A1bor Vida Subject: [h-e-w] 23.1.50; smtpmail: bad line endings in queued mails Date: Sun, 26 Sep 2010 00:20:31 +0200 Hi! This problem comes only if `smtpmail-queue-mail' is set to `t'. When I'm ready with the mail, smtpmail-send-it is called and it tries 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 end of each line. This causes problem (at least with MS Exchange) when I send 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). I tried to understand what and where is the problem in the code, but 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 run Emacs from Cygwin. Thanks and regards, G=C3=A1bor Here is the bugous smtpmail trace: [...] 250-SIZE 10485760^M 250-PIPELINING^M 250-DSN^M 250-ENHANCEDSTATUSCODES^M 250-AUTH GSSAPI NTLM LOGIN^M 250-8BITMIME^M 250-BINARYMIME^M 250 CHUNKING^M [...] 235 2.7.0 Authentication successful^M MAIL FROM: SIZE=3D426^M 250 2.1.0 Sender OK^M RCPT TO:^M 250 2.1.5 Recipient OK^M DATA^M 354 Start mail input; end with .^M From: address@hidden (=3D?utf-8?Q?G=3DC3=3DA1bor?=3D VIDA)^M^M To: Vida =3D?utf-8?Q?G=3DC3=3DA1bor?=3D ^M^M Subject: aa^M^M Date: Sat, 25 Sep 2010 22:52:36 +0200^M^M Message-ID: ^M^M User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (windows-nt)^M^M MIME-Version: 1.0^M^M Content-Type: text/plain; charset=3Dutf-8^M^M Content-Transfer-Encoding: base64^M^M ^M^M DQotLSANCsOcZHYsDQpHw6Fib3INCg=3D=3D^M^M .^M 250 2.6.0 Queued mail for delivery^M QUIT^M 221 2.0.0 Service closing transmission channel^M And the generated part: This is a bug report for the PATCHED Emacs+EmacsW32. Please test the unpatched version of Emacs+EmacsW32 before reporting if you can. If the bug is also in the unpatched version then report from the unpatched version else report here. If it is very inconvenient for you to try the unpatched version, but you believe the bug is not related to the patches then you may change the address above to address@hidden For easy to read information about the patches see EmacsW32 home page. Please write in English if possible, because the Emacs maintainers usually do not have translators to read other languages for them. Your bug report will be posted to the address@hidden mailing list. Please describe exactly what actions triggered the bug and the precise symptoms of the bug. If you can, give a recipe starting from `emacs -Q': If Emacs crashed, and you have the Emacs process in the gdb debugger, please include the output from the following gdb commands: `bt full' and `xbacktrace'. For information about debugging Emacs, please read the file c:/Program Files/Emacs/emacs/etc/DEBUG. In GNU Emacs 23.1.50.1 (i386-mingw-nt6.0.6001) of 2009-11-04 on LENNART-69DE564 (patched) Windowing system distributor `Microsoft Corp.', version 6.0.6001 configured using `configure --with-gcc (3.4) --cflags -Ic:/g/include' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: C.UTF-8 value of $XMODIFIERS: nil locale-coding-system: cp1252 default enable-multibyte-characters: t Major mode: Fundamental Minor modes in effect: minibuffer-depth-indicate-mode: t icicle-mode: t display-time-mode: t pretty-control-l-mode: t delete-selection-mode: t shell-dirtrack-mode: t which-function-mode: t show-paren-mode: t tooltip-mode: t mouse-wheel-mode: t noticeable-minibuffer-prompts-mode: t file-name-shadow-mode: t global-font-lock-mode: t global-auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t size-indication-mode: t line-number-mode: t transient-mark-mode: t Recent input: C-n C-n C-n C-n C-n C-n C-n # # # # # # # # # # # #=20 # # # # C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p=20 C-p C-p C-p C-p C-x b * M m =20 C-x k y C-x b * t r =20 M-> M-< C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n=20 C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n=20 C-n C-n C-p C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f=20 C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f=20 C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-n=20 C-n C-n C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p=20 C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p=20 C-p C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n=20 C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n=20 C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n=20 C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n=20 C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n M-<=20 C-s v i d a g C-s C-n C-p C-p C-p C-p C-p C-p C-p C-p=20 C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p=20 C-p C-p C-s b u g s C-s C-n C-p C-n C-n C-n C-n C-n=20 C-n C-n C-n C-n C-n C-p C-p C-p C-p C-p C-p C-p C-p=20 C-p C-p C-p C-s m a i l i n g M-b M-b M-b M-b M-b M-b=20 C-SPC M-f M-f M-f M-w C-p C-p C-p M-x M-p M-p Recent messages: No more articles [2 times] Computing completion candidates... [2 times] Buffer *mail* modified; kill anyway? (y or n)=20 Computing completion candidates... Mark set [2 times] Auto-saving...done Mark set Mark saved where search started [3 times] Mark set Auto-saving...done Load-path shadows: ~/config/emacs.d/elisp/apel/timezone hides c:/Program=20 Files/Emacs/emacs/lisp/timezone ~/config/emacs.d/elisp/apel/env hides c:/Program Files/Emacs/emacs/lisp/env c:/Program Files/Emacs/EmacsW32/nxhtml/util/chart hides c:/Program=20 Files/Emacs/emacs/lisp/emacs-lisp/chart Features: (shadow emacsbug debug smiley gnus-async gnus-bcklg goto-addr vc-cvs noutline outline cl-specs edebug mule-diag newcomment multi-isearch windmove time-stamp mailalias sort bbdb-gui gnus-cite face-remap parse-time gnus-ml gnus-topic nnfolder utf-7 utf7 nnimap nndraft nnmh bbdb-gnus bbdb-snarf mail-extr bbdb-com nnagent nnml gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015 pgg pgg-parse pgg-def mm-view smime dig gnus-cache gnus-sum gnus-demon nntp gnus-group gnus-undo nnmail mail-source nnoo gnus-start gnus-spec gnus-int gnus-range gnus-win gnus gnus-ems mb-depth two-column bookmark pp icicles icicles-mode icicles-cmd2 yow cookie1 etags icicles-cmd1 icicles-mcmd help-mode view icicles-fn icicles-mac icicles-var icicles-opt icicles-face hexrgb time google-maps google-maps-static google-maps-geocode google-maps-base json bbdb-autoloads bbdb hidesearch hide-lines jabber-autoloads tramp-imap epa epg epg-config imap-hash imap message ecomplete rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader gmm-utils mailheader canlock sha1 hex-util hashcash mail-utils assoc tramp-gw tramp-fish tramp-cache tramp-ftp tramp-cmds tramp auth-source gnus-util netrc time-date password-cache format-spec tramp-compat trampver traverselisp grep-a-lot grep+ compile+ compile- uniquify byte-opt hexview-mode htmlize auto-install thingatpt bytecomp byte-compile smtpmail sendmail modeline-posn shebang pp-c-l buff-menu+ delsel irfc muse-html muse-xml-common pcomplete cus-edit cus-start muse-publish muse-project muse-protocols info muse-regexps derived muse muse-nested-tags muse-mode google winner filecache multi-term term ehelp elscreen-server elscreen-w3m mule-util alist elscreen multi-shell edmacro kmacro ansi-color shell type-break sunrise-commander advice help-fns advice-preload dired-x dired-aux dired w3m-load url url-proxy url-privacy url-expand url-methods url-history url-cookie url-util url-parse timezone pym static apel-ver product url-vars mm-util mail-prsvr mailcap esense-start erlang regexp-opt erlang-start whitespace which-func imenu paren hl-line+ hl-line avoid ffap memo-pop fixme-mode saveplace vc-dispatcher vc-svn emacsw32 find-func w32-meta menuacc tmm electric w32-integ w32shell w32-grep grep compile comint ring rebind ourcomments-widgets new-key-seq-widget wid-edit hfyview easy-mmode easymenu htmlfontify cl cl-19 noprint nxhtml-loader emacsw32-eol tooltip ediff-hook vc-hooks lisp-float-type mwheel dos-w32 disp-table ls-lisp w32-win w32-vars tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mldrag mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev button minibuffer faces cus-face text-properties overlay md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process multi-tty emacs) From unknown Mon Aug 18 20:50:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7589: smtpmail: bad line endings in queued mails on Windows 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: To: Vida =?UTF-8?Q?G=C3=A1bor?= Cc: 7589@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 7589-submit@debbugs.gnu.org id=B7589.129199143730995 (code B ref 7589); Fri, 10 Dec 2010 14:31:01 +0000 Received: (at 7589) by debbugs.gnu.org; 10 Dec 2010 14:30:37 +0000 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 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 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) 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) Date: Fri, 10 Dec 2010 16:36:06 +0200 From: Eli Zaretskii In-reply-to: Message-id: <83lj3x1yqx.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-transfer-encoding: QUOTED-PRINTABLE X-012-Sender: halo1@inter.net.il References: X-Spam-Score: -1.9 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > 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) From unknown Mon Aug 18 20:50:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7589: smtpmail: bad line endings in queued mails on Windows Resent-From: Vida =?UTF-8?Q?G=C3=A1bor?= Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 11 Dec 2010 09:38: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: To: Eli Zaretskii Cc: 7589@debbugs.gnu.org Received: via spool by 7589-submit@debbugs.gnu.org id=B7589.12920602776849 (code B ref 7589); Sat, 11 Dec 2010 09:38:01 +0000 Received: (at 7589) by debbugs.gnu.org; 11 Dec 2010 09:37:57 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PRLts-0001mQ-OZ for submit@debbugs.gnu.org; Sat, 11 Dec 2010 04:37:57 -0500 Received: from b.relay.invitel.net ([62.77.203.4]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PRLtp-0001mD-S6 for 7589@debbugs.gnu.org; Sat, 11 Dec 2010 04:37:54 -0500 Received: from mail.invitel.hu (mail.invitel.hu [213.163.59.4]) by b.relay.invitel.net (Invitel Core SMTP Transmitter) with ESMTP id 84A5131A17E; Sat, 11 Dec 2010 10:43:57 +0100 (CET) Received: from nedu.dyndns.org ([91.82.241.67]) by mail.invitel.hu (Invitel Messaging Server) with ESMTPA id <0LD9001ZOCD4DDC0@invitel.hu>; Sat, 11 Dec 2010 10:43:53 +0100 (CET) Received: from EV001A4B593FDA (localhost [127.0.0.1]) by nedu.dyndns.org (Postfix) with ESMTP id 66D41150064; Sat, 11 Dec 2010 11:20:34 +0100 (CET) Date: Sat, 11 Dec 2010 10:43:47 +0100 From: Vida =?UTF-8?Q?G=C3=A1bor?= In-reply-to: <83lj3x1yqx.fsf@gnu.org> Message-id: MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-transfer-encoding: quoted-printable References: <83lj3x1yqx.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (windows-nt) X-Spam-Score: -3.2 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.1 (---) > 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. Still doesn't work. I put some (message ...) to see the value of some variables during the execution of smtpmail-send-it and I think the problem is possibly somewhere else. 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. In the body of the very first let in smtpmail-send-it, just after the varlist, the enable-multibyte-characters is nil, and thus smtpmail-code-conv-from is also nil. But the global vaule of enable-multibyte-characters is t. Do you think it helps anything if I investigate where enable-multibyte-characters is set to nil? Here is the mail I wanted to send, the saved mail file and the trace of SMTP: To: vidagabor@gmail.com Subject: probe mail Date: Sat, 11 Dec 2010 10:02:47 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (windows-nt) Gcc: nnimap+nedu:incoming From: "Vida G=C3=A1bor" a b c --=20 =C3=9Cdv, G=C3=A1bor ---------------------------------------------------------------------------= --- From: =3D?utf-8?Q?Vida_G=3DC3=3DA1bor?=3D ^M To: vidagabor@gmail.com^M Subject: probe mail^M User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (windows-nt)^M Date: Sat, 11 Dec 2010 10:03:37 +0100^M Message-ID: ^M MIME-Version: 1.0^M Content-Type: text/plain; charset=3Dutf-8^M Content-Transfer-Encoding: base64^M ^M YQ0KYg0KYw0KDQotLSANCsOcZHYsDQpHw6Fib3INCg=3D=3D^M ---------------------------------------------------------------------------= --- Process SMTP deleted 220 nedu.dyndns.org ESMTP Postfix^M EHLO EV001A4B593FDA^M 250-nedu.dyndns.org^M 250-PIPELINING^M 250-SIZE 50000000^M 250-VRFY^M 250-ETRN^M 250-ENHANCEDSTATUSCODES^M 250-8BITMIME^M 250 DSN^M MAIL FROM: SIZE=3D401^M 250 2.1.0 Ok^M RCPT TO:^M 250 2.1.5 Ok^M DATA^M 354 End data with .^M From: =3D?utf-8?Q?Vida_G=3DC3=3DA1bor?=3D ^M^M To: vidagabor@gmail.com^M^M Subject: probe mail^M^M User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (windows-nt)^M^M Date: Sat, 11 Dec 2010 10:03:37 +0100^M^M Message-ID: ^M^M MIME-Version: 1.0^M^M Content-Type: text/plain; charset=3Dutf-8^M^M Content-Transfer-Encoding: base64^M^M ^M^M YQ0KYg0KYw0KDQotLSANCsOcZHYsDQpHw6Fib3INCg=3D=3D^M^M .^M 250 2.0.0 Ok: queued as A2FB814F727^M QUIT^M 221 2.0.0 Bye^M From unknown Mon Aug 18 20:50:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7589: smtpmail: bad line endings in queued mails on Windows 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: Sat, 11 Dec 2010 10:02:02 +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: To: Vida =?UTF-8?Q?G=C3=A1bor?= Cc: 7589@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 7589-submit@debbugs.gnu.org id=B7589.12920616868969 (code B ref 7589); Sat, 11 Dec 2010 10:02:02 +0000 Received: (at 7589) by debbugs.gnu.org; 11 Dec 2010 10:01:26 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PRMGb-0002Kc-Ep for submit@debbugs.gnu.org; Sat, 11 Dec 2010 05:01:25 -0500 Received: from mtaout21.012.net.il ([80.179.55.169]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PRMGY-0002KI-7w for 7589@debbugs.gnu.org; Sat, 11 Dec 2010 05:01:23 -0500 Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0LD900J00D655O00@a-mtaout21.012.net.il> for 7589@debbugs.gnu.org; Sat, 11 Dec 2010 12:07:26 +0200 (IST) Received: from HOME-C4E4A596F7 ([84.229.142.197]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LD900JPBDGC3B40@a-mtaout21.012.net.il>; Sat, 11 Dec 2010 12:07:26 +0200 (IST) Date: Sat, 11 Dec 2010 12:07:39 +0200 From: Eli Zaretskii In-reply-to: Message-id: <83d3p8vd04.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: QUOTED-PRINTABLE X-012-Sender: halo1@inter.net.il References: <83lj3x1yqx.fsf@gnu.org> X-Spam-Score: -1.9 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > Date: Sat, 11 Dec 2010 10:43:47 +0100 > From: Vida G=E1bor > Cc: 7589@debbugs.gnu.org >=20 > smtpmail-code-conv-from is nil and the return value of > (coding-system-change-eol-conversion ...) is also nil right after t= he > function call of (set-buffer-file-coding-system ...) that you modif= ied > in your patch. Sorry, missed that use-case. How about the patch below? (It is relative to the original version of smtpmail.el.) =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-11 10:03:04 +0000 @@ -392,7 +392,14 @@ 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 +=09=09 (or smtpmail-code-conv-from 'undecided) +=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) From unknown Mon Aug 18 20:50:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7589: smtpmail: bad line endings in queued mails on Windows Resent-From: Vida =?UTF-8?Q?G=C3=A1bor?= Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Dec 2010 19:35:02 +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: To: Eli Zaretskii Cc: 7589@debbugs.gnu.org Received: via spool by 7589-submit@debbugs.gnu.org id=B7589.12921824992464 (code B ref 7589); Sun, 12 Dec 2010 19:35:02 +0000 Received: (at 7589) by debbugs.gnu.org; 12 Dec 2010 19:34:59 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PRrhD-0000dh-G6 for submit@debbugs.gnu.org; Sun, 12 Dec 2010 14:34:59 -0500 Received: from a.relay.invitel.net ([62.77.203.3]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PRrhB-0000dS-2O for 7589@debbugs.gnu.org; Sun, 12 Dec 2010 14:34:58 -0500 Received: from mail.invitel.hu (mail.invitel.hu [213.163.59.4]) by a.relay.invitel.net (Invitel Core SMTP Transmitter) with ESMTP id 6026211A1EE; Sun, 12 Dec 2010 20:41:04 +0100 (CET) Received: from nedu.dyndns.org ([87.97.52.70]) by mail.invitel.hu (Invitel Messaging Server) with ESMTPA id <0LDB00HB6YO5PA00@invitel.hu>; Sun, 12 Dec 2010 20:40:53 +0100 (CET) Received: from EV001A4B593FDA (localhost [127.0.0.1]) by nedu.dyndns.org (Postfix) with ESMTP id 881511B8C9B; Sun, 12 Dec 2010 21:17:34 +0100 (CET) Date: Sun, 12 Dec 2010 20:40:45 +0100 From: Vida =?UTF-8?Q?G=C3=A1bor?= In-reply-to: <83d3p8vd04.fsf@gnu.org> Message-id: MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-transfer-encoding: quoted-printable References: <83lj3x1yqx.fsf@gnu.org> <83d3p8vd04.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (windows-nt) X-Spam-Score: -2.0 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.0 (--) Hi Eli! The correction works fine now according to the SMTP trace. Tomorrow I will try it with an Exchange server (Postfix eated the previous, invalid ^M^M line ending), and notify you about the result, but I'm sure there won't be any problem). Thanks and regards, G=C3=A1bor From unknown Mon Aug 18 20:50:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7589: smtpmail: bad line endings in queued mails on Windows 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: Sun, 12 Dec 2010 20:06:02 +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: To: Vida =?UTF-8?Q?G=C3=A1bor?= Cc: 7589@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 7589-submit@debbugs.gnu.org id=B7589.12921843485326 (code B ref 7589); Sun, 12 Dec 2010 20:06:02 +0000 Received: (at 7589) by debbugs.gnu.org; 12 Dec 2010 20:05:48 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PRsB2-0001Nq-5d for submit@debbugs.gnu.org; Sun, 12 Dec 2010 15:05:48 -0500 Received: from mtaout22.012.net.il ([80.179.55.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PRsB0-0001Nb-0s for 7589@debbugs.gnu.org; Sun, 12 Dec 2010 15:05:46 -0500 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0LDB00M00ZYG9J00@a-mtaout22.012.net.il> for 7589@debbugs.gnu.org; Sun, 12 Dec 2010 22:11:44 +0200 (IST) Received: from HOME-C4E4A596F7 ([84.229.142.197]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LDC00LHO03JMR70@a-mtaout22.012.net.il>; Sun, 12 Dec 2010 22:11:44 +0200 (IST) Date: Sun, 12 Dec 2010 22:12:00 +0200 From: Eli Zaretskii In-reply-to: Message-id: <83ipyyu4xb.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-transfer-encoding: QUOTED-PRINTABLE X-012-Sender: halo1@inter.net.il References: <83lj3x1yqx.fsf@gnu.org> <83d3p8vd04.fsf@gnu.org> X-Spam-Score: -1.9 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > Date: Sun, 12 Dec 2010 20:40:45 +0100 > From: Vida G=C3=A1bor > Cc: 7589@debbugs.gnu.org >=20 > The correction works fine now according to the SMTP trace. Tomorrow= I > will try it with an Exchange server (Postfix eated the previous, in= valid > ^M^M line ending), and notify you about the result, but I'm sure th= ere > won't be any problem). Thanks for testing. I will commit the change as soon as I hear from you that it works with Exchange. From unknown Mon Aug 18 20:50:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7589: smtpmail: bad line endings in queued mails on Windows Resent-From: Vida =?UTF-8?Q?G=C3=A1bor?= Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 13 Dec 2010 12:00:04 +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: To: Eli Zaretskii Cc: 7589@debbugs.gnu.org Received: via spool by 7589-submit@debbugs.gnu.org id=B7589.12922415506441 (code B ref 7589); Mon, 13 Dec 2010 12:00:04 +0000 Received: (at 7589) by debbugs.gnu.org; 13 Dec 2010 11:59:10 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PS73d-0001fq-6y for submit@debbugs.gnu.org; Mon, 13 Dec 2010 06:59:09 -0500 Received: from b.relay.invitel.net ([62.77.203.4]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PS73b-0001fS-A0 for 7589@debbugs.gnu.org; Mon, 13 Dec 2010 06:59:07 -0500 Received: from mail.invitel.hu (mail.invitel.hu [213.163.59.4]) by b.relay.invitel.net (Invitel Core SMTP Transmitter) with ESMTP id 7DEB631A62C; Mon, 13 Dec 2010 13:05:17 +0100 (CET) Received: from nedu.dyndns.org ([91.82.167.160]) by mail.invitel.hu (Invitel Messaging Server) with ESMTPA id <0LDD0012G88SACH1@invitel.hu>; Mon, 13 Dec 2010 13:05:16 +0100 (CET) Received: from EV001A4B593FDA (localhost [127.0.0.1]) by nedu.dyndns.org (Postfix) with ESMTP id D2EA73B6C38; Mon, 13 Dec 2010 13:41:54 +0100 (CET) Date: Mon, 13 Dec 2010 09:59:55 +0100 From: Vida =?UTF-8?Q?G=C3=A1bor?= In-reply-to: <83ipyyu4xb.fsf@gnu.org> Message-id: MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT References: <83lj3x1yqx.fsf@gnu.org> <83d3p8vd04.fsf@gnu.org> <83ipyyu4xb.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (windows-nt) X-Spam-Score: -3.0 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.9 (--) Eli Zaretskii writes: > Thanks for testing. I will commit the change as soon as I hear from > you that it works with Exchange. I can riport that the patched smtpmail.el works fine Exchange. Thanks for the correction. From unknown Mon Aug 18 20:50:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7589: smtpmail: bad line endings in queued mails on Windows 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: Mon, 13 Dec 2010 15:08: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: To: Vida =?UTF-8?Q?G=C3=A1bor?= Cc: 7589@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 7589-submit@debbugs.gnu.org id=B7589.129225285726476 (code B ref 7589); Mon, 13 Dec 2010 15:08:01 +0000 Received: (at 7589) by debbugs.gnu.org; 13 Dec 2010 15:07:37 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PSA00-0006sy-R6 for submit@debbugs.gnu.org; Mon, 13 Dec 2010 10:07:36 -0500 Received: from mtaout20.012.net.il ([80.179.55.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PS9zy-0006sl-Ak for 7589@debbugs.gnu.org; Mon, 13 Dec 2010 10:07:34 -0500 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0LDD00B00GRIDO00@a-mtaout20.012.net.il> for 7589@debbugs.gnu.org; Mon, 13 Dec 2010 17:13:33 +0200 (IST) Received: from HOME-C4E4A596F7 ([84.229.167.122]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LDD00ANNGYJJDA0@a-mtaout20.012.net.il>; Mon, 13 Dec 2010 17:13:33 +0200 (IST) Date: Mon, 13 Dec 2010 17:13:31 +0200 From: Eli Zaretskii In-reply-to: Message-id: <83y67thfj8.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-transfer-encoding: QUOTED-PRINTABLE X-012-Sender: halo1@inter.net.il References: <83lj3x1yqx.fsf@gnu.org> <83d3p8vd04.fsf@gnu.org> <83ipyyu4xb.fsf@gnu.org> X-Spam-Score: -1.9 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > Date: Mon, 13 Dec 2010 09:59:55 +0100 > From: Vida G=C3=A1bor > Cc: 7589@debbugs.gnu.org >=20 > Eli Zaretskii writes: > > Thanks for testing. I will commit the change as soon as I hear f= rom > > you that it works with Exchange. >=20 > I can riport that the patched smtpmail.el works fine Exchange. Than= ks > for the correction. Thanks; installed on the emacs-23 branch for Emacs 23.3. From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 20 07:14:22 2010 Received: (at control) by debbugs.gnu.org; 20 Dec 2010 12:14:22 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PUedB-0002WC-Ol for submit@debbugs.gnu.org; Mon, 20 Dec 2010 07:14:21 -0500 Received: from vm-emlprdomr-06.its.yale.edu ([130.132.50.147]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PUed9-0002Vx-Dt for control@debbugs.gnu.org; Mon, 20 Dec 2010 07:14:19 -0500 Received: from furball (bb116-14-228-227.singnet.com.sg [116.14.228.227]) (authenticated bits=0) by vm-emlprdomr-06.its.yale.edu (8.14.4/8.14.4) with ESMTP id oBKCKjpw004465 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 20 Dec 2010 07:20:47 -0500 Received: by furball (Postfix, from userid 1000) id 40D3B16247C; Mon, 20 Dec 2010 20:20:45 +0800 (SGT) From: Chong Yidong To: control@debbugs.gnu.org Subject: close 7589 Date: Mon, 20 Dec 2010 20:20:45 +0800 Message-ID: <87fwtsd49u.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.71 on 130.132.50.147 X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) close 7589 thanks