aboutsummaryrefslogtreecommitdiff
path: root/notmuch-insert.c
AgeCommit message (Collapse)Author
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-12-07cli/insert: delay database open until after writing mail fileDavid Bremner
The idea is to get the mail written to disk, even if we can't open the database (e.g. because some other process has a write lock, and notmuch is compiled for non-blocking opens).
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.
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: 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-05-31cli: change "setup" to "set up" where used as a verbJ. Lewis Muir
The word "setup" is a noun, not a verb. Change occurrences of "setup" where used as a verb to "set up".
2014-10-28cli/insert: add post-insert hookJani Nikula
The post-new hook might no longer be needed or run very often if notmuch insert is being used. Therefore a post-insert hook is needed (arguably pre-insert not so much, so don't add one). Also add the --no-hooks option to skip hooks.
2014-10-28cli: cast timeval fields to long for formatJani Nikula
This hides platform differences between struct timeval field types.
2014-10-18cli/insert: require succesful message indexing for success statusJani Nikula
Add --keep option to keep any remaining stuff in index or file. We could distinguish between failures to index and failures to apply tags or maildir sync, but for simplicity just have one.
2014-10-18cli/insert: add fail path to add_file_to_databaseJani Nikula
Handle failures gracefully in add_file_to_database, renamed simply add_file while at it. Add keep option to not remove the message from database if tagging or tag syncing to maildir flags fails. Expand the function documentation to cover the changes.
2014-09-24cli/insert: rehash file writing functionsJani Nikula
Make the function calls make more sense as independent building blocks of the big picture, with clear inputs and outputs. Split up write_message into two. Improve function documentation. Cleanup and clarify the error paths.
2014-09-24cli/insert: abstract temporary filename generationJani Nikula
This will clean up the usage. There's the slight functional change of potentially ending up doing extra gethostname and getpid calls, but this is neglible.
2014-09-24cli/insert: use a single recursive mkdir functionJani Nikula
Combine make_directory() and make_directory_and_parents() into a single recursive mkdir_recursive() function. Clarify the code and improve error handling. Improve error messages. Switch to using the new function in maildir_create_folder(). Constify talloc context.
2014-09-24cli/insert: clean up sync_dirJani Nikula
Clarify the code slightly, improve error messages. Apart from the error message changes, no functional changes.
2014-09-24cli/insert: rename file copy functionJani Nikula
The copying has nothing to do with stdin, so call it copy_fd instead. While at it, improve documentation and reverse the parameters, as destination is traditionally the first parameter.
2014-09-24cli/insert: move add_file_to_database to a better placeJani Nikula
Move add_file_to_database around to keep the filesystem related functions grouped together, improving readability. No functional changes.
2014-09-24cli/insert: rename check_folder_name to is_valid_folder_nameJani Nikula
An "is something" predicate conveys the meaning better. While at it, improve the function documentation and error message. Besides the error message change, no functional changes.
2014-09-16cli: refactor insertPeter Wang
Change insert_message into write_message and move its responsibilities for indexing the message into the main function, to simplify the control flow.
2014-03-06cli: make sure notmuch new and insert don't add invalid tagsJani Nikula
Check new.tags configuration values before doing anything, and bail out on invalid values.
2014-01-18cli: clean up exit status code returned by the cli commandsJani Nikula
Apart from the status codes for format mismatches, the non-zero exit status codes have been arbitrary. Make the cli consistently return either EXIT_SUCCESS or EXIT_FAILURE.
2014-01-03insert: respect maildir.synchronize_flagsJani Nikula
Don't synchronize maildir flags if the user doesn't want it.
2013-07-04insert: add --create-folder optionPeter Wang
Allow the insert command to create the maildir folder into which the new message should be delivered.
2013-07-01insert: add --folder optionPeter Wang
Allow the new message to be inserted into a folder within the Maildir hierarchy instead of the top-level folder.
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.