[Users] Saving Messages Outside of Claws Mail

Dustin Miller dustbiz at gmail.com
Sat Jul 17 07:51:39 CEST 2021


On Sat, 17 Jul 2021 07:18:54 +0200
Milan Obuch <claws-mail-users at dino.sk> wrote:

> On Sat, 17 Jul 2021 10:48:07 +0600, Dustin Miller <dustbiz at gmail.com>
> wrote:
> 
> > On Thu, 15 Jul 2021 15:10:02 +0200
> > Milan Obuch <claws-mail-users at dino.sk> wrote:
> >   
> > > On Thu, 15 Jul 2021 18:37:51 +0600, Dustin Miller
> > > <dustbiz at gmail.com> wrote:
> > >     
> > > > I'm looking for an efficient way to save email messages outside
> > > > of Claws Mail that will be readable by a text editor or web
> > > > browser without a lot of extra noise (i.e. headers, HTML tags,
> > > > etc.). 
> > > 
> > > Mail headers are easy, just couple of lines at athe message file
> > > begin.
> > >     
> > DM: Thanks for your various replies, Milan. For me, when I do a
> > simple save of a message, it creates a text file that has quite a
> > bit more than a couple of lines for the various header info.
> > Usually I have to go down at least a page or so to see what I'm
> > actually interested in, the email itself.  
> 
> Well, yes. Doing 'File->Save email as...' on message I am now replying
> to creates a file 9261 bytes long, 186 lines. Extracting headers into
> separate file (manually, for now) gives 4609 bytes, 85 lines. It is
> easy, however, to decide where the boundary line is - per RFC, first
> empty line means end of headers.
> 
DM: Okay, Milan, makes sense; so it sounds like you would just need to
include a part in the script that cuts the headers you don't want and
keeps the ones you do.
> 
> > > 
> > > For HTML tags, some filter is necessary to throw them away and
> > > rewrite some tokens.
> > >     
> > DM: Makes sense, but not sure I'm ready to put the time into
> > figuring out how to do this. It is possible to save the HTML part
> > of a message as an HTML file that opens correctly in a browser, but
> > this doesn't include the basic header info that can be nice to
> > have, although I guess this could just be included in the file
> > name. If I do a simple save of a message with HTML and add '.html'
> > to the end of the file, it will open in my browser but just as
> > text, not as HTML. And with either approach, I'm still limited to
> > doing one email at a time, rather than batches.  
> 
> Naturally. You can do 'File->Save part as...' on any part of multipart
> message. For the HTML part of such a message, saved file most probably
> starts with <HTML> and ends with </HTML>. The one I test did. So maybe
> it is browser dependent? I opened this file with Opera, it was viewed
> as web page, not with <tags> et al. The same result with Luakit.
> 
DM: I wasn't clear enough in my example. In the last half of my
paragraph above, I was referring to doing 'File->Save email as...'
where the message has an HTML part and I save it with a file extension
'.html'. In this case, opening it with a text editor shows a lot of
HTML noise, but opening it with a web browser doesn't actually make use
of the HTML tags; thus, it doesn't result in a simple solution.
However, I presume that with script magic I could strip out header
lines I don't want and then either strip the HTML tags to create a
simple text file or else tweak the HTML tags to create an HTML file
that will render as HTML in a browser (including the simple header info
I am interested in).

DM: In any case, I'll first check out the Mail Archiver plugin. If that
doesn't improve on my current method, then I'll need to choose between
my current method and learning to script something that will work for
batches. I appreciate your input on these things. Dustin


More information about the Users mailing list