GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  SYMPA::MESSAGE::PLUGIN (3)

.ds Aq ’

NAME

Sympa::Message::Plugin - process hooks

CONTENTS

SYNOPSIS



    Sympa::Message::Plugin::execute(post_archive, $message);



DESCRIPTION

Sympa::Message::Plugin provides hook mechanism to intervene in processing by Sympa. Each hook may modify objects (messages and so on) or may break ordinary processing.

Notice: Hook mechanism is expreimental. Module names and interfaces may be changed in the future.

    Methods

execute ( HOOK_NAME, MESSAGE, [ KEY => VAL, ... ] ) Process message hook.

    Hooks

Currently, following hooks are supported:
pre_distribute Message hook. Message had been approved distribution (by scenario or by moderator), however, it has not been decorated (adding custom subject etc.) nor archived yet.
post_archive Message hook. Message had been archived, however, it has not been distributed to users including digest spool; message has not been signed nor encrypted (if nessessary).

    How to add a hook to your Sympa

First, write your hook module:



  package My::Hook;

  use constant gettext_id => My message hook;
 
  sub post_archive {
      my $module  = shift;    # module name: "My::Hook"
      my $name    = shift;    # handler name: "post_archive"
      my $message = shift;    # Message object
      my %options = @_;
 
      # Processing, possiblly changing $message...
 
      # Return suitable result.
      # If unrecoverable error occurred, you may return undef or simply die.
      return 1;
  }
 
  1;



Then activate hook handler in your list config:



  message_hook
    post_archive My::Hook



SEE ALSO

Sympa::Message::Plugin::FixEncoding - An example module for message hook.

HISTORY

Sympa::Message::Plugin appeared on Sympa 6.2. It was initially written by IKEDA Soji <ikeda@conversion.co.jp>.
Search for    or go to Top of page |  Section 3 |  Main Index


6.2.14 SYMPA::MESSAGE::PLUGIN (3Sympa) 2016-02-23

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.