The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

mailbox2ntvml

Basic mailbox to XML converter for use with NexTrieve.

Usage

 mailbox2ntvml [-d date] [-a from subject] [-b] [-n] [-i] [-t subject] [-c name] [-o offset|filename] [-E defaulinputencoding] -f mailbox1 [mailboxN...]

Parameters

 -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.

Example

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

Example

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 -

Example

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/*

Example

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/* >

Requirements

Date::Parse

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.

AUTHOR

Elizabeth Mattijsen, <liz@dijkmat.nl>.

Please report bugs to <perlbugs@dijkmat.nl>.

SUPPORT

NexTrieve is no longer being supported.

COPYRIGHT

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.

SEE ALSO

The NexTrieve::xxx modules.