Hi, these patches implement synchronization between maildir flags and notmuch tags. The synchronization can be configured to not happen at all (default), to set/unset tags when importing new (or new and renamed) messages and to happen in both directions - set/unset tags during importing and change maildir flags during tagging. The previous version if this feature was present in mailstore abstraction patches. I've extracted it from there and I'm sending it separately. I'm quite heavily dependent on this feature so I hope this version is closer to merging than the previous one. The last patch needs git-based test suite patches sent yesterday. Michal Sojka (4): lib: Return added message even if it already was in the database Maildir synchronization Make maildir synchronization configurable Tests for maildir synchronization lib/database-private.h | 2 +- lib/database.cc | 19 ++++- lib/message.cc | 226 ++++++++++++++++++++++++++++++++++++++++++++ lib/notmuch-private.h | 4 + lib/notmuch.h | 29 ++++++- notmuch-client.h | 7 ++ notmuch-config.c | 48 +++++++++ notmuch-new.c | 7 +- notmuch-restore.c | 2 + notmuch-setup.c | 17 ++++ notmuch-tag.c | 2 + test/t0011-maildir-sync.sh | 216 ++++++++++++++++++++++++++++++++++++++++++ test/test-lib.sh | 11 ++- 13 files changed, 582 insertions(+), 8 deletions(-) create mode 100755 test/t0011-maildir-sync.sh