aboutsummaryrefslogtreecommitdiff
path: root/util/gmime-extra.h
AgeCommit message (Collapse)Author
2021-06-26cli/show: produce "email" element in sigstatusDaniel Kahn Gillmor
When the certificate that signs a message is known to be valid, GMime is capable of reporting on the e-mail address embedded in the certificate. We pass this information along to the caller of "notmuch show", as often only the e-mail address of the certificate has actually been checked/verified. Furthermore, signature verification should probably at some point compare the e-mail address of the caller against the sender address of the message itself. Having to parse what gmime thinks is a "userid" to extract an e-mail address seems clunky and unnecessary if gmime already thinks it knows what the e-mail address is. See id:878s41ax6t.fsf@fifthhorseman.net for more motivation and discussion. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-06-14util: run uncrustifyuncrustify
This is the result of running $ uncrustify --replace --config ../devel/uncrustify.cfg *.c *.h in the util directory
2019-05-03util/gmime-extra: add g_mime_stream_gzfile_{new, open}David Bremner
These are usable as standard GMime streams, and transparently decompress gzipped files.
2019-05-03gmime-cleanup: pass NULL as default GMimeParserOptionsDaniel Kahn Gillmor
This is a functional change, not a straight translation, because we are no longer directly invoking g_mime_parser_options_get_default(), but the GMime source has indicated that the options parameter for g_mime_parser_construct_message() is "nullable" since upstream commit d0ebdd2ea3e6fa635a2a551c846e9bc8b6040353 (which itself precedes GMime 3.0). Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-05-03gmime-cleanup: pass NULL arguments explicitly where GMime 3.0 expects itDaniel Kahn Gillmor
Several GMime 2.6 functions sprouted a change in the argument order in GMime 3.0. We had a compatibility layer here to be able to handle compiling against both GMime 2.6 and 3.0. Now that we're using 3.0 only, rip out the compatibility layer for those functions with changed argument lists, and explicitly use the 3.0 argument lists. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-05-03gmime-cleanup: use GMime 3.0 function namesDaniel Kahn Gillmor
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-05-03gmime-cleanup: use GMime 3.0 data typesDaniel Kahn Gillmor
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-05-03gmime-cleanup: drop unused gmime #defines and simplify g_mime_init ()Daniel Kahn Gillmor
Several of these #defines were not actually used in the notmuch codebase any longer. And as of GMime 3.0, g_mime_init takes no arguments, so we can also drop the bogus RFC2047 argument that we were passing and then #defining away. signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-05-03gmime-cleanup: drop all arguments unused in GMime 3Daniel Kahn Gillmor
This means dropping GMimeCryptoContext and notmuch_config arguments. All the argument changes are to internal functions, so this is not an API or ABI break. We also get to drop the #define for g_mime_3_unused. signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-05-03gmime-cleanup: drop g_mime_2_6_unrefDaniel Kahn Gillmor
signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-05-03gmime-cleanup: remove GMime 2.6 variant codeblocksDaniel Kahn Gillmor
signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-03-11util: make remaining headers includable from C++David Bremner
libnotmuch_util.a is supposed to be usable from the library and the CLI, but much the library is compiled as C++. Add in appropriate wrapping to prevent symbol mangling. These wrappers already existed in string-util.h; it seems better to be consistent.
2017-12-08Merge branch 'release'David Bremner
Conflicts: NEWS Add in NEWS from point release
2017-12-08crypto: signature verification reports valid User IDsDaniel Kahn Gillmor
When i'm trying to understand a message signature, i care that i know who it came from (the "validity" of the identity associated with the key), *not* whether i'm willing to accept the keyholder's other identity assertions (the "trust" associated with the certificate). We've been reporting User ID information based on the "trust" associated with the certificate, because GMime didn't clearly expose the validity of the User IDs. This change relies on fixes made in GMime 3.0.3 and later which include https://github.com/jstedfast/gmime/pull/18.
2017-10-14gmime-extra: drop compat layer for g_mime_multipart_encrypted_decryptDaniel Kahn Gillmor
In practice, we're going to see this function invoked differently depending on which gmime we build against. The compatibility layer forces our code into the lowest-common-denominator -- unable to make use of new features even when built against a newer version. Dropping the compatibility layer paves the way for clearer use of features from GMime 3.0 in future commits.
2017-10-12gmime-extra: remove duplicate GMimeAddressType typedefDaniel Kahn Gillmor
"typedef GMimeAddressType GMimeRecipientType" is already present further down in the compatibility wrapper (with other typedefs). We don't need it twice.
2017-07-15cli/crypto: eliminated compiler warnings about unused argumentsDavid Bremner
These are due to (excessively?) fancy macro definitions in gmime-extra.h
2017-07-14clean up use of constants in g_mime_multipart_ wrappersDaniel Kahn Gillmor
When compiling as C code (instead of C++) against gmime 3.0, gcc gives errors like the following: error: invalid conversion from ‘int’ to ‘GMimeDecryptFlags’ [-fpermissive] so use explicit *_NONE values instead.
2017-07-14cli: wrap getting uidDavid Bremner
Apparently it moved from "name" to "key_id" in gmime-3.0
2017-07-14cli: make keyid from fingerprint in gmime 3.0David Bremner
The "key_id" field seems to used for userid in gmime-3.0, while the keyid is dropped in the fingerprint field if the full fingerprint is not available.
2017-07-14lib: paper over allocation differenceDavid Bremner
In gmime 3.0 this function is "transfer none", so no deallocation is needed (or permitted)
2017-07-14lib: wrap use of g_mime_utils_header_decode_dateDavid Bremner
This changes return type in gmime 3.0
2017-07-14cli: hide rename of GMimeCertificateTrustDavid Bremner
Both the enum and the values are renamed in GMime 3.0.
2017-07-14cli: generalize use of GMIME_SIGNATURE_{ERROR,STATUS} to gmime-3David Bremner
The ERROR enum is merged into to the STATUS enum, and the set of flags is different.
2017-07-14util: fake gmime-2.6 compatible API for gmime-3.0David Bremner
Several functions have added arguments which accept NULL and provide hopefully sensible defaults. Use macros to minimize source changes.
2017-07-14cli: replace use of g_mime_message_get_recipientsDavid Bremner
This function, and associated enum, have been renamed and generalized in gmime-3.0.
2017-07-14lib/cli: replace use of g_mime_message_get_senderDavid Bremner
This function changes semantics in gmime-3.0 so make a new function that provides the same functionality in both
2017-07-14cli: replace use of g_mime_message_get_reply_toDavid Bremner
This function changes signature in gmime 3.0, so we provide two new functions, one for each signature.
2017-07-14cli: replace use of g_mime_message_get_date_as_stringDavid Bremner
This function goes away in gmime-3.0. Also, the memory management is apparently error prone, witness the memory leak in notmuch-reply.
2017-05-30util: convenience function to create gmime stream for stdoutDavid Bremner
It turns out that our use of GMimeStreamPipe has only succeeded because gmime has been ignoring some seek failures; this will no longer be the case in gmime 3.0, so we use a GMimeStreamPipe, which does not assume seekability, wrapped in a buffering stream.