bug#17488: 24.3; mail-sendmail-undelimit-header doesn't respect mail-header-separator

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#17488: 24.3; mail-sendmail-undelimit-header doesn't respect mail-header-separator

Katsumi Yamaoka
Hi,

This is probably a rare case, so I'm not sure if it's worth
fixing, though.  If one sets `mail-header-separator' to

"                                       ."

it causes a mail corruption.  It is because `rfc822-goto-eoh'
doesn't respect `mail-header-separator' and the first line of
a message body, rather than the separator, is deleted.

`smtpmail-send-it' and `mailclient-send-it' use it by way of
`mail-sendmail-undelimit-header'.  And `sendmail-send-it' uses
it by way of `mail-header-end'.

Thanks.



Reply | Threaded
Open this post in threaded view
|

bug#17488: 24.3; mail-sendmail-undelimit-header doesn't respect mail-header-separator

Lars Ingebrigtsen
Katsumi Yamaoka <[hidden email]> writes:

> This is probably a rare case, so I'm not sure if it's worth
> fixing, though.  If one sets `mail-header-separator' to
>
> "                                       ."
>
> it causes a mail corruption.  It is because `rfc822-goto-eoh'
> doesn't respect `mail-header-separator' and the first line of
> a message body, rather than the separator, is deleted.

Hm...  I think `rfc822-goto-eoh' does the right thing: It doesn't care
about `mail-header-separator', because that's a user setting for mail
composition buffers, not something that should be consulted after making
that buffer into an RFC2822 mail.

> `smtpmail-send-it' and `mailclient-send-it' use it by way of
> `mail-sendmail-undelimit-header'.  And `sendmail-send-it' uses
> it by way of `mail-header-end'.

So `mail-sendmail-undelimit-header' should consult that variable, I
think, instead of using `rfc822-goto-eoh'?

--
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



Reply | Threaded
Open this post in threaded view
|

bug#17488: 24.3; mail-sendmail-undelimit-header doesn't respect mail-header-separator

Katsumi Yamaoka
In reply to this post by Katsumi Yamaoka
On Sun, 15 Apr 2018 20:09:45 +0200, Lars Ingebrigtsen wrote:
> Hm...  I think `rfc822-goto-eoh' does the right thing: It doesn't care
> about `mail-header-separator', because that's a user setting for mail
> composition buffers, not something that should be consulted after making
> that buffer into an RFC2822 mail.

I see.  It got obvious that `rfc822-goto-eoh' shouldn't respect
`mail-header-separator' after having understood what
`mail-sendmail-delimit-header' does --- it looks for *eoh* using
`rfc822-goto-eoh' and then inserts `mail-header-separator'.  So,
it's a function that converts an RFC2822 mail into the one usable
in a mail composition buffer.  Although there is no program that
uses `mail-sendmail-delimit-header' in Emacs.

>> `smtpmail-send-it' and `mailclient-send-it' use it by way of
>> `mail-sendmail-undelimit-header'.  And `sendmail-send-it' uses
>> it by way of `mail-header-end'.

> So `mail-sendmail-undelimit-header' should consult that variable, I
> think, instead of using `rfc822-goto-eoh'?

I think it will work, but I changed my mind.  That is,
`rfc822-goto-eoh' should be used with an RFC2822 mail, and a mail
composing software should replace the `mail-header-separator' with
an empty line before sending a mail to the `sendmail-function',
like Gnus does.

Regards,



Reply | Threaded
Open this post in threaded view
|

bug#17488: 24.3; mail-sendmail-undelimit-header doesn't respect mail-header-separator

Lars Ingebrigtsen
Katsumi Yamaoka <[hidden email]> writes:

>> So `mail-sendmail-undelimit-header' should consult that variable, I
>> think, instead of using `rfc822-goto-eoh'?
>
> I think it will work, but I changed my mind.  That is,
> `rfc822-goto-eoh' should be used with an RFC2822 mail, and a mail
> composing software should replace the `mail-header-separator' with
> an empty line before sending a mail to the `sendmail-function',
> like Gnus does.

Yes, they should, so `mail-sendmail-undelimit-header' will normally be a
function that does absolutely nothing (as it is today :-)).  So it
should either be removed, or adjusted to do what it says it does (i.e.,
find the delimited and remove it).  I'll do the latter, and we can
contemplate the former...

--
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



Reply | Threaded
Open this post in threaded view
|

bug#17488: 24.3; mail-sendmail-undelimit-header doesn't respect mail-header-separator

Katsumi Yamaoka
In reply to this post by Katsumi Yamaoka
On Mon, 16 Apr 2018 13:42:02 -0400, Lars Ingebrigtsen wrote:
> branch: scratch/prop-search
> commit e1a0cbbcf8389c76f67048e69139b5b0adf2cf38
> Author: Lars Ingebrigtsen <[hidden email]>
> Commit: Lars Ingebrigtsen <[hidden email]>

>     Make mail-sendmail-undelimit-header actually remove the delimiter

>     * lisp/mail/sendmail.el (mail-sendmail-undelimit-header): Actually
>     remove the mail header separator (bug#17488).  In all the cases
>     where this is called, the separator will probably already have
>     been removed, so the only thing this does is place point at the
>     end of the headers.

This change caused the following error:

Debugger entered--Lisp error: (search-failed "^--text follows this line--\n")
  re-search-forward("^--text follows this line--\n")
  mail-sendmail-undelimit-header()
  smtpmail-send-it()
  message-smtpmail-send-it()

So, I've added ``nil t'' to the re-search form.  ;-)



Reply | Threaded
Open this post in threaded view
|

bug#17488: 24.3; mail-sendmail-undelimit-header doesn't respect mail-header-separator

Lars Ingebrigtsen
Katsumi Yamaoka <[hidden email]> writes:

> So, I've added ``nil t'' to the re-search form.  ;-)

Thanks!  

--
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no