sympa  6.2.42
About: Sympa is an electronic mailing list manager.
  Fossies Dox: sympa-6.2.42.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

Sympa Class Reference

Private Member Functions

public method search_fullpath ()
 
public method get_search_path ()
 
private method _get_search_path ()
 
public method send_dsn ()
 
public method send_file ()
 
public method send_notify_to_listmaster ()
 
public method send_notify_to_user ()
 
public method best_language ()
 
public method get_supported_languages ()
 
public method get_address ()
 
public method get_listmasters_email ()
 
public method get_url ()
 
public method is_listmaster ()
 
public method unique_message_id ()
 

Static Private Attributes

static scalar log
 
static hash diag_messages
 

Detailed Description

NAME

Sympa - Future base class of Sympa functional objects

DESCRIPTION

This module aims to be the base class for functional objects of Sympa: Site, Robot, Family and List.

Functions

Finding config files and templates

  • search_fullpath ( $that, $name, [ opt => val, ...] )

        # To get file name for global site
        $file = Sympa::search_fullpath('*', $name);
        # To get file name for a robot
        $file = Sympa::search_fullpath($robot_id, $name);
        # To get file name for a family
        $file = Sympa::search_fullpath($family, $name);
        # To get file name for a list
        $file = Sympa::search_fullpath($list, $name);

    Look for a file in the list > robot > site > default locations.

    Possible values for options: order => 'all' subdir => directory ending each path lang => language lang_only => if paths without lang subdirectory would be omitted

    Returns full path of target file

    <i>root</i>/<i>subdir</i>/<i>lang</i>/<i>name</i>

    or

    <i>root</i>/<i>subdir</i>/<i>name</i>

    root is the location determined by target object $that. subdir and lang are optional. If

    lang_only

    option is set, paths without lang subdirectory is omitted.

  • get_search_path ( $that, [ opt => val, ... ] )

        # To make include path for global site
        @path = @{Sympa::get_search_path('*')};
        # To make include path for a robot
        @path = @{Sympa::get_search_path($robot_id)};
        # To make include path for a family
        @path = @{Sympa::get_search_path($family)};
        # To make include path for a list
        @path = @{Sympa::get_search_path($list)};

    make an array of include path for tt2 parsing

    IN : -$that(+) : ref(Sympa::List) | ref(Sympa::Family) | Robot | "*" -%options : options

    Possible values for options: subdir => directory ending each path lang => language lang_only => if paths without lang subdirectory would be omitted

    OUT : ref(ARRAY) of tt2 include path

Sending Notifications

  • send_dsn ( $that, $message, [ { key => val, ... }, [ $status, [ $diag ] ] ] )

        # To send site-wide DSN
        Sympa::send_dsn('*', $message, {'recipient' => $rcpt},
            '5.1.2', 'Unknown robot');
        # To send DSN related to a robot
        Sympa::send_dsn($robot, $message, {'listname' => $name},
            '5.1.1', 'Unknown list');
        # To send DSN specific to a list
        Sympa::send_dsn($list, $message, {}, '2.1.5', 'Success');

    Sends a delivery status notification (DSN) to SENDER by parsing delivery_status_notification.tt2 template.

  • send_file ( $that, $tpl, $who, [ $context, [ options... ] ] )

        # To send site-global (not relative to a list or a robot)
        # message
        Sympa::send_file('*', $template, $who, ...);
        # To send global (not relative to a list, but relative to a
        # robot) message
        Sympa::send_file($robot, $template, $who, ...);
        # To send message relative to a list
        Sympa::send_file($list, $template, $who, ...);

    Send a message to user(s). Find the tt2 file according to $tpl, set up $data for the next parsing (with $context and configuration) Message is signed if the list has a key and a certificate

    Note: List::send_global_file() was deprecated.

  • send_notify_to_listmaster ( $that, $operation, $data )

        # To send notify to super listmaster(s)
        Sympa::send_notify_to_listmaster('*', 'css_updated', ...);
        # To send notify to normal (per-robot) listmaster(s)
        Sympa::send_notify_to_listmaster($robot, 'web_tt2_error', ...);
        # To send notify to normal listmaster(s) of robot the list belongs to.
        Sympa::send_notify_to_listmaster($list, 'request_list_creation', ...);

    Sends a notice to (super or normal) listmaster by parsing listmaster_notification.tt2 template.

    Parameters:

    • $self

      Sympa::List, Robot or Site.

    • $operation

      Notification type.

    • $param

      Hashref or arrayref. Values for template parsing.

    Returns:

    1

    or

    undef

    .

  • send_notify_to_user ( $that, $operation, $user, $param )

    Send a notice to a user (sender, subscriber or another user) by parsing user_notification.tt2 template.

    Parameters:

    • $that

      Sympa::List, Robot or Site.

    • $operation

      Notification type.

    • $user

      E-mail of notified user.

    • $param

      Hashref or arrayref. Values for template parsing.

    Returns:

    1

    or

    undef

    .

