pazz / alot

Terminal-based Mail User Agent
GNU General Public License v3.0
696 stars 164 forks source link

How to use alot next to Thunderbird/K-9 Mail/FairEmail? #1534

Closed MaxGyver83 closed 4 years ago

MaxGyver83 commented 4 years ago

I'm new to alot and I there are some things I don't understand so far. And it's difficult googling for answers about alot.

So far, I found that alot (and notmuch) can't delete emails physically. The just get tagged as "killed". That's OK for me. It's like moving to trash but not to empty it. But I also use Thunderbird and K-9 Mail (and sometimes FairEmail) and when I move a mail into trash in any of these apps, this will be synced with the IMAP server and then with all other apps connected to my mail account. But when I tag a mail as "killed" in alot (and sync again with offlineimap), it's still in the inbox in Thunderbird and K-9 Mail. I suppose, I'm doing it wrong because nobody wants to "delete" mails in every app separately. I also tried tagging a mail as "trash" instead of "killed" but Thunderbird didn't seem to see that tag either.

  1. How can I move a mail into the trash folder with alot?
  2. How can I show the content of a folder (for example the trash folder) in alot?
pazz commented 4 years ago

Hi and welcome to alot!

Quoting Max (2020-07-05 21:35:10)

  1. How can I move a mail into the trash folder with alot?

As you already know, notmuch/alot won't touch your emails on disk. Usually, one would periodically run an extra "tagging script", which will tag new mails. Many of us write such a script in bash and call int as a post-hook from offlineimap or notmuch new. Personally, I use https://github.com/afewmail/afew for this.

Now, to answer your question, you can move around email files in your tagging script based on tags. The typical workflow would be to identify all mails with a "trash" tag, and either move them to some folder or delete them. Afew has a "move move" for this: https://afew.readthedocs.io/en/latest/move_mode.html

  1. How can I show the content of a folder (for example the trash folder) in alot?

Notmuchs query syntax allows for a search string of the form folder:.... Have a look at man notmuch-search-terms for details.

MaxGyver83 commented 4 years ago

Thanks for your quick answer!

Regarding question 2: That was easy. In the first place, notmuch search folder:xxx didn't show any results because the account name was missing. Now I have a keybinding: P = search folder:web.de/Papierkorb (that's the trash folder).

Regarding question 1: That seems to be more difficult. So I guess I need to run the afew move mode after closing alot, not after running offlineimap or notmuch!? Does alot have a post-close-hook?

pazz commented 4 years ago

Quoting Max (2020-07-06 21:50:04)

Regarding question 1: That seems to be more difficult. So I guess I need to run the afew move mode after closing alot, not after running offlineimap or notmuch!? Does alot have a post-close-hook? The workflow I had in mind, which is what I use for the "killed" tag to suppress new messages from a manually silenced thread, is to simply tag a message in alot. Then my tagging script runs periodically and filters new (but possibly also old) messages.

Alot has all kinds of hooks (see https://alot.readthedocs.io/en/latest/configuration/hooks.html) and you can also define a python function and bind it to a key to be called from within the UI. This way you could bind a key to some function that moves the message itself.

Anyways, this is not really an "issue" as such and I will close this. You are welcome to pop in at 'alot or #notmuch on freenode for a chat.

MaxGyver83 commented 4 years ago

Thank you again! Today I have read more about notmuch and afew. And alot seems to be very powerful with all that hooks. I still have to play around a bit but I think, now I'm able to setup everything like I want it. Not as quick as setting up Thunderbird, but I guess it wasn't fun if it would be too easy :smile:

pazz commented 4 years ago

glad to hear. btw: https://github.com/pazz/alot/wiki/pazz's-mail-setup

lucc commented 4 years ago

@pazz do you sync your tags to another machine as well? I did not see you mention this.

pazz commented 4 years ago

no I don't.

lucc commented 4 years ago

Ok, you motivated me to write up my own setup though :) https://github.com/pazz/alot/wiki/lucc's-mail-setup