[Reportbug-maint] Bug#539157: direct SMTP send violates RFC1652 and sends unencoded 8-bit data

Thorsten Glaser tg at mirbsd.de
Wed Jul 29 14:38:40 UTC 2009


Sandro Tosi dixit:

>Hi Thorsten,
>thanks for the report.

Thanks for the quick response ☺

>- should we encode using quoted-printable or base64?

Depends. ASCII is usually better preserved using QP, Japanese (for
example) with base64. As Debian bug reports tend to be (mostly) in
English, I’d suggest QP.

Note that, for QP, you encode every octet of a multibyte sequence
(such as a UTF-8 encoded Unicode character) separately and still have
quite restrictive limits on line lengths – but I’m sure there are
readily available means for encoding usable from reportbug.

Inline PGP signatures will not be affected because they are handled
after the MUA decodes them.

>- should we encode only when sending to reportbug.d.o (the default
>smtp host) or to any other smtp?

To every SMTP server which does not advertise 8BITMIME support.

>- what if an encoded message is sent to an 8bit (we're in 2009 and
>we're still talking about 8/7 bit stuff...) capable smtp host?

Most of them convert things back to 8bit locally; some of them keep
the original encoding. It doesn’t really matter (except the increase
in bandwidth usage), as the MUA will handle either.

>- is there a way to programmatically identify 8bit capable smtp host
>from ehlo message?

Yes.

These aren’t:

tg at eurynome:~ $ nc rietz.debian.org 25
220 rietz.debian.org ESMTP Exim 4.63 Wed, 29 Jul 2009 14:35:42 +0000
EHLO eurynome.mirbsd.org
250-rietz.debian.org Hello tg at eurynome.mirbsd.org [81.169.181.30]
250-SIZE 62914560
250 HELP
QUIT
221 rietz.debian.org closing connection

tg at eurynome:~ $ nc ::1 25
220-eurynome.mirbsd.org ESMTP ready at Wed, 29 Jul 2009 14:35:51 GMT
220->> Bitte keine Werbung einwerfen! <<
220 Who do you wanna pretend to be today?
EHLO eurynome.mirbsd.org
250-eurynome.mirbsd.org Hello tg at localhost [IPv6:::1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-SIZE
250-DSN
250-ETRN
250-STARTTLS
250-DELIVERBY
250 HELP
QUIT
221 2.0.0 eurynome.mirbsd.org closing connection

This one is:

tg at eurynome:~ $ nc thetis.ig42.org 25
220 thetis.ig42.org ESMTP ready // !! Keine Werbung/No spam !!
EHLO eurynome.mirbsd.org
250-thetis.ig42.org
250-PIPELINING
250-SIZE 20480000
250-STARTTLS
250-AUTH PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
QUIT
221 2.0.0 Bye


The difference is that the 250 response code (the - indicates a
continuation line, the space that it’s the last line) contains
a line which says 8BITMIME. Reading RFC1652 may also be helpful.

If you cannot defer encoding until the ESMTP dialogue (note that
EHLO is ESMTP and 8BITMIME is not available if HELO is used), I’d
suggest to just always encode using Quoted-Printable (and indicate
that in the MIME headers in the message itself, too!).

bye,
//mirabilos
-- 
[00:02] <Vutral> gecko: benutzt du emacs ?
[00:03] <gecko> nö          [00:03] <gecko> nur n normalen mac
[00:04] <Vutral> argl       [00:04] <Vutral> ne den editor
	-- Vutral und gecko2 in #deutsch (NB: Editor? Betriebssystem.)





More information about the Reportbug-maint mailing list