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 372616 - Cancel / Supercedes is unable to recognize my articles
Cancel / Supercedes is unable to recognize my articles
Status: RESOLVED FIXED
Product: Pan
Classification: Other
Component: general
pre-1.0 betas
Other Linux
: Normal normal
: 1.0
Assigned To: Charles Kerr
Pan QA Team
Depends on:
Blocks:
 
 
Reported: 2006-11-08 19:41 UTC by Frederic Crozat
Modified: 2006-11-10 16:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
allow cancel/supercede based on matching address, not total `from' header (686 bytes, patch)
2006-11-10 16:01 UTC, Charles Kerr
none Details | Review

Description Frederic Crozat 2006-11-08 19:41:07 UTC
I've just tried to supercedes (and after that to cancel) an article I just posted 
on an internal newsgroup and Pan doesn't recognize the article as sent by me.

version tested : 0.118

I have two sender profiles, the one being used is 
Frederic Crozat <usenet@crozat.net.invalid>

and in message, header is :
From: Frederic Crozat <usenet@crozat.net.invalid>
Comment 1 Christophe Lambin 2006-11-08 20:58:10 UTC
Confirmed.

The reason is that Pan's profile code is using the format
    "short name" <address>

However, what we're actually posting is as follows:
    short name <address>
(i.e. no quotes)

So, when we're checking profiles, the strings don't match and no profile is found.

Note that we ARE passing the quoted version to g_mime_message_set_sender(). It seems g_mime_object_to_string() (called in TaskPost) is dropping the quotes.
Comment 2 Charles Kerr 2006-11-09 02:10:15 UTC
the GMimeMessage::from field is already missing the quotes before we call g_mime_object_to_string() in TaskPost ... it must have been stripped out before that point.
Comment 3 Charles Kerr 2006-11-09 02:27:51 UTC
g_mime_message_set_sender() is stripping out the quotes:

  std::cerr << LINE_ID << " setting sender [" << s << ']' << std::endl;
  g_mime_message_set_sender (msg, s.c_str());
  std::cerr << LINE_ID << " got sender [" << msg->from << ']' << std::endl;

yields:

  post-ui.cc:1206:new_message_from_ui) setting sender
  ["Charles Kerr" <charles@rebelbase.com>]
  (post-ui.cc:1208:new_message_from_ui) got sender
  [Charles Kerr <charles@rebelbase.com>]

fejj, I'm cc'ing you on this since you probably have the relevant RFCs
memorized backwards and forwards and can tell me whether this is a Pan
bug or a GMime one.
Comment 4 Jeffrey Stedfast 2006-11-09 03:59:37 UTC
as Charles points out, set_sender() parses the address string into an InternetAddressList struct and then reformats it back out.

I think this is there to make sure the string is legally formatted (and encoded, since the string passed in might not be).

I think the easiest (best?) solution to this might be the parse both strings to do the comparison, and probably just compare the addr-spec component rather than also the name?

I'm not sure about news, so I could be wrong :)
Comment 5 Charles Kerr 2006-11-09 23:39:48 UTC
fejj: sounds about right.  thanks for the suggestion.
Comment 6 Charles Kerr 2006-11-10 16:01:52 UTC
Created attachment 76332 [details] [review]
allow cancel/supercede based on matching address, not total `from' header