Giter Club home page Giter Club logo

Comments (9)

mjg avatar mjg commented on June 24, 2024

Can you describe in more detail what you expect to happen and what in fact does happen when you move your (per tag) deleted mail with afew and sync it with mbsync?

from afew.

GuillaumeSeren avatar GuillaumeSeren commented on June 24, 2024

Hey,
what I do is a custom query with xarg like this (probably stolen from arch wiki https://wiki.archlinux.org/title/Notmuch#Permanently_delete_emails)

notmuch search --output=files --format=text0 --limit=1 date:..1Y and not tag:unread and not tag:inbox and not tag:to-me and not tag:flagged and not tag:replied | xargs -0 rm

from afew.

mjg avatar mjg commented on June 24, 2024

@GuillaumeSeren sure, that's how you delete locally in a notmuch set-up. Alternatively, have "afew" move those files to a folder where the server deletes them after some time.

I understood @vikasrawal 's question differently, as if afew's move would clear a trash flag or such. notmuch syncs some maildir flags with tags but explicitely excludes the trash flag. mbsync syncs the flags, but the exact handling depends on a couple of mbsync config choices.

from afew.

anarcat avatar anarcat commented on June 24, 2024

I use mbsync to sync emails, and afew is used to move mails tagged as "deleted" to the Trash folders. But this seems to create the problem that mbsync does not correctly identify mails and propagate mail deletion.

is it possible that you forgot the "rename" option to the move plugin?

from afew.

ecocode avatar ecocode commented on June 24, 2024

Is it even possible to move all mail tagged "deleted" to a Trash folder? As I understand from the docs, you would need to setup a rule for every single maildir.. I happen to have 1000+ maildirs, so that is kind of unusable ;)

from afew.

GuillaumeSeren avatar GuillaumeSeren commented on June 24, 2024

Hello,
sorry for the delay.

In afew, you can tag / move mails (see https://afew.readthedocs.io/en/latest/move_mode.html?highlight=mailmover#configuration-section),
but afew does talk directly to the imap server this usually done with mbsync or other sync tool.

So here to propagate a mail deletion, you just delete the file and then sync again (mbsync).

from afew.

mjg avatar mjg commented on June 24, 2024

Hello, sorry for the delay.

In afew, you can tag / move mails (see https://afew.readthedocs.io/en/latest/move_mode.html?highlight=mailmover#configuration-section), but afew does talk directly to the imap server this usually done with mbsync or other sync tool.

So here to propagate a mail deletion, you just delete the file and then sync again (mbsync).

Yes, that's when you delete them locally using notmuch/xarg/rm.

An alternative would be moving them to a trash/30dtrash folder and let the imap server do the purging. And this is where @ecocode 's question comes in: Is it possible to move all mail tagged trash to a trash folder, using afew? And the answer is "no" (unless you set up config for all folders).

But I think for this and similar purposes it would be beneficial to have a "slow/manual" mode of the mover, something like:

afew -M <folder> <query>

which moves all mail matching <query> to <folder>. afew has all the logic already (searching, file renaming, moving). This mode can be slow depending on the scope of the query but would cover the mentioned use case as well as all cases where you do a one-off reorganisation of your local mail store (to be synced up in a follow-up step).

from afew.

ecocode avatar ecocode commented on June 24, 2024

from afew.

GuillaumeSeren avatar GuillaumeSeren commented on June 24, 2024

Hey,

Is it possible to move all mail tagged trash to a trash folder, using afew? And the answer is "no" (unless you set up config for all folders).

Yes but that would be a nice optimisation of the move filter.

if you consider a small config like:

MyMail/INBOX = 'tag:spam':MyMail/spam 'tag:sent':MyMail/sent 'not tag:inbox':MyMail/archive 'tag:trash':MyMail/trash
MyMail/archive = 'tag:inbox':MyMail/INBOX 'tag:spam':MyMail/spam 'tag:sent':MyMail/sent 'tag:trash':MyMail/trash
MyMail/spam = 'NOT tag:spam':MyMail/INBOX 'tag:sent':MyMail/sent 'tag:trash':MyMail/trash
MyMail/sent = 'NOT tag:sent':MyMail/INBOX 'tag:spam':MyMail/spam 'tag:trash':MyMail/trash
MyMail/trash = 'tag:inbox':MyMail/INBOX 'tag:spam and not tag:trash':MyMail/spam 'tag:sent and not tag:trash':MyMail/sent

Would become

MyMail/* = 'tag:spam':MyMail/spam 'tag:sent':MyMail/sent 'not tag:inbox':MyMail/archive 'tag:trash':MyMail/trash
MyMail/archive = 'tag:inbox':MyMail/INBOX
MyMail/spam = 'NOT tag:spam':MyMail/INBOX
MyMail/sent = 'NOT tag:sent':MyMail/INBOX
MyMail/trash = 'tag:spam and not tag:trash':MyMail/spam 'tag:sent and not tag:trash':MyMail/sent

from afew.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.