summaryrefslogtreecommitdiffstats
path: root/notmuch-client.h
AgeCommit message (Collapse)Author
2019-05-29cli/show: emit payload subject instead of outside subjectDaniel Kahn Gillmor
Correctly fix the two outstanding tests so that the protected (hidden) subject is properly reported. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-05-26cli: expose message-wide crypto status from mime-nodeDaniel Kahn Gillmor
The mime node context (a per-message context) gains a cryptographic status object, and the mime_node_t object itself can return a view on that status to an interested party. The status is not yet populated, and for now we can keep that view read-only, so that it can only be populated/modified during MIME tree traversal.
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: remove obsolete gpg_path configuration option and crypto contextsDaniel Kahn Gillmor
Note that we do keep ignoring the gpg_path configuration option, though, to avoid breakage of existing installations. It is ignored like any other unknown configuration option, but we at least document that it is ignored so that people who find it in their legacy configs can know that it's safe to drop. signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2018-05-26cli: add print_status_message()Daniel Kahn Gillmor
This function is a parallel to print_status_query() or print_status_database(). Thanks to David Bremner for the suggestion!
2017-12-08crypto: new decryption policy "auto"Daniel Kahn Gillmor
This new automatic decryption policy should make it possible to decrypt messages that we have stashed session keys for, without incurring a call to the user's asymmetric keys.
2017-12-08lib: convert notmuch decryption policy to an enumDaniel Kahn Gillmor
Future patches in this series will introduce new policies; this merely readies the way for them. We also convert --try-decrypt to a keyword argument instead of a boolean.
2017-12-08indexopts: change _try_decrypt to _decrypt_policyDaniel Kahn Gillmor
This terminology makes it clearer what's going on at the API layer, and paves the way for future changesets that offer more nuanced decryption policy.
2017-10-21cli: set up shared command-line arguments for indexingDaniel Kahn Gillmor
We have an indexopts structure for manipulating indexing in different ways, but we also have three command-line invocations that can trigger indexing: new, insert, and reindex. This changeset prepares a common parser that these subcommands can share. Note: if the deprecated crypto.gpg_path configuration option is set to anything other than "gpg", we ignore it (and print a warning on stderr, if built against gmime < 3.0). At the moment, it's just --try-decrypt, but others will likely follow.
2017-10-20crypto: move into libnotmuch_utilDaniel Kahn Gillmor
This prepares us for using the crypto object in both libnotmuch and the client.
2017-10-12crypto: _notmuch_crypto_cleanup should return voidDaniel Kahn Gillmor
There's no chance that _notmuch_crypto_cleanup() will ever return anything other than 0, and no one ever checks its return value anyway. So make it return void instead of int.
2017-10-12crypto: drop pretense of notmuch_crypto_context_tDaniel Kahn Gillmor
notmuch_crypto_context_t was introduced (i think) as some sort of abstraction layer to make notmuch somewhat independent of GMime. But it isn't even useful for GMime 3.0 or later -- we can drop the pretense that it's some sort of abstraction in this case, and just call it what it is, GMimeCryptoContext, which is useful for building against older versions of GMime. This also renames _notmuch_crypto_get_context() to _notmuch_crypto_get_gmime_context().
2017-10-12crypto: rename notmuch_crypto_t to _notmuch_crypto_tDaniel Kahn Gillmor
The notmuch_crypto_t struct isn't used externally, and we have no plans to explicitly export it. Prefix its name (and associated functions) with _ to make that intent clear.
2017-10-09cli: convert notmuch_bool_t to stdboolJani Nikula
C99 stdbool turned 18 this year. There really is no reason to use our own, except in the library interface for backward compatibility. Convert the cli and test binaries to stdbool.
2017-10-04cli: use designated initializers for opt descJani Nikula
Several changes at once, just to not have to change the same lines several times over: - Use designated initializers to initialize opt desc arrays. - Only initialize the needed fields. - Remove arg_id (short options) as unused. - Replace opt_type and output_var with several type safe output variables, where the output variable being non-NULL determines the type. Introduce checks to ensure only one is set. The downside is some waste of const space per argument; this could be saved by retaining opt_type and using a union, but that's still pretty verbose. - Fix some variables due to the type safety. Mostly a good thing, but leads to some enums being changed to ints. This is pedantically correct, but somewhat annoying. We could also cast, but that defeats the purpose a bit. - Terminate the opt desc arrays using {}. The output variable type safety and the ability to add new fields for just some output types or arguments are the big wins. For example, if we wanted to add a variable to set when the argument is present, we could do so for just the arguments that need it. Beauty is in the eye of the beholder, but I think this looks nice when defining the arguments, and reduces some of the verbosity we have there.
2017-08-16remove boolean "first" argument from format_part_sprinterDaniel Kahn Gillmor
This argument seems to be unused, and format_part_sprinter isn't required to meet any specific API so it seems cleaner and simpler to drop it.
2017-08-01add "notmuch reindex" subcommandDaniel Kahn Gillmor
This new subcommand takes a set of search terms, and re-indexes the list of matching messages.
2017-07-15crypto: clean up unused definitions in gmime 3.0David Bremner
based on the same patch from dkg as the previous commit.
2017-07-14config: deprecate/drop crypto.gpg_path under gmime 2.6/3.0Daniel Kahn Gillmor
gmime 3.0 no longer offers a means to set the path for gpg. Users can set $PATH anyway if they want to pick a differently-installed gpg (e.g. /usr/local/bin/gpg), so this isn't much of a reduction in functionality. The one main difference is for people who have tried to use "gpg2" to make use of gpg 2.1, but that isn't usefully co-installable anyway.
2017-07-04cli: implement structured output version 4David Bremner
Since the error field is unused by the emacs front end, no changes are needed other than bumping the format version number. As it is, this is a bit overengineered, but it will reduce duplication when we support gmime 3.0
2017-05-30cli/show: use single stream for printf / gmime object outputDavid Bremner
This is again motivated by the need to transition away from GMimeStreamFile for output to stdout. format_part_mbox is left alone for now, as this cannot be mixed in with output using gmime object output.
2017-05-30cli/reply: direct all output for text format to gmime streamDavid Bremner
Interleaving printfs with writes to the gmime stream worked when the gmime stream was backed by the FILE *stdout, but that is no longer the case. Create one stream and pass it into the two functions where needed, as well well as replacing printfs with g_mime_stream_printf.
2017-04-01Merge branch 'release'David Bremner
Final 0.24.1 release
2017-04-01cli/dump: bump dump format version to 3David Bremner
No changes to the format of the body, but the header format was fixed, and version 2 headers probably shouldn't be relied on.
2017-03-10cli/show: remove unused raw member from show parameters structJani Nikula
The raw member has been unused since b1130bc71c02 ("show: Convert raw format to the new self-recursive style, properly support interior parts"). Good riddance. No functional changes.
2017-02-28cli/config: don't try to open config file for 'notmuch help'Jani Nikula
The help command does not really need to try to open the config file. So don't.
2017-02-26cli/show: list all filenames of a message in the formatted outputJani Nikula
Instead of just having the first filename for the message, list all duplicate filenames of the message as a list in the formatted outputs. This bumps the format version to 3.
2016-12-07cli/insert: return EX_TEMPFAIL for some errorsDavid Bremner
Attempt to distinguish between errors indicating misconfiguration or programmer error, which we consider "permanent", in the sense that automatic retries are unlikely to be useful, and those indicating transient error conditions. We consider XAPIAN_EXCEPTION transient because it covers the important special case of locking failure.
2016-11-25cli: consider files vanishing during notmuch new non-fatalJani Nikula
If some software other than notmuch new renames or removes files during the notmuch new scan (specifically after scandir but before indexing the file), keep going instead of bailing out. Failing to index the file is just a race condition between notmuch and the other software; the rename could happen after the notmuch new scan anyway. It's not fatal, and we'll catch the renamed files on the next scan. Add a new exit code for when files vanished, so the caller has a chance to detect the race and re-run notmuch new to recover. Reported by Paul Wise <pabs@debian.org> at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=843127
2016-09-21CLI: add properties to dump outputDavid Bremner
Part of providing extensibility via properties is to make sure that user data is not lost. Thus we need to be able to dump and restore properties.
2016-06-05Use https instead of http where possibleDaniel Kahn Gillmor
Many of the external links found in the notmuch source can be resolved using https instead of http. This changeset addresses as many as i could find, without touching the e-mail corpus or expected outputs found in tests.
2016-05-25CLI: add optional config data to dump output.David Bremner
Note that it changes the default dump output format, but doesn't break existing notmuch-restore. It might break user scripts though.
2016-03-29CLI: add print_status_databaseDavid Bremner
This could probably be used at quite a few places in the existing code, but in the immediate future I plan to use in some new code in notmuch-dump
2016-01-29cli: crypto: S/MIME verification supportJani Nikula
notmuch-show --verify will now also process S/MIME multiparts if encountered. Requires gmime-2.6 and gpgsm. Based on work by Jameson Graef Rollins <jrollins@finestructure.net>.
2015-09-26cli: change the data structure for notmuch address deduplicationJani Nikula
Currently we key the address hash table with the case sensitive "name <address>". Switch to case insensitive keying with just address, and store the case sensitive name and address in linked lists. This will be helpful in adding support for different deduplication schemes in the future. There will be a slight performance penalty for the current full case sensitive name + address deduplication, but this is simpler as a whole when other deduplication schemes are added, and I expect the schemes to be added to become more popular than the current default. Aparet from the possible performance penalty, the only user visible change should be the change in the output ordering for --output=count. The order is not guaranteed (and is based on hash table traversal) currently anyway, so this should be of no consequence.
2015-09-20cli: add utility routine to print error status.David Bremner
No attention to formatting here, initially just focus on getting the relevant strings out of the library.
2015-08-26cli/lib: remove support for GMime 2.4David Bremner
It's becoming a maintenance burden to do anything things with the crypto glue code twice, once for 2.4 and once for 2.6. I don't have any 2.4 version available to test on my development machine anymore, so the 2.4 specific code paths are likely not very well tested.
2015-08-14cli: add global option "--uuid"David Bremner
The function notmuch_exit_if_unmatched_db_uuid is split from notmuch_process_shared_options because it needs an open notmuch database. There are two exceptional cases in uuid handling. 1) notmuch config and notmuch setup don't currently open the database, so it doesn't make sense to check the UUID. 2) notmuch compact opens the database inside the library, so we either need to open the database just to check uuid, or change the API.
2015-06-01cli: add standard option processing to config, help and setupDavid Bremner
In particular this fixes a recently encountered bug where the "--config" argument to "notmuch setup" is silently ignored, which the unpleasant consequence of overwriting the users config file.
2015-06-01cli: define shared options, use for --help and --versionDavid Bremner
Unfortunately it seems trickier to support --config globally The non-trivial changes are in notmuch.c; most of the other changes consists of blindly inserting two lines into every subcommand.
2015-03-11CLI: make gpg binary used by libgmime configurable.David Bremner
Previously we set up a way for the top level notmuch command to choose which gpg binary was invoked by libgmime. In this commit we add the (mostly boilerplate) code to allow the notmuch-config command to read and write this path, and use it in the appropriate struct. Update tests for new default variable
2015-03-09CLI: set up infrastructure to make path to gpg configurable.David Bremner
GMIME takes a path to gpg, but we hardcode that path. In this commit we set up argument passing and option storage to allow this path to specified in the top level notmuch command.
2014-11-05cli: Introduce "notmuch address" commandMichal Sojka
This moves address-related functionality from search command to the new address command. The implementation shares almost all code and some command line options. Options --offset and --limit were intentionally not included in the address command, because they refer to messages numbers, which users do not see in the output. This could confuse users because, for example, they could see more addresses in the output that what was specified with --limit. This functionality can be correctly reimplemented for address subcommand later. Also useless values of --exclude flag were not included in the address command. This was inspired by a patch from Jani Nikula.
2014-04-12dump: support gzipped and atomic outputDavid Bremner
The main goal is to support gzipped output for future internal calls (e.g. from notmuch-new) to notmuch_database_dump. The additional dependency is not very heavy since xapian already pulls in zlib. We want the dump to be "atomic", in the sense that after running the dump file is either present and complete, or not present. This avoids certain classes of mishaps involving overwriting a good backup with a bad or partial one.
2014-03-30cli: abstract dump file open from the dump commandJani Nikula
Also expose the dump function to the rest of notmuch. No functional changes, except for slight improvement in error handling.
2013-11-08search: Add stable queries to thread search resultsAustin Clements
These queries will match exactly the set of messages currently in the thread, even if more messages later arrive. Two queries are provided: one for matched messages and one for unmatched messages. This can be used to fix race conditions with tagging threads from search results. While tagging based on a thread: query can affect messages that arrived after the search, tagging based on stable queries affects only the messages the user was shown in the search UI. Since we want clients to be able to depend on the presence of these queries, this ushers in schema version 2.
2013-11-08cli: Separate current and deprecated format versionAustin Clements
Previously, the CLI would print a deprecation warning if a client requested any format version other than the current one. However, if we add fields that are backwards-compatible, but want clients to be able to depend on, we need to bump the version, but that doesn't make the older version deprecated. Hence, separate out the "minimum active" version and only print a warning for requests below this version number.
2013-10-09notmuch-compact: Initial commit of CLIBen Gamari
Introduce the user command exposing the new compaction facility. Signed-off-by: Ben Gamari <bgamari.foss@gmail.com>
2013-08-27cli: add --include-html option to notmuch showJohn Lenz
For my client, the largest bottleneck for displaying large threads is exporting each html part individually since by default notmuch will not show the json parts. For large threads there can be quite a few parts and each must be exported and decoded one by one. Also, I then have to deal with all the crazy charsets which I can do through a library but is a pain. Therefore, this patch adds an --include-html option that causes the text/html parts to be included as part of the output of show. diff man/man1/notmuch-show.1
2013-06-29cli: add insert commandPeter Wang
The notmuch insert command reads a message from standard input, writes it to a Maildir folder, and then incorporates the message into the notmuch database. Essentially it moves the functionality of notmuch-deliver into notmuch. Though it could be used as an alternative to notmuch new, the reason I want this is to allow my notmuch frontend to add postponed or sent messages to the mail store and notmuch database, without resorting to another tool (e.g. notmuch-deliver) nor directly modifying the maildir.