View Single Post
  #4   Report Post  
Posted to uk.d-i-y
Tim Watts[_5_] Tim Watts[_5_] is offline
external usenet poster
 
Posts: 355
Default Pull text from Gmail

On 18/02/2019 20:17, Caecilius wrote:
On Mon, 18 Feb 2019 19:50:39 +0000, Bill wrote:

I have a bunch of Gmail emails from a certain person and would like to
import all the text into one text file, sorted in date order. The idea
is to get something that I can edit to pull together a mass of technical
information in a way that I can quickly consult it.

At the moment the useful material is mixed in with chat about the
weather etc.

All I've found so far is a Gmail add-on to convert individual messages
to pdf, but nothing that can just grab a lot of emails and pull the text
out of all. It seems there used to be a Google labs app that pulled the
essential text, without headers etc. to a file, but I can't even find
that.

Anyone know of a way to do this?


I think you can download email from gmail using the POP3 protocol.

You could use a POP3 client like fetchmail to download the email and
send it to a an MTA for delivery to a local mailbox. You could then
parse the local mailbox with the tool of your choice, or write a
script to do it.


Not sure about POP3 but IMAP4 is supported for sure - and same range of
solutions apply

You could probably use Thunderbird, then bulk select and copy to a
Thunderbird local (to PC) folder, then you'd have an mbox style file.

Beware though - having just implemented an email parser, it can be
nightmarish as even the "text" bit can be buried 1-2 levels deep in
nested MIME!

--
Email does not work