---
name: "sympa_scenario"
section: "5"
platform: "linux"
package: "sympa"
version: "6.2.76~dfsg-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/sympa_scenario"
---

# sympa\_scenario(5)

Authorization scenario

## NAME

sympa\_scenario - Authorization scenario

## SYNOPSIS

An example *del.auth* file:

```
  title    deletion performed only by list owners, need authentication
  title.es eliminacin reservada slo para el propietario, necesita autentificacin

  is_owner([listname],[sender])  smtp       -> request_auth
  is_listmaster([sender])        smtp       -> request_auth
  true()                         md5,smime  -> do_it
```

## DESCRIPTION

### File format

Basically, a scenario file is composed of titles on the first lines and a set of rules on the following lines.

Rules consist of one or more line in the form:

```
  condition authentication_methods -> action
```

Some terms of conditions may take one or more arguments. The arguments are variables or literals (see "Terms of conditions", "Variables").

Authentication methods is a comma-separated list of one or more methods (see "Authentication methods").

Some actions may have optional modifiers (see "Actions").

*Terms of conditions*

- "true" "(" ")"

  Always returns true.

- "equal" "(" *var1*"," *var2* ")"

  Tests if two arguments are equal.

- "is\_subscriber" "(" *listname*"," *var* ")"

  - "is\_owner" "(" *listname*"," *var* ")"

  - "is\_editor" "(" *listname*"," *var* ")"

  Tests if *var* is the subscriber, owner or editor of the list *listname*. *listname* is the variable `"[listname]"` or list address, "*name*" or "*name*`"@"`*domain*".

- "is\_listmaster" "(" *var* ")"

  Tests if *var* is the listmaster.

- "less\_than" "(" *var1*"," *var2* ")"

  Tests if *var1* is less than *var2*.

- "match" "(" *var*"," "/"*perl\_regexp*"/" ")"

  Tests if *var* matches with *perl\_regexp*.

  *perl\_regexp* is a perl regular expression. Don't forget to escape special characters (`"^"`, `"$"`, `"{"`, `"("`, ...): Check [**perlre**(1)](/perlre/1.md) for regular expression syntax. It can contain the string `"[domain]"` (interpreted at run time as the list or robot domain).

  Note: Sympa prior to 6.2.32 recognized `"[host]"` instead of `"[domain]"`.

- "newer" "(" *date*"," *date* ")"

  Returns true if first date is posterior to the second

- "older" "(" *date*"," *date* ")"

  Returns true if first date is anterior to the second date

  *date* is Unix time or the string "*n*`"y"`*n*`"m"`*n*`"d"`*n*`"h"`*n*`"min"`*n*`"sec"`", where each *n* is a number.

- "search" "(" *named\_filter\_file*"," *var*")"

  Tests if *var* is found by named filter.

  *named\_filter\_file* is a file name ending with `".ldap"`, `".sql"` or `".txt"`.

- "verify\_netmask" "(" *network\_block* ")"

  Tests if `"REMOTE_ADDR"` CGI environment variable matches with *network\_block*.

  This allows the user to configure their local network to only be accessible to those that are members of it.

