[gmime-devel] Access to RAW mime-content?




  I'm parsing MIME messages in a basic fashion, like this:

   /*
    * Populate `mem` with the data.
    */
   GMimeMessage *msg = g_mime_message_part_get_message(GMIME_MESSAGE_PART(part));
   g_mime_object_write_to_stream(GMIME_OBJECT(msg), mem);


    /*
     * NOTE: by setting the owner to FALSE, it means unreffing the
     * memory stream won't free the GByteArray data.
     */
    g_mime_stream_mem_set_owner(GMIME_STREAM_MEM(mem), FALSE);


    /*
     * Now we have `res` which is a byte-array of the part's content.
     *
     * We also have the content-type.
     */
    GByteArray *res = g_mime_stream_mem_get_byte_array(GMIME_STREAM_MEM(mem));

    /*
     * The actual data from the array, and the size of that data.
     */
    char *adata = (char *) res->data;
    size_t len = (res->len);


  (Further work with the "adata" of size "len" bytes.)

  However one problem I'm having is GPG-validation, which seems to require
 that I have the raw/literal MIME content and not the decoded content.
 
  Looking over the API I cannot see how to do that, so I wondered if I'm
 missing something?

Steve
-- 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]