unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Kai Harries <kai.harries@gmail.com>
To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org
Cc: Tomi Ollila <tomi.ollila@iki.fi>
Subject: Re: bounce/forward not working due to CR at line end
Date: Fri, 17 Nov 2017 19:16:07 +0100	[thread overview]
Message-ID: <87d14g22l4.fsf@x230.kaiha.invalid> (raw)
In-Reply-To: <877eup90f0.fsf@tethera.net>

David Bremner <david@tethera.net> writes:

> Kai Harries <kai.harries@gmail.com> writes:
>
>> David Bremner <david@tethera.net> writes:
>>
>>> Kai Harries <kai.harries@gmail.com> writes:
>>>
>>>> David Bremner <david@tethera.net> writes:
>>>>
>>>>> During off-list discussion, Kai mentioned id:87a7zsm5ol.fsf@gmail.com as
>>>>> a message that he cannot bounce (and also not forward?). For me this
>>>>> forwards fine, but does not bounce because it has a corrupted Cc header,
>>>>> and my MTA rejects it.  That doesn't sound related to the original
>>>>> problem report (nothing about line endings).
>>>>
>>>> Can you please evaluate the following on your system:
>>>>
>>>>   (call-process "notmuch" nil t nil "show" "--format=raw" "id:87a7zsm5ol.fsf@gmail.com")
>>>>
>>>> If I do this on my system, then the text that is inserted into the
>>>> buffer has ^M (CR) at the line endings. Is this expected?
>>>
>>> No ^M line endings for me. Can you check the file on disk? Maybe "od -a"
>>> lacking a better idea.
>>
>> `od -a` does also show that the lines are ending with 'cr' and 'nl'
>> this is correct according to RFC 2822 [1].
>
> That's not so clear. RFC2822 is explicitely not about disk storage; see
> the Scope paragraph of RFC2822 or RFC522. I think most peoples unix mail
> delivery agents use line feeds, otherwise more people would be having
> problems resending mail.  See e.g. point 2 in
>
>      https://www.exim.org/exim-html-current/doc/html/spec_html/ch-message_processing.html
>
> Be that as it may, apparently your system is using CRLF.

I am using gmailier [1] to sync my maildir. For testing purpose I just
installed offlineimap and in contrast to gmailiier the mails on
disk have no CRLF. 

>> According to this [2] Emacs normally converts line endings to only 'nl'
>> (newline) when opening a DOS file. This works on my system, if I open the
>> file from disk no carriage-return (^M) is shown.
>>
>> Not working is inserting the output of `notmuch show` into a buffer. If
>> I do this, then the carriage-return (^M) is shown.
>
> Yes, notmuch-show-resend-message uses notmuch-show-view-raw-message,
> which intentionally turns off any conversion
>
>>
>> David, I assume your system is also a Linux, does
>>
>>   notmuch show --format=raw id:1472041345236.7014@de.bosch.com | od -a
>>
>> also show 'cr' and 'nl' as line ending?
>
> No, I don't have carriage returns in my actual files on disk, and
> consequently not in the output of notmuch show --format=raw.
>
> I suspect notmuch is mostly fine with CRLF line endings, due to mainly
> passing everything through gmime. But in the case of notmuch show
> --format=raw, this is not the case.
>
> I did confirm that adding CRLF line endings to an existing mail file
> causes the symptoms you originally described.
>
> I'm still not sure the best place to fix this; I'm pretty sure upstream
> emacs won't accept your change (or equivalent) to mime-to-mml.
>
> d

I am thinking about filing a ticket against gmailier because storing the
emails with CRLF on a *nix is at least surprising.

[1] https://github.com/gauteh/gmailieer

  reply	other threads:[~2017-11-17 18:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-09 20:34 bounce/forward not working due to CR at line end Kai Harries
2017-11-15 12:43 ` David Bremner
2017-11-15 21:08   ` Kai Harries
2017-11-15 21:48     ` David Bremner
2017-11-16 15:57       ` Tomi Ollila
2017-11-16 19:48       ` Kai Harries
2017-11-17  1:08         ` David Bremner
2017-11-17 18:16           ` Kai Harries [this message]
2017-11-18 15:30             ` David Bremner
2017-11-19 12:25             ` Gaute Hope
2017-11-19 15:33               ` Kai Harries

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d14g22l4.fsf@x230.kaiha.invalid \
    --to=kai.harries@gmail.com \
    --cc=david@tethera.net \
    --cc=notmuch@notmuchmail.org \
    --cc=tomi.ollila@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).