- "CustomCondition::"*package\_name* "(" *arguments*, ... ")"

  Evaluates custom condition. *package\_name* is the name of a Perl package in *$SYSCONFDIR/custom\_conditions/* (lowercase).

*Variables*

- "\[custom\_vars-\>"*custom\_var\_name*"\]"

  Allows you to introduce custom parameters in your scenario. *custom\_var\_name* is the name of the custom parameter you want to use.

- "\[date\]"

  Date of reception of the message.

- "\[domain\]"

  Mail domain of current list.

  Note: This variable was introduced by Sympa 6.2.32. Previous versions used a variable `"[conf->host]"` (obsoleted) instead.

- "\[env-\>"*env\_var*"\]"

  *env\_var* is the name of CGI environment variable (note that it is case-sensitive).

- "\[is\_bcc\]"

  Set to 1 if the list is neither in To: nor Cc: field.

- "\[listname\]"

  Name of current list.

- "\[msg\_encrypted\]"

  Set to "`"smime"`" if the message was S/MIME encrypted.

- "\[msg\_header-\>"*field\_name*"\]"

  - "\[msg\_header-\>"*field\_name*"\]\["*index*"\]"

  Value of message header field, available only when evaluating the authorization scenario for sending messages. It can be used, for example, to require editor validation for multipart messages. Optional *index* may be integer (may be less than `0`) to choose particular entry from multiple fields.

- "\[msg\_part-\>type\]"

  - "\[msg\_part-\>body\]"

  The MIME content types and bodies; the body is available for MIME parts in text/xxx format only.

- "\[previous\_email\]"

  Old email when changing subscription email in preference page.

- "\[sender\]"

  The email address of the current user (used on web or mail interface). Default value is "nobody".

- "\[topic\]"

  Topic of the message. This variable has a value if any of the following `"[topic_*]"` variables has a value.

- "\[topic\_auto\]"

  Topic of the message if it has been automatically tagged.

- "\[topic\_editor\]"

  Topic of the message if it has been tagged by editor.

- "\[topic\_needed\]"

  The message has not got any topic and message topic are required for the list.

- "\[topic\_sender\]"

  Topic of the message if it has been tagged by sender.

- "\[user\_attributes-\>"*user\_attributes\_key\_word*"\]"

  *user\_attributes\_key\_word* is one of the names of user attributes provided by the SSO system via environment variables. Available only if user authenticated with a `"generic_sso"`.

*Authentication methods*

The e-mail of authenticated user is given by `"[sender]"` variable. If it is not given, '`"nobody"`' will be set.

- "smtp"

  Default method. No actual authentication, and if any, sender of the message is used.

- "md5"

  Authenticated by web authentication (password), or by authentication key in e-mail message.

- "smime"

  Authenticated by S/MIME signature, or TLS client certificate.

Note: The `"dkim"` authentication method for scenarios was obsoleted on Sympa 6.2.71b.1.  Now it is a synonym of `"smtp"` method.

*Actions*

An action consists of an action name and optional modifiers.

Action names:

- "do\_it"

  Allows operation.

- "editor"

  The message will be forwarded to list editor.

- "editorkey"

  The message will be held for moderation by list editor.

- "listmaster"

  Same as `"do_it"` but makes newly created list be pending.

- "owner"

  The operation is held and waits for approval by list owner.

- "reject"

  Denies operation.

- "request\_auth"

  The operation is held and waits for confirmation by the user.

Modifiers:

- "(\[email\])"

  Only for `"request_auth"` action. Sends authentication request to the target user of operation (given as the value of "`"[email]"`" variable) instead of original sender.

  Note that `"[email]"` is a literal and no other variable names can't be used.

- "," "notify"

  Only for `"do_it"` and `"listmaster"` actions. Sends a notification to list owner.

- "," "quiet"

  Sends no notification to the message sender.

- "(reason='"*reason\_key*"')"

  Only for `"reject"` action. Matches a key in *mail\_tt2/authorization\_reject.tt2* template corresponding to an information message about the reason of the reject of the user. *reason\_key* have to be a static string enclosed by `'...'`.

- "(tt2='"*tpl\_name*"')"

  Only for `"reject"` action. Corresponding template (*tpl\_name*`".tt2"`) is sent to the sender. *tpl\_name* have to be a static string enclosed by `'...'`.

### Formal syntax

\# Below is the formal syntax definition by modified BNF.

rule : condition spaces auth\_list "-\>" action

\# Condition

condition : "!" condition  \
     \| "true" "(" ")"  \
     \| "equal" "(" var "," var ")"  \
     \| "is\_editor" "(" listname "," var ")"  \
     \| "is\_listmaster" "(" var ")"  \
     \| "is\_owner" "(" listname "," var ")"  \
     \| "is\_subscriber" "(" listname "," var ")"  \
     \| "less\_than" "(" var "," var ")"  \
     \| "match" "(" var "," "/" perl\_regexp "/" ")"  \
     \| "newer" "(" date "," date ")"  \
     \| "older" "(" date "," date ")"  \
     \| "search" "(" named\_filter\_file ")"  \
     \| "verify\_netmask" "(" network\_block ")"  \
     \| "CustomCondition::" package\_name "(" var\* ")"

var : "\[email\]"  \
     \| "\[conf-\>" conf\_key\_word "\]"  \
     \| "\[current\_date\]"  \
     \| "\[custom\_vars-\>" custom\_var\_name "\]"  \
     \| "\[env-\>" env\_var "\]"  \
     \| "\[is\_bcc\]"  \
     \| "\[list-\>" list\_key\_word "\]"  \
     \| "\[msg\_body\]"  \
     \| "\[msg\_encrypted\]"  \
     \| "\[msg\_header-\>" field\_name "\]" "\[" index "\]"  \
     \| "\[msg\_header-\>" field\_name "\]"  \
     \| "\[msg\_part-\>type\]"  \
     \| "\[msg\_part-\>body\]"  \
     \| "\[previous\_email\]"  \
     \| "\[sender\]"  \
     \| "\[subscriber-\>" subscriber\_key\_word "\]"  \
     \| "\[topic\]"  \
     \| "\[topic\_auto\]"  \
     \| "\[topic\_editor\]"  \
     \| "\[topic\_needed\]"  \
     \| "\[topic\_sender\]"  \
     \| "\[user-\>" user\_key\_word "\]"  \
     \| "\[user\_attributes-\>" user\_attributes\_keyword "\]"  \
     \| string

listname : "\[listname\]"  \
     \| listname\_string  \
     \| listname\_string "@" domain\_string

date : "\[date\]"  \
     \| date\_expr\
     \| integer

user\_key\_word : "email"\
     \| "gecos"  \
     \| "lang"  \
     \| "password"  \
     \| "cookie\_delay\_user"  \
     \| additional\_user\_fields

subscriber\_key\_word : "email"  \
     \| "date"  \
     \| "bounce"  \
     \| "gecos"  \
     \| "reception"  \
     \| "update\_date"  \
     \| "visibility"  \
     \| additional\_subscriber\_fields

list\_key\_word : "name"  \
     \| "address"  \
     \| "domain"  \
     \| "lang"  \
     \| "max\_size"  \
     \| "priority"  \
     \| "reply\_to"  \
     \| "status"  \
     \| "subject"  \
     \| "total"  \
     \| "account"

conf\_key\_word : "domain"  \
     \| "default\_list\_priority"  \
     \| "email"  \
     \| "lang"  \
     \| "listmaster"  \
     \| "max\_size"  \
     \| "request\_priority"  \
     \| "sympa\_priority"

\# Authentication methods

auth\_list : auth "," auth\_list  \
     \| auth  \
     \| ""

auth : "smtp"  \
     \| "dkim"  \
     \| "md5"  \
     \| "smime"

\# Actions

action : "do\_it" ( "," "quiet" \| "," "notify" )\*  \
     \| "editor" \[ "," "quiet" \]  \
     \| "editorkey" \[ "," "quiet" \]  \
     \| "listmaster" \[ "," "notify" \]  \
     \| "owner" \[ "," "quiet" \]  \
     \| "reject" (  \
           "(" "reason=" reason\_key ")"  \
         \| "(" "tt2=" tpl\_name ")"  \
         \| "," "quiet"  \
       )\*  \
     \| "reject(tt2=" tpl\_name ")" \[ "," "quiet" \]  \
     \| "request\_auth" \[ "(\[email\])" \]

## FILES

- $EXPLDIR"/"*list path*"/scenari"

  - $SYSCONFDIR"/"*virtual host*"/scenari"

  - $SYSCONFDIR"/scenari"

  - $DEFAULTDIR"/scenari"

  Path of scenario files: List, robot and site levels, and distribution defaults.

## SEE ALSO

Sympa::Scenario.

## HISTORY

Original contents of this document were partially taken from a chapter "Authorization scenarios" in *Sympa, Mailing List Management Software - Reference manual*.
