After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 393589 - X-Face not shown properly
X-Face not shown properly
Status: RESOLVED FIXED
Product: Pan
Classification: Other
Component: general
pre-1.0 betas
Other All
: Normal minor
: 1.0
Assigned To: Charles Kerr
Pan QA Team
: 427489 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-01-06 17:04 UTC by Ivan Rajkovic
Modified: 2007-04-10 11:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
sample posting that displays the behavior (2.12 KB, text/plain)
2007-01-24 03:26 UTC, Charles Kerr
Details

Description Ivan Rajkovic 2007-01-06 17:04:55 UTC
Please describe the problem:
If the X-Face header has an empty line between lines, it's not shown properly. I tested the same message with sylpheed-claws, and it's showing it normaly.

Steps to reproduce:
1. go to hr.comp.os.linux
2. search for author 'Aleksandar Ivanisevic'


Actual results:
The X-Face is nor shown corectly, only first line is treated as header, all other lines of X-Face header are shown as message, together with all the headers after the X-Face header

Expected results:


Does this happen every time?
yes

Other information:
I noticed this with the Pan 0.14.x and new 0.9x and 0.1xx versions
Comment 1 Ivan Rajkovic 2007-01-06 17:27:54 UTC
It looks like it's enough to have SPACE somewhere in X-Face header after 80. character, Pan does a word-wrap and sees only the first line as a header.
check also this group:
yu.test
and look at the messages by 'Ivan Rajkovic' from 01. Jan 07.
Pan shows only one of them corectly, sylpheed-claws 3 out of 4.
Comment 2 Ivan Rajkovic 2007-01-06 17:28:45 UTC
(In reply to comment #1)
> It looks like it's enough to have SPACE somewhere in X-Face header after 80.
> character, Pan does a word-wrap and sees only the first line as a header.
> check also this group:
> yu.test
> and look at the messages by 'Ivan Rajkovic' from ***01. Jan 07.***
> Pan shows only one of them corectly, sylpheed-claws 3 out of 4.
> 

that was 06. Jan, not 01. Jan
Comment 3 Charles Kerr 2007-01-21 23:03:45 UTC
I'm wondering if this is a GMime bug, of it it's even a bug at all.
Pan's getting this header from g_mime_message_get_header (msg, "X-Face");
and I'm cc'ing fejj to this to defer to his encyclopediac knowledge of
header ettiquite
Comment 4 Ivan Rajkovic 2007-01-21 23:21:52 UTC
it might be. quick search through claws-mail source showed me that they are not using GMime but procheader.h (their own header file) to read message headers.
Comment 5 Charles Kerr 2007-01-24 03:26:14 UTC
Created attachment 81037 [details]
sample posting that displays the behavior
Comment 6 Charles Kerr 2007-01-24 03:31:53 UTC
fejj: could you weigh in on this?  Boiled down, the question is this:
is the X-Face: header in Comment #5's attachment standards compliant,
and should a call to g_mime_message_get_header() return it as an
unbroken string with no spaces?
Comment 7 Charles Kerr 2007-02-01 17:39:07 UTC
fejj: ping
Comment 8 Jeffrey Stedfast 2007-03-26 21:02:12 UTC
Sorry, someone just poked me on this... my fejj@novell.com address didn't work back when this got Cc'd to me because I had been laid-off by Novell (the good news os I just recently got hired by Miguel to hack on MonoDevelop, so yay!)

Anyways...

looking at the sample text message, a block of headers ends at \n\n... so it would appear that that message's X-Face header is improperly folded.

If I remove the blank lines, GMime is able to parse it properly:

"4JwcMHVV7.+Q"O&7#~e!/D3&-We*\6>YCmt~!;eHB\Qc$GGC}v}V[BFN]+pX;wqky_vXgj Ag!*"Am:~ffPJV&#cV*0"NeN9I]gaK$eDg`>`!5Ep&J_:/#KPnG3g.u|DV]i7P@l#46^UkNF\#"N%Q s9VP9Clc>qmNO$c(.^"2~nkJ.0LC+F{"sZI@+Ut

(that's going to line-wrap, but basically GMime returns the unfolded header string w/ 3 encoded chunks separated by a single space - as it should)

I don't think there is a way to unfold a header like that and not get the lwsp char used to "indent" the subsequent lines... but I'd have to reread that part of the spec to be sure.

e.g., I *think* that given the following folded ehader string:

"X-Face: lalala\n lalala"

the unfolded header would have to be:

"X-Face: lalala lalala"


Again, I'd have to double-check though... it would probably be specified in rfc822 (rfc2822 should also be checked in the case they might be more clear on this issue)
Comment 9 Jeffrey Stedfast 2007-03-26 21:03:34 UTC
oh yea, the other good news is I saved a lot on my car insurance!
Comment 10 Jeffrey Stedfast 2007-03-27 01:11:15 UTC
I just read through the appropriate sections on Long Header Fields in both rfc822 and rfc2822 and I was correct about the unfolding process not removing the LWSP after the CRLF.

Anyways... if Pan's X-Face decoder needs the value to be devoid of LWSP, that should be a simple enough procedure to hack up a fix for inside Pan itself (e.g. you could either strip LWSP after getting the value from the constructed GMimeMessage object or you could be a cheeky bastard and hook up the header regex callback in the GMimeParser and with a little casting action, do it there).
Comment 11 Charles Kerr 2007-04-10 05:02:03 UTC
This seems to be working now in svn revision 224.  Ivan's test case in comment 1 works right.

Pan now strips out extra trailing linefeeds when fetching headers
from the nntp server.
Comment 12 Charles Kerr 2007-04-10 05:03:04 UTC
*** Bug 427489 has been marked as a duplicate of this bug. ***
Comment 13 Ivan Rajkovic 2007-04-10 11:02:44 UTC
I've just tried it, and it works great.
Thanks a lot.