Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7769809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:15:00+00:00 2026-06-01T16:15:00+00:00

I am trying to understand how can I get gmail labels ( x-gm-labels )

  • 0

I am trying to understand how can I get gmail labels (x-gm-labels) for an email in C.
I checked, that builds of libetpan support x-gm-labels extension.

Any idea how to write a sample code to put it all together?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T16:15:02+00:00Added an answer on June 1, 2026 at 4:15 pm

    Got it. From tracing this check-in from the original author, I discovered the code welded into the default handling behavior of libetpan‘s IMAP support.

    Well, it turns out the author provides an example of how to set up an IMAP connection successfully. Instead of spooling out all of the code, here’s the bit you should be concerned with:

    static char * get_msg_att_msg_content(struct mailimap_msg_att * msg_att,
      size_t * p_msg_size)
    {
        clistiter * cur;
    
        /* iterate on each result of one given message */
        for(cur = clist_begin(msg_att->att_list) ; cur != NULL ;
          cur = clist_next(cur)) {
            struct mailimap_msg_att_item * item;
    
            item = clist_content(cur);
            if (item->att_type != MAILIMAP_MSG_ATT_ITEM_STATIC) {
                continue;
            }
    
        ...
    

    According to my backtrace of the code, your ticket is struct mailimap_msg_att_item. The att_type you’re looking for here is MAILIMAP_MSG_ATT_ITEM_EXTENSION, and from there, you should walk the data structures until you find MAILIMAP_EXTENSION_XGMLABELS.

    Something like this should isolate them:

    if (item->att_type == MAILIMAP_MSG_ATT_ITEM_EXTENSION) {
        if (item->att_data.att_extension_data->ext_type == 
          MAILIMAP_EXTENSION_XGMLABELS) {
            // ... do something ...
        }
    }
    

    (Warning: untested code.)

    From here, you can perform more deeply interrogative inspection of the structs being used. The salient files are all contained in src/low-level/imap, except for the test file. Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand what is WCF, but can't get a visual understanding
I am trying to understand why any import can be referenced using the importing
I'm trying to understand code that I bought so I can modify it. In
I have been trying to understand function pointers in C++ so that I can
I'm trying to understand how i can get localized profile from linkedIn. i get
My question is more of trying to understand what and how I can get
I'm trying to understand how can I do to let my site be reachable
I'm trying to understand when I can put certain objects into a users session
I'm new to git and I'm trying to understand if it can solve my
I'm trying to understand if a DHT can be used to solve a problem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.