On 2006-11-05 08:44:13 -0800, Linus Torvalds wrote:
Show 11 quoted lines
> On Sun, 5 Nov 2006, Karl Hasselström wrote:
>
> > So the right thing to do would be to teach StGIT to generate
> > 8bit-encoded output, and trust the SMTP transfer path do mangle it
> > correctly? (Hmm. No, since StGIT talks directly with the first
> > SMTP server in the chain, it needs to be able to QP-encode the
> > mail itself if necessary -- but it should seldom be necessary,
> > then.)
>
> Right. You could even just consider it an error if the mailserver
> doesn't reply to EHLO with 8BITMIME, I really think it's that rare.
Makes sense (unless the Python SMTP library can do this for us -- it would be impolite to refuse then).
Show 9 quoted lines
> > In that case, the problem with the current implementation (without
> > my patch applied) is likely to be that it fails to provide the
> > headers needed for the SMTP path to be able to transform it
> > losslessly.
>
> I _think_ it should be sufficient to just set the Content-Type and
> Content-Transfer-Encoding to say something like "text/plain;
> charset=UTF8" and "8bit" respectively. But somebody who know the
> SMTP rules better should check.
These are the headers that StGIT uses without my patch -- that is, the headers used to get that error message:
Content-Type: text/plain; charset=utf-8; format=fixed
Content-Transfer-Encoding: 8bit
Which is obviously not good enough for some picky part of the SMTP chain.
Show 18 quoted lines
> HOWEVER:
>
> > Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
> > id S1750700AbWJVMCV (ORCPT <rfc822;kha-list-git@hemma.treskal.com>);
> > Sun, 22 Oct 2006 08:02:21 -0400
> > X-Warning: Original message contained 8-bit characters, however during
> > the SMTP transport session the receiving system did not announce
> > capability of receiving 8-bit SMTP (RFC 1651-1653), and as this
> > message does not have MIME headers (RFC 2045-2049) to enable
> > encoding change, we had very little choice.
>
> This does seem to say that somebody didn't even announce 8-bit
> capability in the first place. That's a zmailer error message, and
> it does imply that somebody was running a bad server.
>
> That said, _if_ your message had had the proper mime-type
> specifiers, then zmailer would happily have QP-converted the message
> for you, so everything would have been fine.
E-mail seems to be like driving. You can't just follow the rules, you also have to be careful to make allowances for those who don't. :-(
Well, it added these headers:
MIME-Version: 1.0
Content-Transfer-Encoding: QUOTED-PRINTABLE
Content-Type: TEXT/PLAIN; charset=ISO-8859-1
Maybe MIME-Version was the only thing missing? I'll have to try.
Show 5 quoted lines
> > The mail server (vger talking to itself, if the Received: headers
> > were added in order) complained that there were no MIME headers,
> > so it had to guess the charset.
>
> vger itself? Strange.
It looks that way, but I don't know enough about mail servers to be very certain. The complete header of the message (in my git list mailbox) is this:
From git-owner@vger.kernel.org Sun Oct 22 14:02:35 2006
Received: from vger.kernel.org ([209.132.176.167])
by diana.vm.bytemark.co.uk with esmtp (Exim 3.36 #1 (Debian))
id 1Gbc2E-0005lw-00
for <kha-list-git@hemma.treskal.com>; Sun, 22 Oct 2006 13:02:35 +0100
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
id S1750700AbWJVMCV (ORCPT <rfc822;kha-list-git@hemma.treskal.com>);
Sun, 22 Oct 2006 08:02:21 -0400
X-Warning: Original message contained 8-bit characters, however during
the SMTP transport session the receiving system did not announce
capability of receiving 8-bit SMTP (RFC 1651-1653), and as this
message does not have MIME headers (RFC 2045-2049) to enable
encoding change, we had very little choice.
X-Warning: We ASSUME it is less harmful to add the MIME headers, and
convert the text to Quoted-Printable, than not to do so,
and to strip the message to 7-bits.. (RFC 1428 Appendix A)
X-Warning: We don't know what character set the user used, thus we had to
write these MIME-headers with our local system default value.
MIME-Version: 1.0
Content-Transfer-Encoding: QUOTED-PRINTABLE
Content-Type: TEXT/PLAIN; charset=ISO-8859-1
Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751780AbWJVMCV
(ORCPT <rfc822;git-outgoing>); Sun, 22 Oct 2006 08:02:21 -0400
Received: from mxfep01.bredband.com ([195.54.107.70]:50054 "EHLO
mxfep01.bredband.com") by vger.kernel.org with ESMTP
id S1750700AbWJVMCU (ORCPT <rfc822;git@vger.kernel.org>);
Sun, 22 Oct 2006 08:02:20 -0400
Received: from ironport2.bredband.com ([195.54.107.84] [195.54.107.84])
by mxfep01.bredband.com with ESMTP
id <20061022120218.PHVT953.mxfep01.bredband.com@ironport2.bredband.com>
for <git@vger.kernel.org>; Sun, 22 Oct 2006 14:02:18 +0200
Received: from ua-83-227-180-148.cust.bredbandsbolaget.se (HELO yoghurt.hemma.treskal.com) ([83.227.180.148])
by ironport2.bredband.com with ESMTP; 22 Oct 2006 14:02:18 +0200
Received: from [127.0.0.1] (localhost [127.0.0.1])
by yoghurt.hemma.treskal.com (Postfix) with ESMTP id 1DFDF4C010;
Sun, 22 Oct 2006 14:02:18 +0200 (CEST)
From: Karl =?utf-8?q?Hasselstr=C3=B6m?= <kha@treskal.com>
Subject: [PATCH] RFC2047-encode email headers
Date: Sun, 22 Oct 2006 14:02:17 +0200
To: Catalin Marinas <catalin.marinas@gmail.com>
Cc: git@vger.kernel.org
Message-Id: <20061022120217.7650.23715.stgit@localhost>
User-Agent: StGIT/0.11
Sender: git-owner@vger.kernel.org
Precedence: bulk
X-Mailing-List: git@vger.kernel.org
X-Envelope-Username: kha-list-git
X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=0.94.4
X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on
diana.vm.bytemark.co.uk
X-Spam-Level:
X-Spam-Status: No, score=-0.3 required=5.0 tests=AWL,FORGED_RCVD_HELO
autolearn=disabled version=3.0.3
X-Already-Filtered-By: kha@treskal.com, 2006-10-22 13:02:44 +0100
Status: RO
X-Status: A
Content-Length: 4148--
Karl Hasselström, kha@treskal.com