From 335c701b6770a7487a5623c8cf3852227b559246 Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Wed, 4 Jun 2003 14:56:22 +0000 Subject: [PATCH] Initial revision SVN revision: 553 --- doc/ChangeLog | 3 +- doc/adminguide.html | 1 + doc/contrib.html | 54 ++++++++++++++++++ doc/dl-menu.html | 1 + doc/doelog.txt | 133 ++++++++++++++++++++++++++++++++++++++++++++ doc/faq.html | 1 + doc/index.html | 1 + doc/userguide.html | 1 + doc/wishlist.html | 1 + 9 files changed, 195 insertions(+), 1 deletion(-) create mode 100755 doc/contrib.html create mode 100755 doc/doelog.txt diff --git a/doc/ChangeLog b/doc/ChangeLog index 1c57c383..44f74034 100755 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,4 @@ -Version 2.3.8, released June xxth, 2003 +Version 2.3.8, released June 4th, 2003 ====================================== - remove message lock on "back" button @@ -8,6 +8,7 @@ Version 2.3.8, released June xxth, 2003 - Added "Guest selection page" option - Added possibility to reference attachment with elog:/ with the attachment number starting with 1 +- elog utility can now read text from stdin (or piped in via "|") Version 2.3.7, released May 15th, 2003 ====================================== diff --git a/doc/adminguide.html b/doc/adminguide.html index 09abaa85..8ec7ed71 100755 --- a/doc/adminguide.html +++ b/doc/adminguide.html @@ -19,6 +19,7 @@  [Administrator's Guide]   [FAQ]   [Wishlist]  + [Contributions]   [DEMO]   [Download]  diff --git a/doc/contrib.html b/doc/contrib.html new file mode 100755 index 00000000..bac5df3e --- /dev/null +++ b/doc/contrib.html @@ -0,0 +1,54 @@ + + + ELOG FAQ + + + + + + + + + +
  ELOG Wishlist  
+

+

+

+

ELOG Contributions
+
+ +Here are some "contributions" from various ELOG users. In case of questions, please contact +them directly

+ +

    + +
  • Perl program to submit an email to elog

    + +

    by Sridhar Anandakrishnan

    + +Perl program to split apart an email message and submit each of the mime attachments as an +attachment to elog. The -a command line is fixed for now as "subject=subject of the email", +so the logbook has to include that.

    + +doelog.txt +

    + +

+ +
+ + + diff --git a/doc/dl-menu.html b/doc/dl-menu.html index 456fe2e3..1a70781d 100755 --- a/doc/dl-menu.html +++ b/doc/dl-menu.html @@ -7,6 +7,7 @@  [Administrator's Guide]   [FAQ]   [Wishlist]  + [Contributions]   [DEMO]   [Download]  diff --git a/doc/doelog.txt b/doc/doelog.txt new file mode 100755 index 00000000..6191d734 --- /dev/null +++ b/doc/doelog.txt @@ -0,0 +1,133 @@ +#!/usr/bin/perl -w + +=head1 NAME + +doelog - save a mime message to elog + +=head1 SYNOPSIS + + doelog ... + + someprocess | doelog - + +=head1 DESCRIPTION + +Takes one or more files from the command line that contain MIME +messages, and explodes their contents out into /tmp. The parts +are sent to elog as attachments. + +Modified mimeexplode of the MIME::Tools in perl + + +This was written as an example of the MIME:: modules in the +MIME-parser package I wrote. It may prove useful as a quick-and-dirty +way of splitting a MIME message if you need to decode something, and +you don't have a MIME mail reader on hand. + +=head1 COMMAND LINE OPTIONS + +None yet. + +=head1 AUTHOR + +sak@essc.psu.edu + +=cut + +BEGIN { unshift @INC, ".." } # to test MIME:: stuff before installing it! + +require 5.001; + +use strict; +use vars qw($Msgno $cmd); + +use MIME::Parser; +use Getopt::Std; + +## these should be options too? +## base elog cmd +$cmd = "~/elog -h localhost -p 8080 "; + +#------------------------------------------------------------ +# dump_entity - dump an entity's file info +#------------------------------------------------------------ +sub dump_entity { + my $ent = shift; + my @parts = $ent->parts; + my $file; + + die "too many attachments\n" if ($#parts>10); + + if (@parts) { # multipart... + map { dump_entity($_) } @parts; + } + else { # single part...append to elog cmd + $file = $ent->bodyhandle->path; + $cmd .= "-f \"$file\" "; +## print $cmd, "\n"; +## print " Part: ", $ent->bodyhandle->path, +## " (", scalar($ent->head->mime_type), ")\n"; + } +} + +#------------------------------------------------------------ +# main +#------------------------------------------------------------ +sub main { + my $file; + my $entity; + my $subject; + my $logbook; + our($opt_l); + + # Sanity: + ## (-w ".") or die "cwd not writable, you naughty boy..."; + + ## check if user wants a particular logbook + ## fix to add host and port? + getopts('l:'); + if($opt_l) { $logbook=$opt_l;} else {$logbook="emails";} + $cmd .= "-l $logbook "; + + # Go through messages: + @ARGV or unshift @ARGV, "-"; + while (defined($file = shift @ARGV)) { + + + # Create a new parser object: + my $parser = new MIME::Parser; + + # Optional: set up parameters that will affect how it extracts + # documents from the input stream: + $parser->output_under("/tmp"); + + # Parse an input stream: + open FILE, $file or die "couldn't open $file"; + $entity = $parser->read(\*FILE) or + print STDERR "Couldn't parse MIME in $file; continuing...\n"; + close FILE; + + ## get the subject, assumes all logbooks have a subject + ## attribute - not necessarily true. Mine do... + chomp($subject = $entity->head->get('Subject', 0)); + $cmd .= "-a subject=\"$subject\" "; + print $cmd, "\n"; + + # Congratulations: you now have a (possibly multipart) MIME entity! + dump_entity($entity) if $entity; + ### $entity->dump_skeleton if $entity; + ### print $cmd, "\n"; + exec $cmd; + } + 1; +} + +exit (&main ? 0 : -1); +#------------------------------------------------------------ +1; + + + + + + diff --git a/doc/faq.html b/doc/faq.html index 4e48dd0e..a05adc3a 100755 --- a/doc/faq.html +++ b/doc/faq.html @@ -19,6 +19,7 @@  [Administrator's Guide]   [FAQ]   [Wishlist]  + [Contributions]   [DEMO]   [Download]  diff --git a/doc/index.html b/doc/index.html index d1478734..ede79c95 100755 --- a/doc/index.html +++ b/doc/index.html @@ -19,6 +19,7 @@  [Administrator's Guide]   [FAQ]   [Wishlist]  + [Contributions]   [DEMO]   [Download]  diff --git a/doc/userguide.html b/doc/userguide.html index 88d368fd..1d8cf89d 100755 --- a/doc/userguide.html +++ b/doc/userguide.html @@ -19,6 +19,7 @@  [Administrator's Guide]   [FAQ]   [Wishlist]  + [Contributions]   [DEMO]   [Download]  diff --git a/doc/wishlist.html b/doc/wishlist.html index 5989b27c..fdc5c6b1 100755 --- a/doc/wishlist.html +++ b/doc/wishlist.html @@ -47,6 +47,7 @@ starting at the items with the most votes. You can vote for a feature, or sugges Edit existing messages with elog utility1 Implement multi-line attributes1 Add more detailed user logging, like $user $date $logbook $ID read/edit/new/delete1 +More elaborate attribute formatting, see here1