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

filtered mail mysteriously appearing in inbox #289

Closed
aspiers opened this issue Sep 29, 2024 · 9 comments
Closed

filtered mail mysteriously appearing in inbox #289

aspiers opened this issue Sep 29, 2024 · 9 comments

Comments

@aspiers
Copy link
Contributor

aspiers commented Sep 29, 2024

I just did a sync, and now when I locally query notmuch for tag:inbox with exclude_tags set to the empty string rather than deleted;spam, I see a mail with both the inbox and spam tags, yet when I check via the gmail UI and IMAP, neither show that mail in the inbox.

How is this possible? Was this perhaps a race condition of lieer against gmail first momentarily placing spam in the inbox before moving it out of the inbox, and lieer happened to pull the mail just before gmail moved it out? I would find that quite surprising, but I can't think of any other explanation.

@aspiers aspiers changed the title spam mysteriously appearing in inbox filtered mail mysteriously appearing in inbox Sep 29, 2024
@aspiers
Copy link
Contributor Author

aspiers commented Sep 29, 2024

Actually, it's not just spam. I have filter rules in gmail such as the following:

image

followed by:

image

The idea being that I only want a thread from one of these mailing lists to arrive in my inbox if I'm involved in it (signalled by the manually applied involved label). This has worked perfectly for years and I've never seen any of these mailing list threads appear in my gmail inbox, even momentarily. But now that I've just started using lieer, I see a mail from the git mailing list appear in my local notmuch database with both inbox and sw/git labels.

As with the spam example above, the only explanation I can think of is that there could be some kind of race condition between lieer syncing as the email arrives in gmail but before all the rules have applied. Or is there another explanation?

@gauteh
Copy link
Owner

gauteh commented Sep 29, 2024

It could be that you have notmuch new and lieer somehow set up to add the inbox tag? With the new configuration options in notmuch this is confusing to get right, and I am unsure what is the best way to do that now.

#277 (I see that you have already seen this issue..). Maybe you have to enable (or add) some more debug in either lieer or notmuch to figure out where that inbox tag is coming from.

@aspiers
Copy link
Contributor Author

aspiers commented Sep 29, 2024

No, I definitely resolved that problem last week. The majority of incoming non-inbox email is not appearing in the inbox. In this issue I'm only describing a very small number of weird exceptions.

@gauteh
Copy link
Owner

gauteh commented Sep 29, 2024

It could be a collision, but then it should resolve itself on the next sync unless gmail is somehow not putting the spamming operation into its history.

@gauteh
Copy link
Owner

gauteh commented Sep 29, 2024

I do sometimes see in GMail web interface that I have email appearing in the inbox, and then have it spammed later.

@aspiers
Copy link
Contributor Author

aspiers commented Sep 29, 2024

I do sometimes see in GMail web interface that I have email appearing in the inbox, and then have it spammed later.

Interesting! I don't think I ever noticed this myself and I've been using gmail for years.

It could be a collision, but then it should resolve itself on the next sync unless gmail is somehow not putting the spamming operation into its history.

Could be. Is there any chance of making lieer's -v output (perhaps optionally) reference not just message ids but also a brief summary (e.g. sender and subject)? That would make it a lot easier to figure out exactly what's happening during each sync.

@gauteh
Copy link
Owner

gauteh commented Sep 29, 2024

If the data is available without doing additional requests its possible :) Is that something you would like to implement yourself? My opensource-time is pretty sporadic nowadays.

@aspiers
Copy link
Contributor Author

aspiers commented Sep 29, 2024

Maybe I can find time to look into it. If any pointers of things I should know for that spring to your mind, please let me know :)

@aspiers
Copy link
Contributor Author

aspiers commented Sep 29, 2024

OK, many apologies for the noise - turns out this was a case of PEBKAC, a.k.a. my fault! After having solved #277 via

notmuch config set --database new.tags new

last week, earlier today I got fed up with having the new tag on all local synced messages, so I did

notmuch config set --database new.tags ''

thinking that this would stop adding any tags on sync. However notmuch treats this as unsetting new.tags, so it went back to the default value of unread;inbox.

I'm now trying a value of ' ' instead, which seems to work at first glance; at least, the config appears right:

~/.local/share/pipx/venvs/lieer $ PYTHONPATH=. ./bin/python3
Python 3.11.8 (main, Feb 08 2024, 08:03:16) [GCC] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import notmuch2
>>> notmuch2.Database().config.get('new.tags')
' '

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

2 participants