#341952 ssmtp: should specify character-set in outgoing messages

Package:
ssmtp
Source:
ssmtp
Description:
extremely simple MTA to get mail off the system to a mail hub
Submitter:
Martin-Éric Racine
Date:
2010-12-28 17:45:03 UTC
Severity:
normal
#341952#5
Date:
2005-12-04 12:27:00 UTC
From:
To:
sSMTP does not specify the character-set in outgoing messages, which makes some mail relays reject the messages sent
by sSMTP. For example, the Debian BTS' control interface gives me:

8X-----
 - These recipients of your message have been processed by the mail server:
control@bugs.debian.org; Failed; 5.3.0 (other or undefined mail system status)

    Remote MTA bugs.debian.org: network error

 - SMTP protocol diagnostic: 550 improper use of 8-bit data in message header
8X-----

The raw message content that triggered this is:

8X-----
Return-Path: <q-funk@iki.fi>
Received: from route.intranet (84.249.18.46) by pne-smtpout2-sn1.fre.skanova.net (7.2.069.1)
        id 43903C2400065782 for control@bugs.debian.org; Sun, 4 Dec 2005 13:03:35 +0100
Received: from omena.intranet ([172.16.1.14] ident=q-funk)
        by route.intranet with smtp (Exim 4.50)
        id 1Eisab-00079P-5v
        for control@bugs.debian.org; Sun, 04 Dec 2005 14:03:34 +0200
Received: by omena.intranet (sSMTP sendmail emulation); Sun,  4 Dec 2005 14:03:32 +0200
From: Martin-Éric Racine <q-funk@iki.fi>
To: control@bugs.debian.org
Subject: bug 262075 is forwarded to http://bugzilla.gnome.org/show_bug.cgi?id=318473
Date: Sun,  4 Dec 2005 14:03:32 +0200
X-BTS-Version: 2.9.9
Message-Id: <E1Eisab-00079P-5v@route.intranet>
8X-----

- -- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (990, 'testing'), (990, 'stable'), (99, 'unstable')
Architecture: powerpc (ppc)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.14-imac
Locale: LANG=fi_FI.UTF-8, LC_CTYPE=fi_FI.UTF-8 (charmap=UTF-8)

Versions of packages ssmtp depends on:
ii  debconf                       1.4.59     Debian configuration management sy
ii  libc6                         2.3.5-8    GNU C Library: Shared libraries an
ii  libssl0.9.8                   0.9.8a-4   SSL shared libraries

ssmtp recommends no packages.

- -- debconf information:
* ssmtp/overwriteconfig: true
  ssmtp/mailname:
* ssmtp/mailhub: posti.intranet
* ssmtp/fromoverride: true
* ssmtp/hostname: omena.intranet
* ssmtp/root: root@posti.intranet
* ssmtp/rewritedomain:
* ssmtp/port: 25
iD8DBQFDkuCUeXr56x4Muc0RAr6VAJwKp1FPq07/HvusNBmyWpwJY3CXewCfflnj
7vOjiv1v1VOdACFizB9nHfQ=
=q8iN
-----END PGP SIGNATURE-----

#341952#10
Date:
2006-05-30 16:43:16 UTC
From:
To:
2047, which means encoding the above as

From: =?ISO8859-1?Q?Martin-=C9ric?= Racine <q-funk@iki.fi>

This is not trivial; fortunately there is code out there which can be reused.
For example, see parse_quote_2047() in Exim4's parse.c. You also need to find
out which charset is used.

Additionally, sSMTP should perhaps implement parse_fix_phrase() from the same
source, to handle any unbalanced parentheses, quotes, backslashes and other
oddities that might possibly be found in /etc/passwd or after -F on the
command line.

#341952#15
Date:
2006-05-31 00:40:18 UTC
From:
To:
Am 2006-05-30 18:43:16, schrieb Magnus Holmgren:

Are you sure?
Such things are the job of a MUA not from a MTA.

If I have such case, I use "base64-encode" from the
"mime-codecs" package ALL MUA's are converting,
which mean, sSMTP should not be stressed with this...

Greetings
    Michelle Konzack

#341952#20
Date:
2006-06-08 16:11:54 UTC
From:
To:
On Wednesday 31 May 2006 02:40, Michelle Konzack took the opportunity to
write:

Yes, when sSMTP pulls the name from /etc/passwd there's noone else to do it.

