[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [smtpmail.el] Encoding problem in smtpmail-send-queued-mail

From: Jesper Harder
Subject: Re: [smtpmail.el] Encoding problem in smtpmail-send-queued-mail
Date: Sat, 08 Dec 2001 18:40:50 +0100
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1 (i686-pc-linux-gnu)

Simon Josefsson <address@hidden> writes:

> Jesper Harder <address@hidden> writes:
>> for sending mail with Gnus, every 8bit character in the mail is
>> preceded by a \201 when the mail is sent.  When I set
>> `smtpmail-queue-mail' to nil, the error doesn't occur.
>> Making `smtpmail-send-queued-mail' open the file with the queued mail
>> literally fixes the problem for me:
> FWIW I agree that this patch probably isn't the right thing.  The file
> was saved using one coding system, so visiting it literally probably
> just happens to work for latin-1.
> It seems as if `smtpmail-code-conv-from' is not set when sending
> messages from the queue.  I think it should.  Can you try this patch
> instead of yours?
> --- smtpmail.el.~1.36.~       Sat Dec  1 01:36:12 2001
> +++ smtpmail.el       Sat Dec  8 17:43:42 2001
> @@ -370,7 +370,12 @@
>    ;;; Get index, get first mail, send it, get second mail, etc...
>    (let ((buffer-index (find-file-noselect smtpmail-queue-index))
>       (file-msg "")
> -     (tembuf nil))
> +     (tembuf nil)
> +     (smtpmail-code-conv-from
> +      (if enable-multibyte-characters
> +          (let ((sendmail-coding-system smtpmail-code-conv-from))
> +            (with-current-buffer buffer-index
> +              (select-message-coding-system)))))))
>      (with-current-buffer buffer-index
>        (beginning-of-buffer)
>        (while (not (eobp))

Sorry, I can't apply the patch.  It seems that you're using a different
version of smtpmail.el -- my version is from Emacs 21.1.  But I assume
that what you mean is something like this:


(defun smtpmail-send-queued-mail ()
  "Send mail that was queued as a result of setting `smtpmail-queue-mail'."
  ;;; Get index, get first mail, send it, get second mail, etc...
  (let* ((buffer-index (find-file-noselect smtpmail-queue-index))
        (file-msg "")
        (tembuf nil)
         (if enable-multibyte-characters
             (let ((sendmail-coding-system smtpmail-code-conv-from))
               (with-current-buffer buffer-index
      (set-buffer buffer-index)
      (while (not (eobp))
        (setq file-msg (buffer-substring (point) (save-excursion
        (load file-msg)
        (setq tembuf (find-file-noselect file-msg))
        (if (not (null smtpmail-recipient-address-list))
            (if (not (smtpmail-via-smtp smtpmail-recipient-address-list 
                (error "Sending failed; SMTP protocol error"))
          (error "Sending failed; no recipients"))  
        (delete-file file-msg)
        (delete-file (concat file-msg ".el"))
        (kill-buffer tembuf)
        (kill-line 1))      
      (set-buffer buffer-index)
      (save-buffer smtpmail-queue-index)
      (kill-buffer buffer-index)


And no, it doesn't solve the problem.  I'll include a few Latin-1 chars
to show it:


reply via email to

[Prev in Thread] Current Thread [Next in Thread]