aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-10-04test: expand argument parsing testsJani Nikula
Test and use the new .present field, only output the parameters given. Test space between parameter name and value.
2017-10-04cli: add .present field to opt desc to check if the arg was presentJani Nikula
Add pointer to boolean .present field to opt desc, which (if non-NULL) will be set to TRUE if the argument in question is present on the command line. Unchanged otherwise.
2017-10-04test: add opt_inherit to arg-testJani Nikula
Just split the arguments to two opt desc arrays.
2017-10-04test: add boolean argument to arg-testJani Nikula
Surprisingly it's not there.
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-10-04cli: strip trailing "/" from the final maildir path in notmuch insertJani Nikula
Several subtle interconnected changes here: - If the folder name passed as argument is the empty string "" or slash "/", the final maildir path would end up having "//" in it. We should strip the final maildir path, not folder. - The folder variable should really be const char *, another reason not to modify it. - The maildir variable is only const to let us point it at db_path directly. To be able to strip the maildir variable, always allocate it. Default folder to the empty string "", and don't treat folder not being present on the command line as anything special. As a side effect, we also create the cur/new/tmp in the top level directory if they're not there and --create-folder is given.
2017-10-02cli/new: ignore special directories also in pass 2Jani Nikula
Avoid passing . and .. to ignore check. We also don't need to check their dirent type either.
2017-10-02cli/new: check for special directories earlier in pass 1Jani Nikula
Avoid passing . and .. to ignore check. We don't need to check their dirent type either.
2017-10-02devel: add script to test out-of-tree buildsJani Nikula
Something I used for 'git bisect run', but we should really add this as part of our process.
2017-10-02T390-python: add test for get_message_parts and special charactersFlorian Klink
This imports a message with ISO-8859-2 encoded characters, then opens the database using the python bindings. We peek through all mesage parts, afterwards print the message id. Signed-off-by: Florian Klink <flokli@flokli.de> Signed-off-by: Andreas Rammhold <andreas@rammhold.de>
2017-10-02python: open messages in binary modeFlorian Klink
currently, notmuch's get_message_parts() opens the file in text mode and passes the file object to email.message_from_file(fp). In case the email contains UTF-8 characters, reading might fail inside email.parser with the following exception: File "/usr/lib/python3.6/site-packages/notmuch/message.py", line 591, in get_message_parts email_msg = email.message_from_binary_file(fp) File "/usr/lib/python3.6/email/__init__.py", line 62, in message_from_binary_file return BytesParser(*args, **kws).parse(fp) File "/usr/lib/python3.6/email/parser.py", line 110, in parse return self.parser.parse(fp, headersonly) File "/usr/lib/python3.6/email/parser.py", line 54, in parse data = fp.read(8192) File "/usr/lib/python3.6/codecs.py", line 321, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe4 in position 1865: invalid continuation byte To fix this, read file in binary mode and pass to email.message_from_binary_file(fp). Unfortunately, Python 2 doesn't support email.message_from_binary_file(fp), so keep using email.message_from_file(fp) there. Signed-off-by: Florian Klink <flokli@flokli.de>
2017-09-28doc: fix typosJakub Wilk
2017-09-27emacs: sanitize subject in repliesJani Nikula
Commit a7964c86d125 ("emacs: Sanitize authors and subjects in search and show") added sanitization of header information for display. Do the same for reply subjects. This fixes the long-standing annoying artefact of certain versions of mailman using tab as folding whitespace, leading to tabs in reply subjects.
2017-09-27test: add emacs reply test for subjects with TABJani Nikula
Expect TABs to be sanitized from the subject line. Known broken.
2017-09-24fix reference to notmuch_message_get_propertiesDaniel Kahn Gillmor
2017-09-17lib: index the content-type of the parts of encrypted messagesDaniel Kahn Gillmor
This is a logical followup to "lib: index the content type of signature parts", which will make it easier to record the message structure of all messages.
2017-09-17lib: index the content type of signature partsJani Nikula
It's useful (*) to be able to easily find messages with certain types of signatures. Having the mimetype: prefix searches fail for some content types is also genuinely surprising (*). Index the content type of signature parts. While at it, switch to the gmime convenience constants for content and signature part indexes. *) At least for developers of email software!
2017-09-17test: signed and encrypted part content type indexingJani Nikula
Add known broken subtests for searching signed and encrypted messages using mimetype: prefix search for the content-types of signed and encrypted parts.
2017-09-17lib: abstract content type indexingJani Nikula
Make the follow-up change of indexing signature content types easier. No functional changes.
2017-09-17debian: update gitignoreDavid Bremner
elpa-notmuch is a new binary package, notmuch-dbg is no longer generated.
2017-09-13cli/new: abstract special directory checkJani Nikula
Add an abstraction for . and .. directory checks. No functional changes.
2017-09-13cli/new: use the same style for fs entry loopsJani Nikula
Just to please the eyes. No functional changes.
2017-09-13build: fix out-of-tree builds, againJani Nikula
Broken, again, by yours truly in bc11759dd1fd ("build: switch to hiding libnotmuch symbols by default"). Reference notmuch.sym via $(srctree).
2017-09-12emacs/address: use member instead of memq to check for pairDavid Bremner
Quoting from the elisp reference: For other types (e.g., lists, vectors, strings), two arguments with the same contents or elements are not necessarily ‘eq’ to each other. Thanks to "Attic Hermit" for the fix.
2017-09-12python: deprecated add_message calls index_file correctly and returns resultGaute Hope
The deprecated Database.add_message now calls the new index_file with correct number of arguments (without an extra `self`), and returns the tuple from index_file - as it used to do before. This change also adds a DeprecationWarning to the function.
2017-09-11Merge tag '0.25.1'David Bremner
notmuch 0.25.1 release (bugfix for emacs bug 28350)
2017-09-11debian: changelog stanza for 0.25.1-10.25.1David Bremner
2017-09-11NEWS: news entry for 0.25.1David Bremner
2017-09-11version: bump to 0.25.1David Bremner
2017-09-11emacs: override enriched-decode-display-prop for text/enriched displayJani Nikula
Switch to a local version of enriched-decode-display-prop if we encounter a text/enriched part. This is to mitigate https://bugs.gnu.org/28350. Normally it would be prudent to remove the override afterwards, but in this case just leave it in. Notes from db: This doesn't disable text/enriched, just one feature of it.
2017-09-05fix documentation bug (leading quotes break documentation)Daniel Kahn Gillmor
2017-09-05test/duplicate-mid: check for subject with notmuch-showDavid Bremner
In [1] Mark showed that the the current code (d7a49e81) is not consistent in it's handling of subjects of messages with duplicate message-ids (or in notmuch-speak, of messages with multiple files). notmuch-search uses indexing order and explicitedly preserves the first. notmuch-show (apparently) uses alphabetical (or at least xapian term order) of filenames. In a perfect world we would probably report all subjects in the json output; at the very least we should be consistent. [1]: id:87378dny3d.fsf@qmul.ac.uk
2017-09-05lib: enforce that n_message_reindex takes headers from first fileDavid Bremner
This is still a bit stopgap to be only choosing one set of headers, but this seems like a more defensible set of headers to choose.
2017-09-05test: known broken test for subject after reindexingDavid Bremner
In [1], Mark gave a test that was behaving strangly. This turns out to be specific to reindexing. I suppose one could argue that picking the lexicographically last file name is a defensible choice, but it's almost as easy to take the first, which seems more intuitive. So mark the current situation as broken. [1]: id:1503859703-2973-1-git-send-email-markwalters1009@gmail.com
2017-09-05test/duplicate-mid: clarify index order vs filename orderDavid Bremner
The existing test for notmuch search had the first in filename order the same as the first indexed, which made it harder to understand what the underlying behaviour is. Add a file with a lexicographically smaller name, but later index time to clarify this.
2017-09-05test: make fallback to duplicate test more robust.David Bremner
The original intent of this test was to verify that notmuch show was not crashing when the first file (where headers are being read from) was deleted. Run the output through some sanitization so that as we add and delete copies we don't have to update this test.
2017-09-05emacs: Refuse requests to refresh tree views while a refresh is runningVladimir Panteleev
notmuch-tree did not protect against concurrent refreshes like notmuch-search, meaning, hitting '=' (notmuch-refresh-this-buffer) quickly will spawn multiple parallel notmuch processes, and clobber the existing results in the current buffer. * notmuch-tree.el: Add a guard to notmuch-tree-refresh-view similar to the one in notmuch-search.
2017-09-04lib&cli: use g_object_new instead of g_object_newvDavid Bremner
'g_object_newv' is deprecated, and prints annoying warnings. The warnings suggest using 'g_object_new_with_properties', but that's only available since glib 2.55 (i.e. a month ago as of this writing). Since we don't actuall pass any properties, it seems we can just call 'g_object_new'.
2017-09-04test: notmuch_drop_mail_headers() style updateTomi Ollila
Changed "" quotes to '' as we're not supposed to dynamically alter python program (via shell $variable expansion). Added space to python program to match general python style. Replaced $* with 'idiomatic' "$@" to serve as better example.
2017-09-03test/crypto: remove headers more robustlyDavid Bremner
In [1], Vladimir Panteleev observed that the In-Reply-To and References headers could be wrapped in the 'default' output format of notmuch-reply, depending on the version of Emacs creating the message. In my own experiments notmuch-reply sometimes wraps headers with only one message-id if that message-id is long enough. However it happens, this causes the previous approach using grep to fail. Since I found the proposed unwrapping shell fragment in [1] a bit hard to follow, I decided to write a little python script instead. Then Tomi suggested a slight generalization of my script, and here we are. [1] id:20170817175145.3204-7-notmuch@thecybershadow.net
2017-08-31build: fix unbound variable in configureJan Malakhovski
Commentary by db: This missing initialization caused configure to crash, and hence the build to fail in environments without cppcheck.
2017-08-30gitignore: add .stampsDavid Bremner
2017-08-30.travis.yml: Switch to "sudo: false" for faster buildsVladimir Panteleev
Builds not requiring sudo access run in a container, which will have better performance and less overhead on the Travis infrastructure. Use the apt addon to install dependencies instead of explicit apt-get commands.
2017-08-30test: Fix T050-new.sh on some Travis CI machinesVladimir Panteleev
On some system configurations, setting a breakpoint on the "add_file" function then issuing "continue" in gdb causes the debugger to seemingly jump over the add_file invocation. This results in a test failure, as the "Handle files vanishing between scandir and add_file" subtest expects add_file to be called and fail due to the vanishing file. The compiler optimization level also plays a role - the problem can be reproduced with CFLAGS having -O2 but not -Og. This problem was observed manifesting as a test failure on Travis CI configured with "dist: trusty" and "sudo: false". It was not reproducible on a local Docker image of Travis' runtime environment, so Travis' virtualization infrastructure likely plays a role as well. * T050-new.sh: Breakpoint notmuch_database_add_message instead of add_file to the same effect, and avoid bad gdb behaviour on Travis CI. Amended by db: s/notmuch_database_add_message/notmuch_database_index_file/ Somehow the wrapper function doesn't work as a breakpoint; perhaps due to inlining.
2017-08-30.travis.yml: Replace manual zlib installation with "dist: trusty"Vladimir Panteleev
Travis now offers Ubuntu Trusty (14.04 LTS) VMs as test runners, which is gradually becoming the default. We can opt in to using Trusty now so that we no longer need to manually update zlib to a newer version.
2017-08-30.travis.yml: Add gdb and gpgsm dependenciesVladimir Panteleev
This allows running more tests which were previously skipped due to missing dependencies.
2017-08-30.travis.yml: Invoke `make download-test-databases' before running testsVladimir Panteleev
Download the test message database used for the T530-upgrade.sh test. If the additional load on the web server is undesired, Travis can be instructed to cache the file.
2017-08-30test/smtp-dummy: convert to 'goto DONE' styleDavid Bremner
Clean up several cppcheck warnings of the form - test/smtp-dummy.c:170: error: Resource leak: output Conform to overall notmuch code style.
2017-08-30test/smtp-dummy: uncrustifyDavid Bremner
For some reason lost in the mists of time this code was indented 8 spaces.
2017-08-30cppcheck: call va_end in _internal_errorDavid Bremner
fix for: util/error_util.c:38: error: va_list 'va_args' was opened but not closed by va_end() This makes the code more copy-pastable, if nothing else