#341952#25
Date:
2006-12-30 18:13:32 UTC
From:
To:
Encoding of 8Bit header is the job of
a Mailclient/MUA or whatever you use.

Thanks, Greetings and nice Day
    Michelle Konzack
    Systemadministrator
    Tamay Dogan Network
    Debian GNU/Linux Consultant

#341952#30
Date:
2006-12-30 18:34:37 UTC
From:
To:
la, 2006-12-30 kello 19:13 +0100, Michelle Konzack kirjoitti:

That logic is flawed, given how cron and several other system tools
directly cat their output to sendmail.  That might have worked fine
previously, back when ASCII was the presumed character-set, but this
fails miserably nowadays, in a Unicode-enabled universe. RFC 822 must
upgrade to presume UTF-8 instead and all MTA be upgraded to match.

#341952#35
Date:
2008-06-23 12:34:52 UTC
From:
To:
Anibal, has any progress been made on this bug?
#341952#42
Date:
2010-12-28 17:19:59 UTC
From:
To:

#341952#47
Date:
2010-12-28 17:29:23 UTC
From:
To:
This is a MIME encoded message.  Decode it with "munpack"
or any other MIME reading software.  Mpack/munpack is available
via anonymous FTP in ftp.andrew.cmu.edu:pub/mpack/
---

The attachment contains a proposed fix (alpha status)
The fix has the location of the ssmtp-binary hard-coded
It is a wrapper script written in perl,
so it relies on a working perl installation including the package libmime-tools-perl >= 5.427-2

Have fun\!
N.B.: this mail has been written using this fix and mpack/ssmtp
P.S.: sorry for the earlier mail without description

IyEvdXNyL2Jpbi9wZXJsCnVzZSB3YXJuaW5nczsKdXNlIHN0cmljdDsKdXNlIE1JTUU6Oldv
cmRzOwoKIyBhIHNpbXBsZSB3b3JrYXJvdW5kIHRvIGFkZCBzb21lIE1JTUUgKFJGQyAyMDQ3
KSBjb21wYXRpYmlsaXR5IHRvIHNzbXRwCiMgY2FuIGJlIHVzZWQgYXMgYSBkcm9wLWluIHJl
cGxhY2VtZW50IGZvciB0aGUgc3ltbGluayBwb2ludGluZyB0byAiL3Vzci9zYmluL3NzbXRw
IgojWFhYOiByZWxpZXMgb24gdGhlIGZhY3QgdGhhdCBzc210cCBpcyBhY3R1YWxseSBpbnN0
YWxsZWQgaW4gZXhhY3RseSB0aGF0IHBsYWNlIQokQVJHVlswXT0iL3Vzci9zYmluL3NzbXRw
IjsKb3BlbiBteSAkc2VuZG1haWwsICJ8LSIsIEBBUkdWOwpteSAkaGVhZGVyX3NlZW49MDsK
d2hpbGUgKG15ICRsaW5lID0gPFNURElOPikgewogICAgaWYgKCRoZWFkZXJfc2VlbiB8fD0g
KCRsaW5lID1+IG17XiR9KSkgewogICAgICAgIHByaW50ICRzZW5kbWFpbCAkbGluZTsKICAg
IH0gZWxzZSB7CiAgICAgICAgaWYgKCRsaW5lID1+IG17W1x4ODAtXHhGRl19KSB7CiAgICAg
ICAgICAgIG15ICgkaGVhZGVyLCAkdmFsdWUpID0gc3BsaXQgLzpccysvLCAkbGluZSwgMjsK
ICAgICAgICAgICAgcHJpbnRmICRzZW5kbWFpbCAiJXM6ICVzIiwgJGhlYWRlciwgTUlNRTo6
V29yZHM6OmVuY29kZV9taW1ld29yZCgkdmFsdWUpCiAgICAgICAgfSBlbHNlIHsKICAgICAg
ICAgICAgcHJpbnQgJHNlbmRtYWlsICRsaW5lOwogICAgICAgIH0KCiAgICB9Cn0K
-----

#341952#52
Date:
2010-12-28 17:40:59 UTC
From:
To:
The attachment contains a proposed fix (alpha status)
Yeah, obviously it was alpha -- a misconfigured format-string
led to mangled Header-lines (missing newline)
Sorry for all the trouble