[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]
[MD:1215]problem of smtpmail.el
- X-ml-count: 1215
- Subject: [MD:1215]problem of smtpmail.el
- From: Kenichi Handa <handa@xxxxxxxxx>
- Date: Tue, 25 May 1999 20:29:37 +0900 (JST)
$B:G6a(B ntemacs $B$NJ}$+$i(B smtpmail.el $B$NLdBj$NJs9p$r<u$1$^$7$?!#0J2<$K!"0l(B
$BO"$N%a%$%k!J#3DL!K$rIU$1$^$9!#(B
$B!]!]!!$1$s$A$c$s!w#E#T#L(B
handa@xxxxxxxxx
---mail1-------------------------------------------------------------------
Date: Sun, 23 May 1999 18:41:35 +0100
From: "Andrew Innes" <andrewi@xxxxxxxxxxxxxxx>
To: bzhang@xxxxxxxxxx
CC: ntemacs-users@xxxxxxxxxxxxxxxxx, rms@xxxxxxx,
Kenichi Handa <handa@xxxxxxxxx>
In-reply-to: <000201bea48a$18d4e480$501c0ccf@binzhang> (bzhang@xxxxxxxxxx)
Subject: Re: Send mail in Chinese
Content-Length: 808
On Sat, 22 May 1999 09:34:24 -1000, "Bin Zhang" <bzhang@xxxxxxxxxx> said:
>Hi,
>
>I am running 20.3.8.2 on a win95 machine with smtpmail. If I send a message
>in Chinese, the recipient wouldn't be able to read it. It's all garbled. Is
>this a smtpmail problem? I have no problem doing the same from a Unix
>machine with Emacs. Is there a fix? Thanks.
It does indeed look like a problem with smtpmail.el; the Unix machine
almost certainly uses sendmail.el, which has coding system support (at
least if you are using an equivalent version), but smtpmail.el
explicitly disables encoding so it will send the internal Emacs buffer
representation of text, which would appear garbled to the receipient.
I don't know whether we have time to add coding system support to
smtpmail.el for 20.4 though.
AndrewI
---mail2-------------------------------------------------------------------
Date: Mon, 24 May 1999 21:50:12 +0900 (JST)
From: Kenichi Handa <handa@xxxxxxxxx>
To: andrewi@xxxxxxxxxxxxxxx
CC: bzhang@xxxxxxxxxx, ntemacs-users@xxxxxxxxxxxxxxxxx, rms@xxxxxxx,
handa@xxxxxxxxx
In-reply-to: <9160-Sun23May1999184135+0100-andrewi@xxxxxxxxxxxxxxx>
Subject: Re: Send mail in Chinese
Content-Length: 3746
"Andrew Innes" <andrewi@xxxxxxxxxxxxxxx> writes:
> On Sat, 22 May 1999 09:34:24 -1000, "Bin Zhang" <bzhang@xxxxxxxxxx> said:
>> Hi,
>>
>> I am running 20.3.8.2 on a win95 machine with smtpmail. If I send a message
>> in Chinese, the recipient wouldn't be able to read it. It's all garbled. Is
>> this a smtpmail problem? I have no problem doing the same from a Unix
>> machine with Emacs. Is there a fix? Thanks.
> It does indeed look like a problem with smtpmail.el; the Unix machine
> almost certainly uses sendmail.el, which has coding system support (at
> least if you are using an equivalent version), but smtpmail.el
> explicitly disables encoding so it will send the internal Emacs buffer
> representation of text, which would appear garbled to the receipient.
I didn't know about the existence of this file, and was surprised
about the following code in the file:
(defun smtpmail-send-data-1 (process data)
(goto-char (point-max))
(when smtpmail-code-conv-from
(setq data (encode-coding-string data *internal* smtpmail-code-conv-from)))
Here are two bugs, *internal* is not bound, and the argument for
encode-coding-string is wrong. It seems that this code came from Mule
Ver.2.3, but I've never touched this file. ChangeLog says nothing
about where this code came from?!?
> I don't know whether we have time to add coding system support to
> smtpmail.el for 20.4 though.
The attached rather simple patch will work. I checked it by making a
buffer of this contents:
----------------------------------------------------------------------
To: handa@xxxxxxxxxxxxxxxxxxxxx
XXXXX: I PUT HERE SOME MULTIBYTE CHARACTERS.
----------------------------------------------------------------------
and ESC : (smtpmail-send-it) RET
But I have not yet checked how this change influence the other calling
sequences. Could you try it on Windows?
---
Ken'ichi HANDA
handa@xxxxxxxxx
----------------------------------------------------------------------
1999-05-24 Kenichi HANDA <handa@xxxxxxxxx>
* mail/smtpmail.el (smtpmail-send-it): Bind
smtpmail-code-conv-from properly.
(smtpmail-send-data-1): If DATA is a multibyte string, encode it
by smtpmail-code-conv-from.
Index: smtpmail.el
===================================================================
RCS file: /usr/local/cvsroot/emacs/lisp/mail/smtpmail.el,v
retrieving revision 1.1.1.1
diff -u -c -r1.1.1.1 smtpmail.el
cvs diff: conflicting specifications of output style
*** smtpmail.el 1999/05/08 11:46:12 1.1.1.1
--- smtpmail.el 1999/05/24 12:40:39
***************
*** 122,128 ****
(tembuf (generate-new-buffer " smtpmail temp"))
(case-fold-search nil)
delimline
! (mailbuf (current-buffer)))
(unwind-protect
(save-excursion
(set-buffer tembuf)
--- 122,132 ----
(tembuf (generate-new-buffer " smtpmail temp"))
(case-fold-search nil)
delimline
! (mailbuf (current-buffer))
! (smtpmail-code-conv-from
! (if enable-multibyte-characters
! (let ((sendmail-coding-system smtpmail-code-conv-from))
! (select-message-coding-system)))))
(unwind-protect
(save-excursion
(set-buffer tembuf)
***************
*** 564,571 ****
(defun smtpmail-send-data-1 (process data)
(goto-char (point-max))
! (when smtpmail-code-conv-from
! (setq data (encode-coding-string data *internal* smtpmail-code-conv-from)))
(if smtpmail-debug-info
(insert data "\r\n"))
--- 568,577 ----
(defun smtpmail-send-data-1 (process data)
(goto-char (point-max))
! (if (and (multibyte-string-p data)
! smtpmail-code-conv-from)
! (setq data (string-as-multibyte
! (encode-coding-string data smtpmail-code-conv-from))))
(if smtpmail-debug-info
(insert data "\r\n"))
---mail3-------------------------------------------------------------------
Date: Mon, 24 May 1999 14:09:18 +0100 (BST)
From: Andrew Innes <andrewi@xxxxxxxxxxxxxxx>
To: handa@xxxxxxxxx
CC: bzhang@xxxxxxxxxx, rms@xxxxxxx, handa@xxxxxxxxx
In-reply-to: <199905241250.VAA03169@xxxxxxxxxxxxxxxx> (message from Kenichi
Handa on Mon, 24 May 1999 21:50:12 +0900 (JST))
Subject: Re: Send mail in Chinese
Content-Length: 907
On Mon, 24 May 1999 21:50:12 +0900 (JST), Kenichi Handa <handa@xxxxxxxxx> said:
>I didn't know about the existence of this file, and was surprised
>about the following code in the file:
>
>(defun smtpmail-send-data-1 (process data)
> (goto-char (point-max))
>
> (when smtpmail-code-conv-from
> (setq data (encode-coding-string data *internal* smtpmail-code-conv-from)))
>
>Here are two bugs, *internal* is not bound, and the argument for
>encode-coding-string is wrong. It seems that this code came from Mule
>Ver.2.3, but I've never touched this file. ChangeLog says nothing
>about where this code came from?!?
It was originally written by Tomoji Kagatani
<kagatani@xxxxxxxxxxxxxxxxxxx>, who I guess may have used it with the
Windows port of MULE. But smtpmail.el has never been properly MULEified
(it was contributed to Emacs for version 19.32).
I'll try your patch as soon as I can.
AndrewI