Sympa::Scenario.3Sympa - Man Page

Authorization scenarios


  use Sympa::Scenario;
  my $scenario = Sympa::Scenario->new($list, 'send', name => 'private');
  my $result = $scenario->authz('md5', {sender => $sender});


Sympa::Scenario provides feature of scenarios which perform authorization on functions of Sympa software against users and clients.


new ( $that, $function, [ name => $name ], [ dont_reload_scenario => 1 ] )

Constructor. Creates a new Sympa::Scenario instance.



Context of scenario, list or domain (note that scenario does not have site context).


Specifies scenario function.

name => $name

Specifies scenario name. If the name was not given, it is taken from list/domain configuration. See "Scenarios" for details.

dont_reload_scenario => 1

If set, won't check if scenario files were updated.


A new Sympa::Scenario instance.

authz ( $auth_method, \%context,  [ debug => 1] )

Instance method. Return the action to perform for 1 sender using 1 auth method to perform 1 function.



'smtp', 'md5', 'pgp', 'smime' or 'dkim'.

Note: pgp has not been implemented.

Note: dkim was deprecated on Sympa 6.2.71b. Now it is the synonym of smtp.


A hashref containing information to evaluate scenario (scenario context).

debug => 1

Adds keys in the returned hashref.


A hashref containing following items.


'do_it', 'reject', 'request_auth', 'owner', 'editor', 'editorkey' or 'listmaster'.


Defined if {action} is 'reject' and in case reject(reason='...'): Key for template authorization_reject.tt2.


Defined if {action} is 'reject' and in case reject(tt2='...') or reject('...tt2'): Mail template name to be sent back to request sender.


The checked condition (defined if debug is set).


The checked auth_method (defined if debug is set).

get_current_title ( )

Instance method. Gets the title of the scenarioin the current language context.

is_purely_closed ( )

Instance method. Returns true value if the scenario obviously returns "reject" action.

to_string ( )

Instance method. Returns source text of the scenario.


compile ( $that, $data, [ function => $function ], [ file_path => $path ] )

Function. Compiles scenario source and returns results.



Context.  Sympa::List instance or Robot.


Source text of scenario.

function => $function

Name of function.  Optional.

file_path => $path

Path of scenario file.  Optional.


Hashref with following items, or undef on failure.


Compiled scenario represented by Perl code.


Compiled coderef.


Source text of the scenario.


Hashref representing titles of the scenario.


Arrayref to texts of rules.


True if the scenario is purely closed.


Keep track of the current time if file_path is given. This is used later to reload scenario files when they changed on disk.

get_scenarios ( $that, $function )

Function. Gets all scenarios beloging to context $that and function $function.

request_action ( $that, $function, $auth_method, \%context, [ name => $name ], [ dont_reload_scenario => 1 ], [ debug => 1] )

Function. Obsoleted on Sympa 6.2.42. Use authz() method instead.


Instance of Sympa::Scenario has these attributes:


Context given by new().


Name of function.


Scenario name.


Full path of scenario file.


A scenario file is named as, where function is one of predefined function names, and name distinguishes policy.

If new() is called without name option, it is taken from configuration parameter of context. Some functions don't have corresponding configuration parameter and name options for them are mandatory.

See Also



authz() method obsoleting request_action() function was introduced on Sympa 6.2.41b. compile() function was added on Sympa 6.2.49b.


2023-07-22 sympa 6.2.72