Accessing the body a message programatically

David Bremner david at tethera.net
Mon Dec 16 16:34:31 PST 2019


Alan Schmitt <alan.schmitt at polytechnique.org> writes:

> Hello,
>
> I need to extract some information from a message that is shown in
> notmuch-mode, and I was able to easily get the from and subject of the
> message. I now need to use the body, but I cannot find how to get it. I
> assume I should use notmuch-get-bodypart-text, but I don't know how to
> obtain the msg or part argument.
>

If you mean interactively for a currently displayed message, have a look
at the function notmuch-show-current-part-handle, and the way it uses
notmuch-show-get-{message,part}-properties.

> In addition, can I get access to the List-Archive header? I could do it
> by spawning an external process to get the raw message, but it seems a
> bit heavy handed.

there is a couple of patches by Johan Parin currently under review
to provide a configurable set of headers. You can find them via

https://nmbug.notmuchmail.org/status/#Review


More information about the notmuch mailing list