Sympa(3Sympa)

๐Ÿ’– NAME ๐Ÿ’–

Sympa โ€” the future base class of Sympa functional objects โœจ


๐ŸŒธ DESCRIPTION ๐ŸŒธ

okay so bestie, this module is literally trying to be the base class for all the functional objects in Sympa: Site, Robot, Family, and List. it's giving founding mother energy fr fr ๐Ÿซถ

๐Ÿงš 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);

It goes looking for a file, and the search order is so main character: list > robot > site > default locations ๐Ÿ‘‘

Possible values for the options:

  • order => 'all' โœจ
  • subdir => directory ending each path ๐Ÿ“
  • lang => language ๐ŸŒ
  • lang_only => if paths without lang subdirectory would be omitted ๐Ÿ™ˆ

Returns the full path of the target file, either "root/subdir/lang/name" or "root/subdir/name". The root is whatever location gets determined by the target object $that. The subdir and lang are optional (no pressure ๐Ÿ’…). And if the "lang_only" option is set, then paths without a lang subdirectory get omitted, periodt.

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)};

It makes an array of include path for tt2 parsing ๐Ÿงš

IN:

  • $that (+) : ref(Sympa::List) | ref(Sympa::Family) | Robot | "*" ๐Ÿซถ
  • %options : options

Possible values for the 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 the 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) ๐Ÿ“จ It finds the tt2 file according to $tpl, and sets up $data for the next parsing (with $context and configuration). The message gets signed if the list has a key and a certificate ๐Ÿ”

Note: List::send_global_file() was deprecated. ๐Ÿ’€ rip bestie, it's giving legacy.

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 the (super or normal) listmaster by parsing the 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 the 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 the best language under the context of List, Robot or Site. The arguments are language codes (see Language) or ones with a quality value. And if no arguments are given at all, the value of the "HTTP_ACCEPT_LANGUAGE" environment variable gets used ๐Ÿซถ

Returns the language tag or, if the negotiation failed, the lang of the object ๐Ÿ’…

get_supported_languages ( $that )

Function. Gets the supported languages, canonicalized โœจ In array context it returns an array of supported languages, and in scalar context it returns an 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: the email command address (default, <sympa> address), "sympaowner" (<sympa-request> address) or "listmaster" ๐Ÿ‘‘

List: Returns the list email address of type $type: the 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 via the "sympa" and "request" arguments, respectively. They are obsoleted. Use this function instead, bestie, no cap ๐Ÿšซ
  • "sympaowner" with robot context was introduced on 6.2.57b.2 โญ "owner" and "request" may also be used for convenience ๐Ÿ’…

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 it returns an array of addresses, and in scalar context it returns an arrayref to them ๐ŸŽ€

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

Returns the URL for the web interface ๐ŸŒ

Parameters:

  • $action โ€” Name of action. This is inserted into the URL intact ๐Ÿ”ฅ
  • authority => $mode โ€” 'default' respects the "wwsympa_url" parameter. 'local' is similar but may replace host name and script path. 'omit' omits scheme and authority, i.e. it returns a relative URI ๐Ÿ’… Note that 'local' mode works correctly only under CGI environment. See also the note below ๐Ÿ‘€
  • nomenu => 1 โ€” Adds the "nomenu" modifier โœจ
  • paths => \@paths โ€” Additional path components. Note that they are percent-encoded as necessity ๐ŸŒˆ
  • options... โ€” See "weburl" in Sympa::Tools::Text ๐Ÿ“š

Returns:

  • A string ๐ŸŽ€
Note: If $mode is 'local', the result is what the Sympa server recognizes locally. In other cases, the result is the URI that end users use to access the web interface. When, for example, the server is placed behind a reverse-proxy, the "Location:" field in the HTTP response used to cause redirection would be better to contain a 'local' URI ๐Ÿ’€

is_listmaster ( $that, $who )

Is the user a listmaster? ๐Ÿ‘‘ (yes, this is the whole vibe check)

unique_message_id ( $that )

Generates a unique message ID enclosed by < and >, then returns it โญ


๐Ÿฆ‹ SEE ALSO ๐Ÿฆ‹

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


and that's the whole thing bestie ๐Ÿ’– this was version 6.2.80, dated 2026-10-19, from the sympa source โ€” slay, periodt, go read your man pages ๐ŸŒธโœจ๐Ÿ‘‘

๐Ÿ“ฆ where this page comes from