[Xapian-tickets] [Xapian] #334: Simple .msg filter script
Xapian
nobody at xapian.org
Thu May 7 14:22:39 BST 2009
#334: Simple .msg filter script
-------------------------+--------------------------------------------------
Reporter: frankjb | Owner: olly
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: Omega | Version:
Severity: normal | Keywords:
Blockedby: | Platform: All
Blocking: |
-------------------------+--------------------------------------------------
Comment(by olly):
Thanks for the "single purpose" patch.
There's no need for an external script here, at least as things stand - we
can just inline the trivial perl code required like so:
{{{
#!cpp
string cmd = "perl -MEmail::Outlook::Message -e 'print new
Email::Outlook::Message($ARGV[0])->to_email_mine->as_string' " +
shell_protect(file) + " | strings";
}}}
If things get significantly more complex, then a separate script might be
worthwhile.
Some remaining issues:
* It would still be good to have some sample files for testing, in
particular including a few with different character sets and content-
encodings, and non-textual attachments.
* Piping the output through {{{strings}}} is going to be harmful to
anything except ASCII text, and if the issue is binary attachments, it
will generally return a lot of junk strings from them anyway. Perhaps we
need to recurse the {{{Email::MIME}}} subparts to find the text ones?
* If perl is installed, but the {{{Email::Outlook::Message}}} module
isn't, we get exit code 2, which we don't currently treat as meaning "give
up trying this filter", so we'll hammer away fruitlessly if given a lot of
{{{.msg}}} files. I'd suggest we compare the start of the command with
{{{"perl "}}} if we fail with status 2 and handle it as we do status 127.
--
Ticket URL: <http://trac.xapian.org/ticket/334#comment:6>
Xapian <http://xapian.org/>
Xapian
More information about the Xapian-tickets
mailing list