Open romanofski opened 3 years ago
Yeah. I'd like proper parsing of the mailcap format (https://datatracker.ietf.org/doc/html/rfc1524), and associated functions for preparing the subprocess given mailcap entry and body/part content.
Possibly belongs in a separate library but we can extract later if it seems useful.
I've actually changed the type to a function (see https://github.com/purebred-mua/purebred/compare/feat/430/mailcaphandler-can-work-with-positional-arguments) which gets me what I want. However I agree, that better support for the mailcap file is the better approach, so we don't have to add this manually. Shall I put this into a separate feature request?
I'm giving a mailcap parser a shot. Named the package purebred-mailcap
for obvious reasons...
@romanofski you should be able to reuse a bunch of the low-level parsers from purebred-email. Identify the useful subset and then we'll see if it makes sense to extract another package (purebred-parsing or whatever).
@frasertweedale yeah I'm already using it as a reference. Thanks for the pointer!
Is your feature request related to a problem? Please describe. The current
MailcapHandler
we use doesn't support positional arguments. For examplepdftotext
has the following synopsis:pdftotext [options] [PDF-file [text-file]]
. I'd need something to represent our input file, which currently was just appended. However the last argument here needs to be thetext-file
which is typicallystdout
, so the typical template becomes:pdftotext %s -
.Describe the solution you'd like Haven't thought about it yet.
Describe alternatives you've considered None
Additional context I'd be keen to use
pdftotext
so I can view attached PDFs.