From mma at darktemple.ch Mon Jun 1 10:00:11 2026 From: mma at darktemple.ch (Mathias M.) Date: Mon, 1 Jun 2026 12:00:11 +0200 Subject: using mutt_oauth2.py In-Reply-To: References: <411307331.5714664.1780202575352.ref@mail.yahoo.com> <411307331.5714664.1780202575352@mail.yahoo.com> Message-ID: On Sun, May 31, 2026 at 11:53:22AM -0400, Todd Zullinger wrote: > Globe Trotter via Mutt-users wrote: > > My workplace has moved to O365 with oauth2 and I was > > trying to figure out how to get mutt to work. (They allow > > evolution for linux users, but I want to see if I can get > > away with continuing to use mutt.) The evolution setup for > > O365 is not local to my workplace and the configuation > > seems to accept tenant common and the usual application ID > > (client ID). I am not sure what the client_secret is, or > > where to find this. (I am able to log in through > > evolution, and access my email.) > > IIRC, the evolution developers make some attempt to obscure > the client_secret in their code -- which is mostly an > annoyance. > > > So, I was looking into using mutt_oauth2.py. > > > > I came across this post, got the gpg key in place of > > YOUR_GPG_IDENTITY and tried to follow the instructions: > > > > https://www.dcs.gla.ac.uk/~jacobd/posts/2022/03/configure-mutt-to-work-with-oauth-20/ > > > > (I put in the client ID, and for now left the > > client_secret "" because I can not tell where this is > > stored in evolution). Advice on this would be very helpful > > too. > > I think you do need both, but I've only set it up with Gmail > so I can't be sure what Microsoft does or requires. > > > Anyway, but at this poiint, I do not appear to even get > > there: > > > > I try: > > > > $ python mutt_oauth2.py token.txt --authorize > > Difficulty decrypting token file. Is your decryption agent > > primed for non-interactive usage, or an appropriate > > environment variable such as GPG_TTY set to allow > > interactive agent usage from inside a pipe? > > > > Where is this token file put in, in the script? > > It's the argument you pass to the script. So with the > command you wrote above, it would be token.txt in the > directory where you ran the command from. Ideally, you > should specify a full path to ensure things work regardless > of the directory from which you run the script. > > > Actually, is there any place with detailed instructions on > > this? > > Have you seen the thorough README file which is next to the > mutt_oath2.py script in the mutt contrib directory? That is > a good place to start. Being a workplace, I don't know if > you can register a client id on your own or not, but it > might be worth trying. > > -- > Todd Good point. In my employer's case, I had to use Thunderbird's client_id. Which is: 9e5f94bc-e8a4-4e73-b8be-63364c29d753 Regards, Mathias -- Not all who own a harp are harpers. -- Marcus Terentius Varro -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 228 bytes Desc: not available URL: From mlmaitra at gmx.com Fri Jun 5 15:17:25 2026 From: mlmaitra at gmx.com (Ranjan Maitra) Date: Fri, 5 Jun 2026 10:17:25 -0500 Subject: how does mutt (the code) determine unread email? Message-ID: Hi, I use the Maildir++ format with mutt. It all works very well: I have been using xbuffy (also gbuffy) to monitor my mailboxes for at least two decades but these programs currently only either new mail or all mail. I would like to change this to include unread email. Now it is my understanding that mutt moves accessed email from new to cur when a folder is accessed. However, the coloring appears to indicate that the mail is not read (unless we go to that message/file). Where does it get this information from? Is it from the access time of the file in cur which if later than the creation/edited time for the file is assumed that the file is read? Or something else? If I can figure this out, perhaps I can modify gbuffy or xbuffy to include unread email in the monitoring. Many thanks for your help, and best wishes, Ranjan From kh at panix.com Fri Jun 5 18:36:20 2026 From: kh at panix.com (Kurt Hackenberg) Date: Fri, 5 Jun 2026 14:36:20 -0400 Subject: how does mutt (the code) determine unread email? In-Reply-To: References: Message-ID: On Fri, Jun 05, 2026 at 10:17 -0500, Ranjan Maitra via Mutt-users wrote: >I use the Maildir++ format with mutt.... >Now it is my understanding that mutt moves accessed email from new to >cur when a folder is accessed. However, the coloring appears to >indicate that the mail is not read (unless we go to that message/file). >Where does it get this information from? Is it from the access time of >the file in cur which if later than the creation/edited time for the >file is assumed that the file is read? Or something else? I believe Mutt uses the maildir mechanism: when it displays a message, it sets that message's flag "seen", by adding the character 'S' in an optional short string near the end of the message filename. See Wikipedia on maildir: From mlmaitra at gmx.com Fri Jun 5 21:52:44 2026 From: mlmaitra at gmx.com (Ranjan Maitra) Date: Fri, 5 Jun 2026 16:52:44 -0500 Subject: how does mutt (the code) determine unread email? In-Reply-To: References: Message-ID: On Fri Jun05'26 02:36:20PM, Kurt Hackenberg wrote: > From: Kurt Hackenberg > Date: Fri, 5 Jun 2026 14:36:20 -0400 > To: mutt-users at mutt.org > Subject: Re: how does mutt (the code) determine unread email? > > On Fri, Jun 05, 2026 at 10:17 -0500, Ranjan Maitra via Mutt-users wrote: > > > I use the Maildir++ format with mutt.... > > > Now it is my understanding that mutt moves accessed email from new to > > cur when a folder is accessed. However, the coloring appears to indicate > > that the mail is not read (unless we go to that message/file). Where > > does it get this information from? Is it from the access time of the > > file in cur which if later than the creation/edited time for the file is > > assumed that the file is read? Or something else? > > I believe Mutt uses the maildir mechanism: when it displays a message, it > sets that message's flag "seen", by adding the character 'S' in an optional > short string near the end of the message filename. > > See Wikipedia on maildir: > Yes, of course! I am sorry, I completely forgot about looking into the actual Maildir structure. Thank you for pointing this out. Best wishes, Ranjan From mlmaitra at gmx.com Sat Jun 6 19:27:10 2026 From: mlmaitra at gmx.com (Ranjan Maitra) Date: Sat, 6 Jun 2026 14:27:10 -0500 Subject: mutt with notmuch search question Message-ID: Hi, I use notmuch (not very effectively) with mutt. So, I use F8 and get a bunch of results according to what I search on. How do I tell which folders each of these emails (in the search) came from? Many thanks and best wishes, Ranjan From chema at rinzewind.org Sat Jun 6 20:10:32 2026 From: chema at rinzewind.org (=?iso-8859-1?Q?Jos=E9_Mar=EDa?= Mateos) Date: Sat, 6 Jun 2026 22:10:32 +0200 Subject: mutt with notmuch search question In-Reply-To: References: Message-ID: <20260606201032.GA2925@rinzewind.org> On Sat, Jun 06, 2026 at 02:27:10PM -0500, Ranjan Maitra via Mutt-users wrote: >How do I tell which folders each of these emails (in the search) came >from? Use the folder operator. For example: ? notmuch folder:mutt Cheers, -- Jos? Mar?a (Chema) Mateos || https://rinzewind.org From mlmaitra at gmx.com Sat Jun 6 20:52:15 2026 From: mlmaitra at gmx.com (Ranjan Maitra) Date: Sat, 6 Jun 2026 15:52:15 -0500 Subject: mutt with notmuch search question In-Reply-To: <20260606201032.GA2925@rinzewind.org> References: <20260606201032.GA2925@rinzewind.org> Message-ID: On Sat Jun06'26 10:10:32PM, Jos? Mar?a Mateos wrote: > From: Jos? Mar?a Mateos > Date: Sat, 6 Jun 2026 22:10:32 +0200 > To: mutt-users at mutt.org > Subject: Re: mutt with notmuch search question > > On Sat, Jun 06, 2026 at 02:27:10PM -0500, Ranjan Maitra via Mutt-users wrote: > > How do I tell which folders each of these emails (in the search) came > > from? > > Use the folder operator. For example: > > ? notmuch folder:mutt > Thank you! So, to clarify, I do ? on the search results folder, and then under "Search for:" I write "notmuch folder:mutt"? It did not appear to work for me. I got a "Not found" but likely I am doing something wrong. Many thanks and best wishes, Ranjan From chema at rinzewind.org Sun Jun 7 06:04:46 2026 From: chema at rinzewind.org (=?iso-8859-1?Q?Jos=E9_Mar=EDa?= Mateos) Date: Sun, 7 Jun 2026 08:04:46 +0200 Subject: mutt with notmuch search question In-Reply-To: References: <20260606201032.GA2925@rinzewind.org> Message-ID: <20260607060446.GB2925@rinzewind.org> On Sat, Jun 06, 2026 at 03:52:15PM -0500, Ranjan Maitra via Mutt-users wrote: >Thank you! > >So, to clarify, I do ? on the search results folder, and then under "Search for:" I write "notmuch folder:mutt"? That'll work if you store messages from this mailing list in the "mutt" folder. Otherwise you'll have to use the folder name you have. Cheers, -- Jos? Mar?a (Chema) Mateos || https://rinzewind.org From mlmaitra at gmx.com Sun Jun 7 13:05:26 2026 From: mlmaitra at gmx.com (Ranjan Maitra) Date: Sun, 7 Jun 2026 08:05:26 -0500 Subject: mutt with notmuch search question In-Reply-To: <20260607060446.GB2925@rinzewind.org> References: <20260606201032.GA2925@rinzewind.org> <20260607060446.GB2925@rinzewind.org> Message-ID: On Sun Jun07'26 08:04:46AM, Jos? Mar?a Mateos wrote: > From: Jos? Mar?a Mateos > Date: Sun, 7 Jun 2026 08:04:46 +0200 > To: mutt-users at mutt.org > Subject: Re: mutt with notmuch search question > > On Sat, Jun 06, 2026 at 03:52:15PM -0500, Ranjan Maitra via Mutt-users wrote: > > Thank you! > > > > So, to clarify, I do ? on the search results folder, and then under "Search for:" I write "notmuch folder:mutt"? > > That'll work if you store messages from this mailing list in the "mutt" > folder. Otherwise you'll have to use the folder name you have. > > Cheers, > Jos?, Thank you again! But perhaps my original question was not clear. I am trying to find in which of my Maildir++ folders an email that has been found from a notmuch query is. I do the notmuch query using F8 which I presume comes in from notmuch-mutt keybindings. This information is no doubt there because the notmuch folder that stores the search results has the (Maildir++ folder) files linked to the original messages in the folder. But surely, it should be possible to know where this information from the notmuch search results? Many thanks and best wishes, Ranjan From chema at rinzewind.org Sun Jun 7 13:10:14 2026 From: chema at rinzewind.org (=?iso-8859-1?Q?Jos=E9_Mar=EDa?= Mateos) Date: Sun, 7 Jun 2026 15:10:14 +0200 Subject: mutt with notmuch search question In-Reply-To: References: <20260606201032.GA2925@rinzewind.org> <20260607060446.GB2925@rinzewind.org> Message-ID: <20260607131014.GC2925@rinzewind.org> On Sun, Jun 07, 2026 at 08:05:26AM -0500, Ranjan Maitra via Mutt-users wrote: >Thank you again! But perhaps my original question was not clear. I am trying to find in which of my Maildir++ folders an email that has been found from a notmuch query is. I do the notmuch query using F8 which I presume comes in from notmuch-mutt keybindings. Aaaaah, I understand now. Sorry, I answered the opposite question :D Sadly, I don't know the answer to this one, so I'll just let somebody else contribute. Cheers! -- Jos? Mar?a (Chema) Mateos || https://rinzewind.org From mlmaitra at gmx.com Sun Jun 7 13:18:43 2026 From: mlmaitra at gmx.com (Ranjan Maitra) Date: Sun, 7 Jun 2026 08:18:43 -0500 Subject: mutt with notmuch search question In-Reply-To: <20260607131014.GC2925@rinzewind.org> References: <20260606201032.GA2925@rinzewind.org> <20260607060446.GB2925@rinzewind.org> <20260607131014.GC2925@rinzewind.org> Message-ID: On Sun Jun07'26 03:10:14PM, Jos? Mar?a Mateos wrote: > From: Jos? Mar?a Mateos > Date: Sun, 7 Jun 2026 15:10:14 +0200 > To: mutt-users at mutt.org > Subject: Re: mutt with notmuch search question > > On Sun, Jun 07, 2026 at 08:05:26AM -0500, Ranjan Maitra via Mutt-users wrote: > > > Thank you again! But perhaps my original question was not clear. I am trying to find in which of my Maildir++ folders an email that has been found from a notmuch query is. I do the notmuch query using F8 which I presume comes in from notmuch-mutt keybindings. > > Aaaaah, I understand now. Sorry, I answered the opposite question :D > > Sadly, I don't know the answer to this one, so I'll just let somebody else > contribute. > No problem, thank you very much again for your help! Perhaps someone else will know: it must be a fairly regular case, I would think. Many thanks again, and best wishes, Ranjan From ndobrynin at gmail.com Sun Jun 7 13:46:34 2026 From: ndobrynin at gmail.com (Nickolai Dobrynin) Date: Sun, 07 Jun 2026 15:46:34 +0200 Subject: mutt with notmuch search question In-Reply-To: (Ranjan Maitra via Mutt-users's message of "Sat, 6 Jun 2026 14:27:10 -0500") References: Message-ID: <875x3uxy2t.fsf@mail.gmail.com> Ranjan Maitra via Mutt-users writes: > I use notmuch (not very effectively) with mutt. > > So, I use F8 and get a bunch of results according to what I search on. > > How do I tell which folders each of these emails (in the search) came from? I ran man notmuch search inside the terminal and found this: --output=(summary|threads|messages|files|tags) files Output the filenames of all messages matching the search terms, either one per line (--format=text), separated by null characters (--format=text0), as a JSON array (--format=json), or as an S-Expression list (--format=sexp). Note that each message may have multiple filenames associated with it. All of them are included in the output (unless limited with the --duplicate=N option). This may be particularly confusing for folder: or path: searches in a specified directory, as the messages may have duplicates in other directories that are included in the output, although these files alone would not match the search. E.g., notmuch search --output=files tag:sent If you find a message you are interested in, you could do notmuch search id: per https://notmuchmail.org/searching/