[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kmail-devel
Subject:    Bug#27699: marked as done (reply-to-all not correct (only to sender and cc list), but NOT in every c
From:       owner () bugs ! kde ! org (Stephan Kulow)
Date:       2001-06-30 14:18:03
[Download RAW message or body]

Your message with subj: [PATCH] Fix for the reply-to-all bug.


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi!

I finally tracked down this bug. After I was able to reproduce it, it 
was quite easy. For those of interested:

The bug was that the whole To: header was omitted when two conditions 
were met by the replied-to message' To: header:

1. It was folded after each address-delimiting ","
2. It contained the default identity of the user (Marc@Mutz.com in my 
case).

The first condition let decodeRFC204String() to delete separating 
whitespace (in violation to RFC822, BTW, since "CRLF LWSP-char" must be 
considered equivalent to LWSP-char), leaving only the separating ",".

This part of the bug is fixed by the first and only hunk for 
kmmsgbase.cpp.

The second condition made KMMessage::createReply()
(via toStr.find(<...>-Part of newmsg->from()) )
run back the length of the toStr in search for ", " (note the space, 
which is BTW also in violation of RFC822, which states that m#n abc is 
equivalent to abc m-1*n-1("," abc)), which it didn't find, leading to 
the interpretation of the whole to() string as a single address...

All in all the createReply() function is still very buggy, since it 
doesn't cope with (valid!) embedded (escaped) DQUOTE's in 
quoted-string's, nor does it seem to handle ',''s in quoted-string's. 
But fixing this would require a real parser, which I'm not going to 
write for _this_ code (doesn't mimelib provide an address-list 
parser?). I have to write one for the new mimelib-replacement, though.
Also, it always assumes the default identity for it's "strip my own 
mail address" functionality.

So the attached patch only replaces the search strings ", " with ','.

Marc

- -- 
Marc Mutz <Marc@Mutz.com>
http://marc.mutz.com/
http://www.mathematik.uni-bielefeld.de/~mmutz/
http://EncryptionHOWTO.sourceforge.net/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7PfnO3oWD+L2/6DgRAgfzAJ467Z1+O1rkmpdBcqeQHlqjzwa8MgCbBOqL
lOJ5B4OBUX8WRAvmAvdDxJA=
=yL5J
-----END PGP SIGNATURE-----

["kmail-fix-reply-to-all.diff;" (text/x-diff)]

Index: kmmsgbase.cpp
===================================================================
RCS file: /home/kde/kdenetwork/kmail/kmmsgbase.cpp,v
retrieving revision 1.79
diff -u -3 -p -r1.79 kmmsgbase.cpp
--- kmmsgbase.cpp	2001/06/21 15:34:52	1.79
+++ kmmsgbase.cpp	2001/06/30 14:08:03
@@ -287,7 +287,7 @@ QString KMMsgBase::decodeRFC2047String(c
       result += *pos;
     }
   }
-  return result.replace(QRegExp("\n[ \t]"),"");
+  return result.replace(QRegExp("\n[ \t]")," ");
 }
 
 
Index: kmmessage.cpp
===================================================================
RCS file: /home/kde/kdenetwork/kmail/kmmessage.cpp,v
retrieving revision 1.210
diff -u -3 -p -r1.210 kmmessage.cpp
--- kmmessage.cpp	2001/06/27 09:46:27	1.210
+++ kmmessage.cpp	2001/06/30 14:08:05
@@ -706,14 +706,14 @@ KMMessage* KMMessage::createReply(bool r
     {
       int pos1, pos2, quot;
       quot = toStr.findRev("\"", i);
-      pos1 = toStr.findRev(", ", i);
+      pos1 = toStr.findRev(',', i);
       if (pos1 < quot)
       {
         quot = toStr.findRev("\"", quot - 1);
-        pos1 = toStr.findRev(", ", quot);
+        pos1 = toStr.findRev(',', quot);
       }
       if( pos1 == -1 ) pos1 = 0;
-      pos2 = toStr.find(", ", i);
+      pos2 = toStr.find(',', i);
       toStr = toStr.left(pos1) + toStr.right(toStr.length() - pos2);
     }
     else
@@ -724,14 +724,14 @@ KMMessage* KMMessage::createReply(bool r
     {
       int pos1, pos2, quot;
       quot = ccStr.findRev("\"", i);
-      pos1 = ccStr.findRev(", ", i);
+      pos1 = ccStr.findRev(',', i);
       if (pos1 < quot)
       {
         quot = ccStr.findRev("\"", quot - 1);
-        pos1 = ccStr.findRev(", ", quot);
+        pos1 = ccStr.findRev(',', quot);
       }
       if( pos1 == -1 ) pos1 = 0;
-      pos2 = ccStr.find(", ", i);
+      pos2 = ccStr.find(',', i);
       ccStr = ccStr.left(pos1) + ccStr.right(ccStr.length() - pos2 - 1); //Daniel
     }
     else

has caused the attached bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I'm
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Stephan Kulow
(administrator, KDE bugs database)

Received: (at submit) by bugs.kde.org; 25 Jun 2001 18:13:31 +0000
Received: (qmail 20996 invoked by uid 33); 25 Jun 2001 18:13:31 -0000
Date: 25 Jun 2001 18:13:31 -0000
Message-ID: <20010625181331.20995.qmail@master.kde.org>
To: submit@bugs.kde.org
Subject: reply-to-all not correct (only to sender and cc list), but NOT in every case
From: bruno@ideca.be

Package:           kmail
Version:           KDE 2.1.1 
Severity:          normal
Installed from:    SuSE RPMs
Compiler:          Not Specified
OS:                Linux
OS/Compiler notes: Not Specified

I have received a mail with the header:

From: X <x@fly.be>
To: J <j@university.be>,F <f@university.be>, Bruno <bruno@ideca.be>
Cc: H <h.s@simplenet.be>

A reply-to-all gives:

To: X <x@fly.be>
Cc: H <h.s@simplenet.be>

The bug is repeatable. Does not occur with every mail.


(Submitted via bugs.kde.org)

_______________________________________________
Kmail Developers mailing list
Kmail@master.kde.org
http://master.kde.org/mailman/listinfo/kmail


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic