Thanks very much. I am now looking into using a Python IMAP library.
However, I think there must be a way to just dump the contents of a Mutt page, and that could be an easier short-term solution. You mentioned there being a print function. Could you provide an example of using that to print the inbox to stdout? It would have to be automatic, i.e. not requiring the user to actually open Mutt themselves and type the print command. So that leads me to the question of if this command can somehow be passed to mutt as a command line option, or if there is some bash automation tool for calling it inside Mutt anyway. The context is that I just would like to send emails and check for responses in a more precise and quick way than opening my inbox. I would like to have commands at my disposal when I am working on something to just send an email directly and later check for responses to that email, or check for all new emails from a particular sender. That info would need to come back as the output of commands, to stdout. Thanks very much, Julius On Tue, Jul 6, 2021, 00:44 Cameron Simpson <c...@cskk.id.au> wrote: > On 05Jul2021 19:19, Julius Hamilton <julkh...@gmail.com> wrote: > >I would like to retrieve the contents of my inbox - the emails' > >metadata, > >sender, subject, date - to stdout, rather than by opening an application. > >Can Mutt dump the inbox page? Does it have any way to return to stdout > >information about the inbox? Or should I use a different tool for this? > > I would use a different tool. Personally I'd write a little Python > programme to read you inbox (IMAP? Local mail folder?) and report. > > >I would also like to retrieve the body of a specific email in the same > way, > >to stdout. Do the emails have identifier tags by which they can be > >specified? Or, what would be a way to do this? > > All messages have a Message-ID: header which has a unique value per > message. Mutt's %i pattern operator matches message-ids. I suppose you > could invoke mutt from the command line this instructions to open the > message based on the message-id and "print" it, specifying the print > action as something which writes output. > > But again, if I'd already written the Python programme above (summarise > ths inbox) it would probably be easier to extend that to write out the > desired message. > > More context? There are probably already tools to do things like what > you suggest, even if they are not exact matches for what you ask for. > > Cheers, > Cameron Simpson <c...@cskk.id.au> >