Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot import mail with inbox tag unaltered #277

Open
rhstanton opened this issue Apr 7, 2024 · 7 comments
Open

Cannot import mail with inbox tag unaltered #277

rhstanton opened this issue Apr 7, 2024 · 7 comments

Comments

@rhstanton
Copy link

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.

@gauteh
Copy link
Owner

gauteh commented Apr 7, 2024

Hi, maybe this is related to #229 ?

@rhstanton
Copy link
Author

Yes, it's the same thing, I think. And I can verify that things work if I revert to lieer version 1.3, as suggested by tabuchid

@gauteh
Copy link
Owner

gauteh commented Apr 7, 2024

I believe there was another work around where you can use the newer notmuch bindings as well. You might have to set the new-tags using notmuch config as well.

@gauteh
Copy link
Owner

gauteh commented Apr 7, 2024

Ah, I see you have tried most of that..

@rhstanton
Copy link
Author

Yes, I think the real new content of my message was that even when config get tells you no tags are being added, it's not necessarily telling you the truth. I couldn't find a combination of config file and command line configuration that would not add inbox and unread.

@aspiers
Copy link
Contributor

aspiers commented Sep 22, 2024

The combination which seems to be working for me is roughly your experiment 3 (comment out tags= line in the config file, and run notmuch config set --database new.tags new), but then I have to do a gmi pull -f to remove the spurious inbox and unread tags which were previously applied. Adding -v to this command shows them being removed, e.g.

changing tags on message: 18a2cc9f3cc7d1e4 from: {'updates', 'inbox', 'unread'} to: ['updates']            

@gauteh
Copy link
Owner

gauteh commented Sep 29, 2024

It would be great if someone (tm) could write the definitive solution in the README.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants