Re: Bug with long header lines

Heinrich Müller <heinrich.mueller82-gM/[email protected]> Fri, 28 Dec 2012 11:52:52 +0100
Newsgroups gmane.comp.gnome.apps.pan.devel
Message-ID <[email protected]>
Am 27.12.2012 17:16, schrieb Sabljic, Miroslav AVL/HR:
>
> ------------------------------------------------------------------------
> *From:* pan-devel-bounces+miroslav.sabljic=avl.com-qX2TKyscuCcdnm+yROfE0A@public.gmane.org 
> [pan-devel-bounces+miroslav.sabljic=avl.com-qX2TKyscuCcdnm+yROfE0A@public.gmane.org] on behalf of 
> Sabljic, Miroslav AVL/HR [[email protected]]
> *Sent:* Sunday, December 23, 2012 10:05 PM
> *To:* [email protected]
> *Subject:* [Pan-devel] Bug with long header lines
>
> Hello!
>
> > [...]
> > X-Foo:
> > 
> BaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaR
>
> Further debugging revealed that news server is replaying with 
> following error message when article is rejected.
>
> nnrpd[3612]: XXX.XXX.XXX.XXX post failed 437 No colon-space in 
> "X-Face:" header
>
> Apparently server expects header in format "X-Foo: Bar" which is OK 
> but when Pan wraps article then the format is "X-Foo:\n<tab>Bar".
> i.e.
> X-Foo:
>     Baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar
>
> There should be one empty space after colon sign and then newline, tab 
> and the rest of header value, so format should be "X-Foo: \n<tab>Bar".
>
> I've tested this with following change of simply adding one space in 
> x-face header before setting it and it works properly. This is from 
> post-ui.cc (1545) file.
>
>   // headers from posting profile(via prefs): X-Face
>   std::string f;
>   if (!profile.xface.empty())
>     f += " " + profile.xface;
>     g_mime_object_set_header ((GMimeObject *) msg, "X-Face", f.c_str());
>
> This is just my fast workaround because I couldn't find the part in 
> the source where x-face header is trimmed.
>
>
afaik, xface isn't trimmed anywhere, so perhaps i'll add this simple fix

cheers.