Skip to content

Cannot import mail with inbox tag unaltered #277

@rhstanton

Description

@rhstanton

I want to import emails without changing the tags on gmail at all. In particular, if an email is in Inbox on gmail, I want it tagged inbox on my local system, and if it is not in Inbox on gmail, i want it not to be tagged inbox on my local machine. But I can't get this to happen. Regardless of what I do, every email that gets imported seems to have both inbox and unread tags set.

I know this is the default action if you don't specify something explicit for new.tags. I've also seen another thread here talking about how configuring new.tags in .notmuch-config may not work, and suggesting that you instead need to set this option using

notmuch config set --database new.tags ...

Unfortunately, no matter what I do, I get the same behavior with every imported email having inbox and unread tags set.

To test this, I've set up a new gmail account that has just three messages in total. Two are in Inbox. Of these, one also has another label(as well as Inbox) attached. Finally, there is one last message that is not in Inbox and has another label attached.
One of the messages in Inbox is unread, while the the two messages are read.

When I do my first sync using gmi and then run

notmuch search tag:inbox

it shows three messages (instead of the correct 2), as does

notmuch search tag:inbox

(instead of the correct 1)

Here are some experiments I've tried:

  1. Comment out tags= line.

Running notmuch config --get new.tags returns unread and inbox, the expected default settings. I didn't bother to actually import anything here.

  1. tags= in .notmuch-config (i.e., blank after the =)

Running notmuch config --get new.tags returns nothing. This looks hopeful!

But after running gmi init and gmi sync on a freshly prepared directory,

notmuch search tag:inbox shows 3 messages (not 2)
notmuch search tag:unread shows 3 messages (not 1)

  1. Comment out tags= line and run notmuch config set --database new.tags

Now notmuch config --get new.tags returns unread and inbox, and when I import notmuch reports three unread messages and three messages in Inbox

  1. Uncomment tags= and run notmuch config set --database new.tags

Now notmuch config --get new.tags returns nothing, but when I import notmuch again reports three unread messages and three messages in Inbox.

I'm not sure what to try next, but it seems that getting notmuch to report that it's not assigning any tags is not the same things as notmuch not actually assigning any tags...

Has anyone actually got this to work? Otherwise I love lieer. I spent a long time getting mbcync to work, but ended up with multiple copies of messages, which is clearly asking for trouble. Lieer is really easy to get to work and only imports each message once, which is a really good start! If only I could get the tags to work properly...

By the way, I'm running notmuch 0.38.3 under macOS (installed via Homebrew) and I installed lieer from the Github repository yesterday.

Thanks for any suggestions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions