Howto submit data to a twiki page via email


approach

  • an email is sent to a special email address. Via some means( .forward or similar) a perl script logbuch.pl is started and receives the email as stdin.

  • the perl script connects to the twiki server and modifies a defined twiki page.

usage

=head1 NAME

    logcheck.pl - insert data into a twiki page

=head1 SYNOPSIS

    logcheck.pl < data_file


=head1 DESCRIPTION

    data_file has to be sepcially formatted. Everything upto the first
    empty line is removed. This removes the email headers if data is
    an email

    data_file is inserted at the end of the page or if the string 

    <!-- LOGBUCH INSERT MAGIC. DO NOT EDIT -->

    exists in the twiki page data_file will be added after this string

=head1 OPTIONS

    no options so far

=head1 ERRORS

    no internal error messages

=head1 DIAGNOSTICS

    Error status responses from the Twiki Server are sent to stderr

=head1 EXAMPLES

    This programm is meant to be used for automatic email processing

    Exim allows you to create a .forward file starting this programm

    # ----------------------------------------------------------------------
    # Exim filter

    if $header_subject: contains "logbuchinsertkeyword" then
      pipe /home/frank/bin/logbuch.pl
      save /home/frank/mbox.diary
    endif
    # ----------------------------------------------------------------------

    Now any email with the word logbuchinsertkeyword in the subject will be added 
    to your wiki at a configurable page $wiki_url


=head1 ENVIRONMENT

=item HOME

      Used to determine the user's home directory.  F<.logbuchrc>
      in this directory is read for configuration details, if it
      exists.




=head1 FILES

=item F<.logbuchrc>

    # ----------------------------------------------------------------------
    #
    # This configuration files has to obey Perl syntax rules
    #
    $wiki_url = 'http://localhost/twiki/bin/edit/Projects/TestLogbuch';
    $wiki_user = 'Bypasswd user';
    $wiki_passwd = 'ByPasswd password';
    $wiki_signature = "\n-- Main.FrankHartmann " . localtime() . "\n";
    #
    # ----------------------------------------------------------------------



=head1 CAVEATS

    If your $wiki_url does not exist, it will be created.  No
    authentication checking is done. Anyone beeing able to start this can
    add to your $wiki_url.

    Be careful when creating .forward files.

=head1 BUGS

    Things that are broken or just don't work quite right.

=head1 RESTRICTIONS

    Bugs you don't plan to fix.  :-)

=head1 NOTES

    Miscellaneous commentary.

=head1 SEE ALSO

    HTML::Form(3pm), LWP::UserAgent(3pm);

=head1 AUTHOR

    Frank Hartmann, frank@mattzNIXSPAMz.dyndns.org

=head1 HISTORY

    Programs derived from other sources sometimes have this,
    or you might keep a modification log here.

code

see attachment -- FrankHartmann - 24 Apr 2002

Topic attachments
I Attachment Action Size Date Who Comment
txttxt logbuch.pl.txt manage 5.9 K 16 Feb 2008 - 13:14 FrankHartmann 1.12 usable for TWiki-4.1.2, Sat, 03 Mar 2007, build 13046, Plugin API version 1.11

 
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding mattzz? Send feedback