Internationalization

  • best_language ( LANG, ... )

        # To get site-wide best language.
        $lang = Sympa::best_language('*', 'de', 'en-US;q=0.9');
        # To get robot-wide best language.
        $lang = Sympa::best_language($robot, 'de', 'en-US;q=0.9');
        # To get list-specific best language.
        $lang = Sympa::best_language($list, 'de', 'en-US;q=0.9');

    Chooses best language under the context of List, Robot or Site. Arguments are language codes (see Language) or ones with quality value. If no arguments are given, the value of

    HTTP_ACCEPT_LANGUAGE

    environment variable will be used.

    Returns language tag or, if negotiation failed, lang of object.

  • get_supported_languages ( $that )

    Function. Gets supported languages, canonicalized. In array context, returns array of supported languages. In scalar context, returns arrayref to them.

Addresses and users

These are accessors derived from configuration parameters.

  • get_address ( $that, [ $type ] )

        # Get address bound for super listmaster(s).
        Sympa::get_address('*', 'listmaster');     # <listmaster@DEFAULT_HOST>
        # Get address for command robot and robot listmaster(s).
        Sympa::get_address($robot, 'sympa');       # <sympa@HOST>
        Sympa::get_address($robot, 'listmaster');  # <listmaster@HOST>
        # Get address for command robot and robot listmaster(s).
        Sympa::get_address($family, 'sympa');      # <sympa@HOST>
        Sympa::get_address($family, 'listmaster'); # listmaster@HOST>
        # Get address bound for the list and its owner(s) etc.
        Sympa::get_address($list);                 # <NAME@HOST>
        Sympa::get_address($list, 'owner');        # <NAME-request@HOST>
        Sympa::get_address($list, 'editor');       # <NAME-editor@HOST>
        Sympa::get_address($list, 'return_path');  # <NAME-owner@HOST>

    Site or robot: Returns the site or robot email address of type $type: email command address (default, <sympa> address), "owner" (<sympa-request> address) or "listmaster".

    List: Returns the list email address of type $type: posting address (default), "owner" (<LIST-request> address), "editor", non-VERP "return_path" (<LIST-owner> address), "subscribe" or "unsubscribe".

    Note: %Conf::Conf or Conf::get_robot_conf() may return <sympa> and <sympa-request> addresses by "sympa" and "request" arguments, respectively. They are obsoleted. Use this function instead.

  • get_listmasters_email ( $that )

        # To get addresses of super-listmasters.
        @addrs = Sympa::get_listmasters_email('*');
        # To get addresses of normal listmasters of a robot.
        @addrs = Sympa::get_listmasters_email($robot);
        # To get addresses of normal listmasters of the robot of a family.
        @addrs = Sympa::get_listmasters_email($family);
        # To get addresses of normal listmasters of the robot of a list.
        @addrs = Sympa::get_listmasters_email($list);

    Gets valid email addresses of listmasters. In array context, returns array of addresses. In scalar context, returns arrayref to them.

  • get_url ( $that, $action, [ nomenu => 1 ], [ paths => \@paths ], [ authority => $mode ], [ options... ] )

    Returns URL for web interface.

    Parameters:

    • $action

      Name of action. This is inserted into URL intact.

    • authority => $mode

      'default'

      respects

      wwsympa_url

      parameter.

      'local'

      is similar but may replace host name and script path.

      'omit'

      omits scheme and authority, i.e. returns relative URI.

      Note that

      'local'

      mode works correctly only under CGI environment. See also a note below.

    • nomenu => 1

      Adds

      nomenu

      modifier.

    • paths => \@paths

      Additional path components. Note that they are percent-encoded as necessity.

    • options...

      See Sympa::Tools::Text/"weburl".

    Returns:

    A string.

    Note: If $mode is

    'local'

    , result is that Sympa server recognizes locally. In other cases, result is the URI that is used by end users to access to web interface. When, for example, the server is placed behind a reverse-proxy,

    Location:

    field in HTTP response to cause redirection would be better to contain

    'local'

    URI.

  • is_listmaster ( $that, $who )

    Is the user listmaster?

  • unique_message_id ( $that )

    TBD

