On Sun, Jan 29, 2012 at 08:29:12PM +0900, Tamo wrote: > Hi, > > On Sun, Jan 29, 2012 at 5:28 PM, Todd Hoffmann <ddf...@gmail.com> wrote: > > I'm trying to patch mutt so that I can see each message's labels. The > > gmail imap extension I want to use is described here: > > > > http://code.google.com/apis/gmail/imap/#x-gm-labels > > Maybe you can use "spam", "$spam_separator" and "$imap_headers". > > set imap_headers="X-GM-LABELS" > spam "X-GM-LABELS:? \((.*)\)" "%1" > set spam_separator=" " > set index_format="%4C %Z %?H?[%H] ?%s" > > (I haven't tested it yet)
The extension provides another attribute for the fetch command. The X-GM-LABELS is not a header, so it can't be treated as such. > > > > > It seems like it would be easiest to just put the labels in the x-label > > field. I started digging into the mutt code to implement this and > > encountered some issues. The patch I've included does make the labels > > appear in the message index if I include %y in the index_format setting, > > but some seem to be encoded. I tried to figure out if I need to use > > rfc2047_decode or something, but I haven't gotten anything to work so > > far. Worse still, it segfaults when changing from the inbox to some (not > > all) other imap folders. > > > > Can anyone give me some suggestions? Am I going about this the > > completely wrong way? > > Hmm, > h->data->labels = strdup(buffer); > and free it later? > > Also, you should make sure ptmp won't overrun sizeof(buffer). Yeah, that's a good point. I just made buffer really big and crossed my fingers. > > HTH It did, thanks! -Todd > -- > tamo