Bug 77058

Summary: Cannot send from kmail with "allow 8-bit" setting
Product: [Unmaintained] kmail Reporter: Niels Elgaard Larsen <elgaard>
Component: sendingAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: giovanni, jlp, mss, syam, w-e-f-bauer
Priority: NOR Keywords: triaged
Version: 1.6.1   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: A hack to fix checking of 8BITMIME

Description Niels Elgaard Larsen 2004-03-09 02:46:41 UTC
Version:            (using KDE KDE 3.2.1)
Installed from:    Debian testing/unstable Packages
OS:          Linux

If I set "Allow 8-bit" Kmail cannot send to my exim4 server.

Sending failed:
Unknown error code 50
Your server does not support sending of 8-bit messages.
Please use base64 or quoted-printable encoding.
Please send a full bug report at http://bugs.kde.org.
The message will stay in the 'outbox' folder until you either fix the problem (e.g. a broken address) or remove the message from the 'outbox' folder.
The following transport protocol was used:
gombert

Note:
gombert is the name of the mailserver, not a protocol.
The mail i sent had subject="foo", body="bar". It only 7-bit ascii
mozilla-thunderbird worked even with 8-bit characters (body="æøåÆØÅ").
Setting kmail to quoted-printable works.
Comment 1 Ingo Klöcker 2004-03-09 11:28:34 UTC
The "allow 8-bit" setting has to go. KMail or more precisely the SMTP kioslave have to decide automatically whether 8-bit is possible or not.

Anyway, the obvious solution is not to use "allow 8-bit" if KMail tells you that the server doesn't support it.
Comment 2 Volker Steinlein 2004-03-25 22:33:26 UTC
I had exactly the same error using KDE 3.2.1 on SUSE 8.2. since I upgraded from version KDE 3.2.0 to KDE 3.2.1 
This error happens always when I try to send mails in 8-bit mode. 
Changes of the charset type (us-ascii, utf-8, ...) doesn't show any effect.
Comment 3 Konstantinos Georgokitsos 2004-03-30 06:53:13 UTC
I have the same problem after upgrading on a SuSE 8.1 to 3.2.1 from 3.1.3. Additioanally - and it drives me crazy - I cannot find the "allow 8-bit" switch in the settings (although I use the Greek translation). 
Comment 4 Wolf-Ruediger Juergens 2004-04-13 15:58:30 UTC
Same problem here, but only with the mailserver from 1und1, t-online is working fine
Comment 5 John Zaitseff 2004-04-16 12:25:53 UTC
I have spent a some time debugging the problem mentioned in bug 240256 on Debian and bug 77058 on KDE.  In fact, I have looked through the kmail (kdepim) and kio_smtp (kdebase) source code.  Perhaps I did not need to do so, but it was a real problem for me and the explanations given were not obvious.

The problem is not with KMail.  It is not technically even with kio_slave.  The real problem lies somewhere between the server and kio_slave.  Allow me to explain.

Version 3.2.1 of kio_smtp now checks the EHLO capabilities of the SMTP server.  If you "telnet your-smtp-server smtp" and type in something like "EHLO your-machine-name", you should get a whole list of capabilities back, each starting with the string "250".

The problem is that kio_smtp now checks for the capability "8BITMIME" to determine whether the server supports this facility or not.  The real problem is that many servers DO sort-of support this facility, but do not advertise it.  Hence, kio_smtp does not see "8BITMIME" and thinks that the e-mail server cannot handle it.

The solution is to either:

1. Hack kio_smtp to send 8-bit e-mails, whether or not the server advertises this clause, or

2. Change your e-mail server.

Point 1 is not really a viable option.  Point 2 is not much easier!

I run the Exim server (v3, as it happens, on a Debian stable box).  The appropriate option to modify in /etc/exim/exim.conf is:

    accept_8bitmime = true

Please read the warning associated with this option, right there in the config file.  The Exim 4 documentation states:

    This option causes Exim to send 8BITMIME in its response to an
    SMTP EHLO command, and to accept the BODY= parameter on MAIL
    commands. However, though Exim is 8-bit clean, it is not a
    protocol converter, and it takes no steps to do anything special
    with messages received by this route. Consequently, this option
    is turned off by default.

You have a problem if you (a) don't control the SMTP server and (b) need to send 8-bit non-quoted-printable e-mails.  In that case, you may want to add the following (not recommended!) patch to the file kioslave/smtp/smtp.cc in the kdebase package:

--- smtp.cc.orig	2004-02-08 23:28:03.000000000 +1100
+++ smtp.cc	2004-04-16 20:18:16.000000000 +1000
@@ -230,6 +230,8 @@
     return;
   }
 
+/* Always assume the SMTP server has 8-bit capabilities.  This is a hack!
+
   if ( request.is8BitBody()
        && !haveCapability("8BITMIME") && metaData("8bitmime") != "on" ) {
     error( KIO::ERR_SERVICE_NOT_AVAILABLE,
@@ -237,6 +239,7 @@
 		"Please use base64 or quoted-printable encoding.") );
     return;
   }
+*/
 
   queueCommand( new MailFromCommand( this, request.fromAddress().latin1(),
 				     request.is8BitBody(), request.size() ) );
Comment 6 John Zaitseff 2004-04-16 12:28:36 UTC
Created attachment 5659 [details]
A hack to fix checking of 8BITMIME
Comment 7 Florian Purucker 2006-12-28 18:15:28 UTC
I have the same problem in version 1.9.4. I have already contacted my webhoster which administrates my mail server but they have told me the server would not reject 8 bit encoded messages. So the only problem really seems to be that kmail (or kioslave) does not detect the server capabilities correctly.
Comment 8 Thomas McGuire 2007-02-21 17:10:43 UTC
*** Bug 98069 has been marked as a duplicate of this bug. ***
Comment 9 Thomas McGuire 2007-02-21 17:10:45 UTC
*** Bug 112812 has been marked as a duplicate of this bug. ***
Comment 10 Thomas McGuire 2007-02-21 17:10:51 UTC
*** Bug 122692 has been marked as a duplicate of this bug. ***
Comment 11 Thomas McGuire 2007-02-21 17:11:05 UTC
*** Bug 125228 has been marked as a duplicate of this bug. ***
Comment 12 Malte S. Stretz 2011-05-10 14:08:49 UTC
The option is long gone and I haven't seen any problems with my 8BITMIME MSA for quite some time.