Basic mailbox to XML converter for use with NexTrieve.
mailbox2ntvml [-d date] [-a from subject] [-b] [-n] [-i] [-t subject] [-c name] [-o offset|filename] [-E defaulinputencoding] -f mailbox1 [mailboxN...]
-d following parameters should be considered as date attributes -a following parameters should be considered as standard attributes -t following parameters should be considered as text-types -f following parameters should be considered mailbox filenames -c use same conceptual mailbox name for all files specified -o initial offset or filename to be added to all offset values (if using -c) -E specify encoding to assume if no encoding is found (default: "iso-8859-1") -n do not output <?xml..?> processor instruction -b do not output <ntv:docseq> container (bare XML) -i perform binary check on parts, ignore if considered binary
Mailbox filenames can also be specified on seperate lines on STDIN.
Convert content of file "mailbox" to xml and store that in the file "xml". Check each message for From:, Date: and Subject: headers and create a container "document" for each message. Convert Date: to a datestamp value (YYYYMMDD), convert From:, To: and Subject: headers into attributes and Subject: header into a text type.
mailbox2ntvml -f mailbox >xml
Convert content of file "mailbox" to xml and store that in the file "xml". Check each message for Date:, Subject: and User-Agent: headers and create a container "document" for each message. Convert Date: to a datestamp value (YYYYMMDD), convert From: and User-Agent: headers into attributes and the Subject: header into a text type. Then add the "docseq" container around it and have that indexed by NexTrieve.
mailbox2ntvml -d date -a user-agent -t subject -f mailbox | docseq | ntvindex -
Convert all the files in the "mailboxes" directory to XML with the standard attributes and text-types and have that indexed by NexTrieve.
ls mailboxes/* | mailbox2ntvml -c allmessages | docseq | ntvindex - cat mailboxes/* >>allmessages rm mailboxes/*
Convert all messagefiles from an "incoming" directory into a virtual mailbox called "allmessages", index these with NexTrieve and add all the messages to the virtual mailbox.
ls incoming/* | mailbox2ntvml -c allmessages | docseq | ntvindex - cat incoming/* >
Requires the availability of the Date::Parse module, available from your nearest CPAN site (http://www.cpan.org), if you want the special date handling to be applied. Gracefully declines doing any special date handling if the Date::Parse module is not available.
Elizabeth Mattijsen, <liz@dijkmat.nl>.
Please report bugs to <perlbugs@dijkmat.nl>.
NexTrieve is no longer being supported.
Copyright (c) 1995-2003 Elizabeth Mattijsen <liz@dijkmat.nl>. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The NexTrieve::xxx modules.
To install NexTrieve, copy and paste the appropriate command in to your terminal.
cpanm
cpanm NexTrieve
CPAN shell
perl -MCPAN -e shell install NexTrieve
For more information on module installation, please visit the detailed CPAN module installation guide.