SEE ALSO

Sympa::Site (not yet available), Sympa::Robot (not yet available), Sympa::Family, Sympa::List.

Definition at line 341 of file Sympa.pm.

Member Function Documentation

◆ _get_search_path()

private method Sympa::_get_search_path ( )
private

Undocumented Method

Code:
click to view

◆ best_language()

public method Sympa::best_language ( )
private

Undocumented Method

Code:
click to view

◆ get_address()

public method Sympa::get_address ( )
private

Undocumented Method

Code:
click to view

◆ get_listmasters_email()

public method Sympa::get_listmasters_email ( )
private

Undocumented Method

Code:
click to view

◆ get_search_path()

public method Sympa::get_search_path ( )
private

Undocumented Method

Code:
click to view

◆ get_supported_languages()

public method Sympa::get_supported_languages ( )
private

Undocumented Method

Code:
click to view

◆ get_url()

public method Sympa::get_url ( )
private

Undocumented Method

Code:
click to view

◆ is_listmaster()

public method Sympa::is_listmaster ( )
private

Undocumented Method

Code:
click to view

◆ search_fullpath()

public method Sympa::search_fullpath ( )
private

Undocumented Method

Code:
click to view

◆ send_dsn()

public method Sympa::send_dsn ( )
private

Undocumented Method

Code:
click to view

◆ send_file()

public method Sympa::send_file ( )
private

Undocumented Method

Code:
click to view

◆ send_notify_to_listmaster()

public method Sympa::send_notify_to_listmaster ( )
private

Undocumented Method

Code:
click to view

◆ send_notify_to_user()

public method Sympa::send_notify_to_user ( )
private

Undocumented Method

Code:
click to view

◆ unique_message_id()

public method Sympa::unique_message_id ( )
private

Undocumented Method

Code:
click to view

Member Data Documentation

◆ diag_messages

hash Sympa::diag_messages
staticprivate

Definition at line 348 of file Sympa.pm.

◆ log

scalar Sympa::log
staticprivate

Definition at line 345 of file Sympa.pm.


The documentation for this class was generated from the following file:
Sympa::unique_message_id
public method unique_message_id()
Sympa::get_listmasters_email
public method get_listmasters_email()
Sympa::Tools::Text::valid_email
public method valid_email()
Sympa::send_notify_to_user
public method send_notify_to_user()
Sympa::Language::lang2oldlocale
public method lang2oldlocale()
Sympa::Ticket::create
public method create()
Sympa::send_dsn
public method send_dsn()
Sympa::get_address
public method get_address()
Sympa::Tools::Data::dup_var
public method dup_var()
Sympa::search_fullpath
public method search_fullpath()
Sympa::get_search_path
public method get_search_path()
Sympa::get_supported_languages
public method get_supported_languages()
Sympa::Language::implicated_langs
public method implicated_langs()
Sympa::Tools::Text::weburl
public method weburl()
Sympa::best_language
public method best_language()
Robot
Definition: List.pm:10937
Conf::get_robot_conf
public method get_robot_conf()
Sympa::send_file
public method send_file()
Sympa::Spindle::new
public method new()
Sympa::Language::negotiate_lang
public method negotiate_lang()
Sympa::Language
Definition: Language.pm:11
Conf::Conf
static hash Conf
Definition: Conf.pm:128
Sympa::send_notify_to_listmaster
public method send_notify_to_listmaster()
i
static int i
Definition: bouncequeue.c:37
Sympa::Spindle::ProcessTemplate
Definition: ProcessTemplate.pm:85
Sympa::get_url
public method get_url()
Sympa::Tools::Text::canonic_email
public method canonic_email()
Sympa::is_listmaster
public method is_listmaster()
Sympa::_get_search_path
private method _get_search_path()
Sympa::Language::push_lang
public method push_lang()