Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
internals:internals-list [2010/04/09 09:50]
david.verdin@cru.fr
internals:internals-list [2018/03/27 10:05] (current)
ikeda@conversion.co.jp Obsoletion
Line 1: Line 1:
-====== List.pm ======+<note warning>​ 
 +This page was obsoleted. 
 +</​note>​ 
 + 
 +====== ​× List.pm ======
  
 This module includes list processing functions. This module includes list processing functions.
Line 26: Line 30:
   * updates the list stats   * updates the list stats
   * Loads information from message topic file if exists and adds X-Sympa-Topic header   * Loads information from message topic file if exists and adds X-Sympa-Topic header
-  * hides the sender if the list is anonymoused (list config: ​anonymous_sender) and changes name of msg topic file if exists. +  * hides the sender if the list is anonymoused (list config: ​anonymous\_sender) and changes name of msg topic file if exists. 
-  * adds custom subject if necessary (list config: ​custom_subject)+  * adds custom subject if necessary (list config: ​custom\_subject)
   * archives the message   * archives the message
-  * changes the reply-to header if necessary (list config: ​reply_to_header+  * changes the reply-to header if necessary (list config: ​reply\_to\_header
-  * removes unwanted headers if present (config: ​remove_headers)) +  * removes unwanted headers if present (config: ​remove\_headers)) 
-  * adds useful headers (X-Loop,​X-Sequence,​Errors-to,​Precedence,​X-no-archive - list config: ​custom_header+  * adds useful headers (X-Loop,​X-Sequence,​Errors-to,​Precedence,​X-no-archive - list config: ​custom\_header
-  * adds RFC 2919 header field (List-Id) and RFC 2369 header fields (list config: ​rfc2369_header_fields)+  * adds RFC 2919 header field (List-Id) and RFC 2369 header fields (list config: ​rfc2369\_header\_fields)
   * stores message in digest if the list accepts digest mode (encrypted message can't be included in digest)   * stores message in digest if the list accepts digest mode (encrypted message can't be included in digest)
-  * sends the message by calling List::send_msg() (see [[internals#​list-send-msg|list-send-msg]]).+  * sends the message by calling List::send\_msg() (see [[internals#​list-send-msg|list-send-msg]]).
  
 **IN**: **IN**:
Line 41: Line 45:
   - ''​message''​ (+): ref(Message) - the message to distribute   - ''​message''​ (+): ref(Message) - the message to distribute
  
-**OUT**: result of List::send_msg() function (number of sendmail process)+**OUT**: result of List::send\_msg() function (number of sendmail process)
  
 ==== send_msg() ==== ==== send_msg() ====
  
-This function is called by List::distribute_msg() (see [[internals#​list-distribute-msg|list-distribute-msg]]) to select subscribers according to their reception mode and to the ''​Content-Type''​ header field of the message. Sending are grouped according to their reception mode:+This function is called by List::distribute\_msg() (see [[internals#​list-distribute-msg|list-distribute-msg]]) to select subscribers according to their reception mode and to the ''​Content-Type''​ header field of the message. Sending are grouped according to their reception mode:
  
-  * normal: add a footer if the message is not protected (then the message is ''​altered''​) In a message topic context, selects only one who are subscribed to the topic of the message to distribute (calls to select_subcribers_for_topic(), see [[#​list-select-subscribers-for-topic|list-select-subscribers-for-topic]]).+  * normal: add a footer if the message is not protected (then the message is ''​altered''​) In a message topic context, selects only one who are subscribed to the topic of the message to distribute (calls to select\_subcribers\_for\_topic(), see [[#​list-select-subscribers-for-topic|list-select-subscribers-for-topic]]).
   * notice   * notice
   * txt: add a footer   * txt: add a footer
Line 53: Line 57:
   * urlize: add a footer and create an urlize directory for Web access   * urlize: add a footer and create an urlize directory for Web access
  
-The message is sent by calling List::mail_message() (see [[internals#​mail-mail-message|mail-mail-message]]). If the message is ''​smime_crypted''​ and the user has not got any certificate,​ a message service is sent to him.+The message is sent by calling List::mail\_message() (see [[internals#​mail-mail-message|mail-mail-message]]). If the message is ''​smime\_crypted''​ and the user has not got any certificate,​ a message service is sent to him.
  
 **IN**: **IN**:
Line 60: Line 64:
   - ''​message''​ (+): ref(Message) - the message to distribute   - ''​message''​ (+): ref(Message) - the message to distribute
  
-**OUT**: ''​$numsmtp'':​ addition of mail::mail_message() function results ( = number of sendmail process ) undef+**OUT**: ''​$numsmtp'':​ addition of mail::mail\_message() function results ( = number of sendmail process ) undef
  
 ==== send_msg_digest() ==== ==== send_msg_digest() ====
  
-Sends a digest message to the list subscribers with reception digest, digestplain or summary: it creates the list of subscribers in various digest modes and then creates the list of messages. Finally sending to subscribers is done by calling List::send_file() function (see [[#​list-send-file|list-send-file]],​ page [[internals#​list-send-file|{{crossref.png|[*]}}]]) with mail template ''​digest'',​ ''​digestplain''​ or ''​summary''​.+Sends a digest message to the list subscribers with reception digest, digestplain or summary: it creates the list of subscribers in various digest modes and then creates the list of messages. Finally sending to subscribers is done by calling List::send\_file() function (see [[#​list-send-file|list-send-file]],​ page [[internals#​list-send-file|{{crossref.png|[*]}}]]) with mail template ''​digest'',​ ''​digestplain''​ or ''​summary''​.
  
 **IN**: **IN**:
Line 78: Line 82:
 =====  Functions for template sending ===== =====  Functions for template sending =====
  
-send_file(), send_global_file().+send\_file(), send\_global\_file().
  
 These functions are used by others to send files. These files are made from template given in parameters. These functions are used by others to send files. These files are made from template given in parameters.
Line 88: Line 92:
   * //if $who=SCALAR then//   * //if $who=SCALAR then//
     * ''​user.password''​     * ''​user.password''​
-    * //if $user key is not defined in $context then// ''​user.email''​(:​= $who), ''​user.lang''​ (:= list lang) //and if the user is in DB then// ''​user.attributes''​ (:= attributes in DB user_table) are defined +    * //if $user key is not defined in $context then// ''​user.email''​(:​= $who), ''​user.lang''​ (:= list lang) //and if the user is in DB then// ''​user.attributes''​ (:= attributes in DB user\_table) are defined 
-    * //if $who is subscriber of $self then// ''​subscriber.date subscriber.update_date''​ //and if exists then// ''​subscriber.bounce subscriber.first_bounce''​ are defined +    * //if $who is subscriber of $self then// ''​subscriber.date subscriber.update\_date''​ //and if exists then// ''​subscriber.bounce subscriber.first\_bounce''​ are defined 
-  * ''​return_path'':​ used for SMTP ''​MAIL From''​ field or ''​X-Sympa-From:''​ field+  * ''​return\_path'':​ used for SMTP ''​MAIL From''​ field or ''​X-Sympa-From:''​ field
   * ''​lang'':​ the user lang or list lang or robot lang   * ''​lang'':​ the user lang or list lang or robot lang
   * ''​fromlist'':​ ''​From:''​ field, pointed on list   * ''​fromlist'':​ ''​From:''​ field, pointed on list
   * ''​from'':​ ''​From:''​ field, pointed on list //if no defined in $context//   * ''​from'':​ ''​From:''​ field, pointed on list //if no defined in $context//
-  * ''​replyto'':​ //if openssl is is sympa.conf and the list has a key ('private_key') and a certificat ('​cert.pem'​) in its directory//+  * ''​replyto'':​ //if openssl is is sympa.conf and the list has a key ('private\_key') and a certificat ('​cert.pem'​) in its directory//
   * ''​boundary'':​ boundary for multipart message //if no contained in $context//   * ''​boundary'':​ boundary for multipart message //if no contained in $context//
-  * ''​conf.email conf.host conf.sympa conf.request conf.listmaster conf.wwsympa_url ​conf.title'':​ updated with robot config+  * ''​conf.email conf.host conf.sympa conf.request conf.listmaster conf.wwsympa\_url ​conf.title'':​ updated with robot config
   * ''​list.lang list.name list.domain list.host list.subject list.dir list.owner''​(ref(ARRAY)):​ updated with list config   * ''​list.lang list.name list.domain list.host list.subject list.dir list.owner''​(ref(ARRAY)):​ updated with list config
  
-The message is sent by calling mail::mail_file() function (see [[#​mail-mail-file|mail-mail-file]],​ page [[internals#​mail-mail-file|{{crossref.png|[*]}}]]).+The message is sent by calling mail::mail\_file() function (see [[#​mail-mail-file|mail-mail-file]],​ page [[internals#​mail-mail-file|{{crossref.png|[*]}}]]).
  
 **IN**: **IN**:
Line 117: Line 121:
   * ''​user.password user.lang''​   * ''​user.password user.lang''​
   * //if $user key is not defined in $context then// ''​user.email''​ (:= $who)   * //if $user key is not defined in $context then// ''​user.email''​ (:= $who)
-  * ''​return_path'':​ used for SMTP ''​MAIL From''​ field or ''​X-Sympa-From:''​ field+  * ''​return\_path'':​ used for SMTP ''​MAIL From''​ field or ''​X-Sympa-From:''​ field
   * ''​lang'':​ the user lang or robot lang   * ''​lang'':​ the user lang or robot lang
   * ''​from'':​ ''​From:''​ field, pointed on SYMPA //if no defined in $context//   * ''​from'':​ ''​From:''​ field, pointed on SYMPA //if no defined in $context//
   * ''​boundary'':​ boundary for multipart message //if no defined in $context//   * ''​boundary'':​ boundary for multipart message //if no defined in $context//
-  * ''​conf.email conf.host conf.sympa conf.request conf.listmaster conf.wwsympa_url ​conf.title'':​ updated with robot config+  * ''​conf.email conf.host conf.sympa conf.request conf.listmaster conf.wwsympa\_url ​conf.title'':​ updated with robot config
   * ''​conf.version'':​ Sympa version   * ''​conf.version'':​ Sympa version
-  * ''​robot_domain'':​ the robot+  * ''​robot\_domain'':​ the robot
  
-The message is sent by calling mail::mail_file() function (see [[#​mail-mail-file|mail-mail-file]],​ page [[internals#​mail-mail-file|{{crossref.png|[*]}}]]).+The message is sent by calling mail::mail\_file() function (see [[#​mail-mail-file|mail-mail-file]],​ page [[internals#​mail-mail-file|{{crossref.png|[*]}}]]).
  
 **IN**: **IN**:
Line 138: Line 142:
 =====  Functions for service messages ===== =====  Functions for service messages =====
  
-archive_send(), send_to_editor(), request_auth(), send_auth().+archive\_send(), send\_to\_editor(), request\_auth(), send\_auth().
  
 These functions are used to send services messgase, correponding to a result of a command. These functions are used to send services messgase, correponding to a result of a command.
Line 144: Line 148:
 ==== archive_send() ==== ==== archive_send() ====
  
-Sends an archive file ($file) to $who. The archive is a text file, independant from web archives. It checks if the list is archived. Sending is done by callingList::​send_file() (see [[#​list-send-file|list-send-file]],​ page [[internals#​list-send-file|{{crossref.png|[*]}}]]) with mail template ''​archive''​.+Sends an archive file ($file) to $who. The archive is a text file, independant from web archives. It checks if the list is archived. Sending is done by callingList::​send\_file() (see [[#​list-send-file|list-send-file]],​ page [[internals#​list-send-file|{{crossref.png|[*]}}]]) with mail template ''​archive''​.
  
 **IN**: **IN**:
Line 156: Line 160:
 ==== send_to_editor() ==== ==== send_to_editor() ====
  
-Sends a message to the list editor for a request concerning a message to distribute. The message awaiting for moderation is named with a key and is set in the spool queuemod. The key is a reference on the message for editor. The message for the editor is sent by calling List::send_file() (see [[#​list-send-file|list-send-file]],​ page [[internals#​list-send-file|{{crossref.png|[*]}}]]) with mail template ''​moderate''​. In msg_topic ​context, the editor is asked to tag the message.+Sends a message to the list editor for a request concerning a message to distribute. The message awaiting for moderation is named with a key and is set in the spool queuemod. The key is a reference on the message for editor. The message for the editor is sent by calling List::send\_file() (see [[#​list-send-file|list-send-file]],​ page [[internals#​list-send-file|{{crossref.png|[*]}}]]) with mail template ''​moderate''​. In msg\_topic ​context, the editor is asked to tag the message.
  
 **IN**: **IN**:
Line 168: Line 172:
 ==== request_auth() ==== ==== request_auth() ====
  
-Sends an authentification request for a requested command. The authentification request contains the command to be send next and it is authentified by a key. The message is sent to user by calling List::send_file() (see [[#​list-send-file|list-send-file]],​ page [[internals#​list-send-file|{{crossref.png|[*]}}]]) with mail template ''​request_auth''​.+Sends an authentification request for a requested command. The authentification request contains the command to be send next and it is authentified by a key. The message is sent to user by calling List::send\_file() (see [[#​list-send-file|list-send-file]],​ page [[internals#​list-send-file|{{crossref.png|[*]}}]]) with mail template ''​request\_auth''​.
  
 **IN**: **IN**:
Line 186: Line 190:
 ==== send_auth() ==== ==== send_auth() ====
  
-Sends an authentifiaction request for a message sent for distribution. The message for distribution is copied in the authqueue spool to wait for confirmation by its sender . This message is named with a key. The request is sent to user by calling List::send_file() (see [[#​list-send-file|list-send-file]],​ page [[internals#​list-send-file|{{crossref.png|[*]}}]]) with mail template ''​send_auth''​. In msg_topic ​context, the sender is asked to tag his message.+Sends an authentifiaction request for a message sent for distribution. The message for distribution is copied in the authqueue spool to wait for confirmation by its sender . This message is named with a key. The request is sent to user by calling List::send\_file() (see [[#​list-send-file|list-send-file]],​ page [[internals#​list-send-file|{{crossref.png|[*]}}]]) with mail template ''​send\_auth''​. In msg\_topic ​context, the sender is asked to tag his message.
  
 **IN**: **IN**:
Line 197: Line 201:
 =====  Functions for message notification ===== =====  Functions for message notification =====
  
-send_notify_to_listmaster(), send_notify_to_owner(), send_notify_to_editor(), send_notify_to_user().+send\_notify\_to\_listmaster(), send\_notify\_to\_owner(), send\_notify\_to\_editor(), send\_notify\_to\_user().
  
 These functions are used to notify listmaster, list owner, list editor or user about events. These functions are used to notify listmaster, list owner, list editor or user about events.
Line 203: Line 207:
 ==== send_notify_to_listmaster() ==== ==== send_notify_to_listmaster() ====
  
-Sends a notice to listmaster by parsing ''​listmaster_notification''​ template. The template makes a specified or a generic treatement according to variable $param.type (:= $operation parameter). The message is sent by calling List::send_file() (see [[#​list-send-file|list-send-file]],​ page [[internals#​list-send-file|{{crossref.png|[*]}}]]) or List::send_global_file() (see [[#​list-send-global-file|list-send-global-file]],​ page [[internals#​list-send-global-file|{{crossref.png|[*]}}]]) according to the context: global or list context. Available variables for the template are set up by this function, by $param parameter and by List::send_global_file() or List::send_file().+Sends a notice to listmaster by parsing ''​listmaster\_notification''​ template. The template makes a specified or a generic treatement according to variable $param.type (:= $operation parameter). The message is sent by calling List::send\_file() (see [[#​list-send-file|list-send-file]],​ page [[internals#​list-send-file|{{crossref.png|[*]}}]]) or List::send\_global\_file() (see [[#​list-send-global-file|list-send-global-file]],​ page [[internals#​list-send-global-file|{{crossref.png|[*]}}]]) according to the context: global or list context. Available variables for the template are set up by this function, by $param parameter and by List::send\_global\_file() or List::send\_file().
  
 **IN**: **IN**:
Line 211: Line 215:
   - ''​param''​ (+): ref(HASH) ref (ARRAY) - values for variable used in the template:   - ''​param''​ (+): ref(HASH) ref (ARRAY) - values for variable used in the template:
     * //if ref(HASH) then// variables used in the template are keys of this HASH. These following keys are required in the function, according to $operation value:     * //if ref(HASH) then// variables used in the template are keys of this HASH. These following keys are required in the function, according to $operation value:
-      * '​listname'​(+) //if $operation=('​request_list_creation' 'automatic_bounce_management')//+      * '​listname'​(+) //if $operation=('​request\_list\_creation' 'automatic\_bounce\_management')//
     * //if ref(ARRAY) then// variables used in template are named as: $param0, $param1, $param2, ...     * //if ref(ARRAY) then// variables used in template are named as: $param0, $param1, $param2, ...
  
Line 218: Line 222:
 ==== send_notify_to_owner() ==== ==== send_notify_to_owner() ====
  
-Sends a notice to list owner(s) by parsing ''​listowner_notification''​ template. The template makes a specified or a generic treatement according to variable $param.type (:= $operation parameter). The message is sent by calling List::send_file() (see [[#​list-send-file|list-send-file]],​ page [[internals#​list-send-file|{{crossref.png|[*]}}]]). Available variables for the template are set up by this function, by $param parameter and by List::send_file().+Sends a notice to list owner(s) by parsing ''​listowner\_notification''​ template. The template makes a specified or a generic treatement according to variable $param.type (:= $operation parameter). The message is sent by calling List::send\_file() (see [[#​list-send-file|list-send-file]],​ page [[internals#​list-send-file|{{crossref.png|[*]}}]]). Available variables for the template are set up by this function, by $param parameter and by List::send\_file().
  
 **IN**: **IN**:
Line 232: Line 236:
 ==== send_notify_to_editor() ==== ==== send_notify_to_editor() ====
  
-Sends a notice to list editor(s) by parsing ''​listeditor_notification''​ template. The template makes a specified or a generic treatement according to variable $param.type (:= $operation parameter). The message is sent by calling List::send_file() (see [[#​list-send-file|list-send-file]],​ page [[internals#​list-send-file|{{crossref.png|[*]}}]]). Available variables for the template are set up by this function, by $param parameter and by List::send_file().+Sends a notice to list editor(s) by parsing ''​listeditor\_notification''​ template. The template makes a specified or a generic treatement according to variable $param.type (:= $operation parameter). The message is sent by calling List::send\_file() (see [[#​list-send-file|list-send-file]],​ page [[internals#​list-send-file|{{crossref.png|[*]}}]]). Available variables for the template are set up by this function, by $param parameter and by List::send\_file().
  
 **IN**: **IN**:
Line 246: Line 250:
 ==== send_notify_to_user() ==== ==== send_notify_to_user() ====
  
-Sends a notice to a user by parsing ''​user_notification''​ template. The template makes a specified or a generic treatement according to variable $param.type (:= with $operation parameter). The message is sent by calling List::send_file() (see [[#​list-send-file|list-send-file]],​ page [[internals#​list-send-file|{{crossref.png|[*]}}]]). Available variables for the template are set up by this function, by $param parameter and by List::send_file().+Sends a notice to a user by parsing ''​user\_notification''​ template. The template makes a specified or a generic treatement according to variable $param.type (:= with $operation parameter). The message is sent by calling List::send\_file() (see [[#​list-send-file|list-send-file]],​ page [[internals#​list-send-file|{{crossref.png|[*]}}]]). Available variables for the template are set up by this function, by $param parameter and by List::send\_file().
  
 **IN**: **IN**:
Line 261: Line 265:
 =====  Functions for topic messages ===== =====  Functions for topic messages =====
  
-is_there_msg_topic(), is_available_msg_topic(), get_available_msg_topic(), is_msg_topic_tagging_requiredautomatic_tag(), compute_topic(), tag_topic(), load_msg_topic_file(), modifying_msg_topic_for_subscribers(), select_subscribers_for_topic().+is\_there\_msg\_topic(), is\_available\_msg\_topic(), get\_available\_msg\_topic(), is\_msg\_topic\_tagging\_requiredautomatic\_tag(), compute\_topic(), tag\_topic(), load\_msg\_topic\_file(), modifying\_msg\_topic\_for\_subscribers(), select\_subscribers\_for\_topic().
  
 These functions are used to manages message topics. \\ These functions are used to manages message topics. \\
  
-N.B.: There is some exception to use some parameters: ​msg_topic.keywords for list parameters and topics_subscriber ​for subscribers options in the DB table. These parameters are used as string splitted by ','​ but to access to each one, use the function tools::get_array_from_splitted_string() (see [[#​tools-get-array-from-splitted-string|tools-get-array-from-splitted-string]],​ page [[internals#​tools-get-array-from-splitted-string|{{crossref.png|[*]}}]]) allows to access the enumeration.+N.B.: There is some exception to use some parameters: ​msg\_topic.keywords for list parameters and topics\_subscriber ​for subscribers options in the DB table. These parameters are used as string splitted by ','​ but to access to each one, use the function tools::get\_array\_from\_splitted\_string() (see [[#​tools-get-array-from-splitted-string|tools-get-array-from-splitted-string]],​ page [[internals#​tools-get-array-from-splitted-string|{{crossref.png|[*]}}]]) allows to access the enumeration.
  
 ==== is_there_msg_topic() ==== ==== is_there_msg_topic() ====
  
-Tests if some message topic are defined (''​msg_topic''​ list parameter, see [[#​msg-topic|{{crossref.png|[*]}}]],​ page [[#​msg-topic|{{crossref.png|[*]}}]]).+Tests if some message topic are defined (''​msg\_topic''​ list parameter, see [[#​msg-topic|{{crossref.png|[*]}}]],​ page [[#​msg-topic|{{crossref.png|[*]}}]]).
  
 **IN**: ''​self''​ (+): ref(List) **IN**: ''​self''​ (+): ref(List)
  
-**OUT**: 1 - some msg_topic ​are defined 0 - no msg_topic+**OUT**: 1 - some msg\_topic ​are defined 0 - no msg\_topic
  
 ==== is_available_msg_topic() ==== ==== is_available_msg_topic() ====
  
-Checks for a topic if it is available in the list: look foreach ''​msg_topic.name''​ list parameter (see [[#​msg-topic|{{crossref.png|[*]}}]],​ page [[#​msg-topic|{{crossref.png|[*]}}]]).+Checks for a topic if it is available in the list: look foreach ''​msg\_topic.name''​ list parameter (see [[#​msg-topic|{{crossref.png|[*]}}]],​ page [[#​msg-topic|{{crossref.png|[*]}}]]).
  
 **IN**: **IN**:
Line 288: Line 292:
 ==== get_available_msg_topic() ==== ==== get_available_msg_topic() ====
  
-Returns an array of available message topics (''​msg_topic.name''​ list parameter, see [[#​msg-topic|{{crossref.png|[*]}}]],​ page [[#​msg-topic|{{crossref.png|[*]}}]]).+Returns an array of available message topics (''​msg\_topic.name''​ list parameter, see [[#​msg-topic|{{crossref.png|[*]}}]],​ page [[#​msg-topic|{{crossref.png|[*]}}]]).
  
 **IN**: ''​self''​ (+): ref(List) **IN**: ''​self''​ (+): ref(List)
Line 296: Line 300:
 ==== is_msg_topic_tagging_required() ==== ==== is_msg_topic_tagging_required() ====
  
-Returns if the message must be tagged or not (''​msg_topic_tagging''​ list parameter set to '​required',​ see [[#​msg-topic-tagging|{{crossref.png|[*]}}]],​ page [[#​msg-topic-tagging|{{crossref.png|[*]}}]]).+Returns if the message must be tagged or not (''​msg\_topic\_tagging''​ list parameter set to '​required',​ see [[#​msg-topic-tagging|{{crossref.png|[*]}}]],​ page [[#​msg-topic-tagging|{{crossref.png|[*]}}]]).
  
 **IN**: ''​self''​ (+): ref(List) **IN**: ''​self''​ (+): ref(List)
Line 304: Line 308:
 ==== automatic_tag() ==== ==== automatic_tag() ====
  
-Computes topic(s) (with compute_topic() function) and tags the message (with tag_topic() function) if there are some topics defined.+Computes topic(s) (with compute\_topic() function) and tags the message (with tag\_topic() function) if there are some topics defined.
  
 **IN**: **IN**:
Line 316: Line 320:
 ==== compute_topic() ==== ==== compute_topic() ====
  
-Computes topic(s) of the message. If the message is in a thread, topic is got from the previous message else topic is got from applying a regexp on the subject and/or the body of the message (''​msg_topic_keywords_apply_on''​ list parameter, see[[#​msg-topic-keywords-apply-on|{{crossref.png|[*]}}]],​ page [[#​msg-topic-keywords-apply-on|{{crossref.png|[*]}}]]). Regexp is based on ''​msg_topic.keywords''​ list parameters (See [[#​msg-topic|{{crossref.png|[*]}}]],​ page [[#​msg-topic|{{crossref.png|[*]}}]]).+Computes topic(s) of the message. If the message is in a thread, topic is got from the previous message else topic is got from applying a regexp on the subject and/or the body of the message (''​msg\_topic\_keywords\_apply\_on''​ list parameter, see[[#​msg-topic-keywords-apply-on|{{crossref.png|[*]}}]],​ page [[#​msg-topic-keywords-apply-on|{{crossref.png|[*]}}]]). Regexp is based on ''​msg\_topic.keywords''​ list parameters (See [[#​msg-topic|{{crossref.png|[*]}}]],​ page [[#​msg-topic|{{crossref.png|[*]}}]]).
  
 **IN**: **IN**:
Line 335: Line 339:
 **IN**: ​ **IN**: ​
   - ''​self''​ (+): ref(List) ​   - ''​self''​ (+): ref(List) ​
-  - ''​msg_id''​ (+): string - the message ID of the message to tag  +  - ''​msg\_id''​ (+): string - the message ID of the message to tag  
-  - ''​topic_list''​ (+): the list of topics (strings splitted by '',''​) ​+  - ''​topic\_list''​ (+): the list of topics (strings splitted by '',''​) ​
   - ''​method''​ (+): ''​auto|editor|sender''​ - the method used for tagging ​   - ''​method''​ (+): ''​auto|editor|sender''​ - the method used for tagging ​
  
-**OUT**: name of the created topic information file (''​directory/​listname.msg_id''​) undef +**OUT**: name of the created topic information file (''​directory/​listname.msg\_id''​) undef 
  
 ==== load_msg_topic_file() ==== ==== load_msg_topic_file() ====
  
-Searches and loads msg topic file corresponding to the message ID (''​directory/​listname.msg_id''​). It returns information contained inside. ​+Searches and loads msg topic file corresponding to the message ID (''​directory/​listname.msg\_id''​). It returns information contained inside. ​
  
 **IN**: ​ **IN**: ​
   - ''​self''​ (+): ref(List) ​   - ''​self''​ (+): ref(List) ​
-  - ''​msg_id''​ (+): the message ID +  - ''​msg\_id''​ (+): the message ID 
   - ''​robot''​ (+): the robot    - ''​robot''​ (+): the robot 
  
Line 353: Line 357:
   * ''​topic'':​ list of topics (strings separated by '',''​) ​   * ''​topic'':​ list of topics (strings separated by '',''​) ​
   * ''​method'':​ ''​auto|editor|sender''​ - the method used for tagging ​   * ''​method'':​ ''​auto|editor|sender''​ - the method used for tagging ​
-  * ''​msg_id'':​ message ID of the message tagged+  * ''​msg\_id'':​ message ID of the message tagged
   * ''​filename'':​ name of the file    * ''​filename'':​ name of the file 
  
 ==== modifying_msg_topic_for_subscribers() ==== ==== modifying_msg_topic_for_subscribers() ====
  
-Deletes topics of subscribers that does not exist anymore and sends a notification to subscribers concerned. (Makes a diff on the ''​msg_topic''​ parameter between the list configuration before modification and a new state by calling the ''​tools::​diff_on_arrays()''​ function, see [[internals-tools#​diff_on_arrays|diff_on_arrays]]). This function is used by ''​wwsympa::​do_edit_list()''​. ​+Deletes topics of subscribers that does not exist anymore and sends a notification to subscribers concerned. (Makes a diff on the ''​msg\_topic''​ parameter between the list configuration before modification and a new state by calling the ''​tools::​diff\_on\_arrays()''​ function, see [[internals-tools#​diff_on_arrays|diff_on_arrays]]). This function is used by ''​wwsympa::​do\_edit\_list()''​. ​
  
 **IN**: ​ **IN**: ​
   - ''​self''​ (+): ref(List) - the list concerned before modification ​   - ''​self''​ (+): ref(List) - the list concerned before modification ​
-  - ''​new_msg_topic''​ (+): ref(ARRAY) - new state of the ''​msg_topic''​ parameters ​+  - ''​new\_msg\_topic''​ (+): ref(ARRAY) - new state of the ''​msg\_topic''​ parameters ​
  
 **OUT**: ​ **OUT**: ​
Line 370: Line 374:
 ==== select_subscribers_for_topic() ==== ==== select_subscribers_for_topic() ====
  
-Selects subscribers that are subscribed to one or more topic appearing in the topic list incoming when their delivery mode is ''​mail'',​ and selects the other subscribers (delivery mode different from ''​mail''​). This function is used by the ''​List::​send_msg()''​ function during message diffusion (see [[internals-list#​functions_for_message_distribution|Functions for message distribution]]).+Selects subscribers that are subscribed to one or more topic appearing in the topic list incoming when their delivery mode is ''​mail'',​ and selects the other subscribers (delivery mode different from ''​mail''​). This function is used by the ''​List::​send\_msg()''​ function during message diffusion (see [[internals-list#​functions\_for\_message\_distribution|Functions for message distribution]]).
  
 **IN**: ​ **IN**: ​
   - ''​self''​ (+): ref(List) ​   - ''​self''​ (+): ref(List) ​
-  - ''​string_topic''​ (+): string splitted by '',''​ - the topic list +  - ''​string\_topic''​ (+): string splitted by '',''​ - the topic list 
   - ''​subscribers''​ (+): ref(ARRAY) - list of subscriber emails ​   - ''​subscribers''​ (+): ref(ARRAY) - list of subscriber emails ​
  
Line 381: Line 385:
 ===== Scenario evaluation ===== ===== Scenario evaluation =====
  
-The following function is used to evaluate scenario file ''<​action>​.<​parameter_value>'',​ where ''<​action>''​ corresponds to a configuration parameter for an action and ''<​parameter_value>''​ corresponds to its value. ​+The following function is used to evaluate scenario file ''<​action>​.<​parameter\_value>'',​ where ''<​action>''​ corresponds to a configuration parameter for an action and ''<​parameter\_value>''​ corresponds to its value. ​
  
  
Line 389: Line 393:
 **IN**: ​ **IN**: ​
   - ''​operation''​ (+): SCALAR - the requested action corresponding to config parameter ​   - ''​operation''​ (+): SCALAR - the requested action corresponding to config parameter ​
-  - ''​auth_method''​ (+): ''​smtp|md5|pgp|smime''​+  - ''​auth\_method''​ (+): ''​smtp|md5|pgp|smime''​
   - ''​robot''​ (+): robot    - ''​robot''​ (+): robot 
   - ''​context''​ (): ref(HASH) - contains value to instantiate scenario variables (hash keys)    - ''​context''​ (): ref(HASH) - contains value to instantiate scenario variables (hash keys) 
-  - ''​debug''​ (): boolean - if true adds keys ''​condition''​ and ''​auth_method''​ to the hash returned.+  - ''​debug''​ (): boolean - if true adds keys ''​condition''​ and ''​auth\_method''​ to the hash returned.
  
 **OUT**: undef ref(HASH) with keys:  **OUT**: undef ref(HASH) with keys: 
-  - ''​action'':​ ''​do_it|reject|request_auth|owner|editor|editorkey|listmaster''​ +  - ''​action'':​ ''​do\_it|reject|request\_auth|owner|editor|editorkey|listmaster''​ 
-  - ''​reason'':​ '​value'​ if ''<​nowiki>​action == '​reject'</​nowiki>''​ in scenario and if there is ''<​nowiki>​reject(reason='​value'​)</​nowiki>''​ to match a key in ''​mail_tt2/authorization_reject.tt2''​. This is used in errors reports (see [[internals-report|report.pm]]) ​+  - ''​reason'':​ '​value'​ if ''<​nowiki>​action == '​reject'</​nowiki>''​ in scenario and if there is ''<​nowiki>​reject(reason='​value'​)</​nowiki>''​ to match a key in ''​mail\_tt2/authorization\_reject.tt2''​. This is used in errors reports (see [[internals-report|report.pm]]) ​
   - ''​tt2'':​ template name if ''<​nowiki>​action == '​reject'</​nowiki>''​ in scenario and there is ''<​nowiki>​reject(tt2='​template_name'​)</​nowiki>''​. ​   - ''​tt2'':​ template name if ''<​nowiki>​action == '​reject'</​nowiki>''​ in scenario and there is ''<​nowiki>​reject(tt2='​template_name'​)</​nowiki>''​. ​
   - ''​condition'':​ the checked condition. ​   - ''​condition'':​ the checked condition. ​
-  - ''​auth_method'':​ the checked ''​auth_method''​+  - ''​auth\_method'':​ the checked ''​auth\_method''​
  
  
Line 412: Line 416:
  
   - Loading file in memory: ​   - Loading file in memory: ​
 +
 <​code>​List::​_load_admin_file(),​_load_include_admin_user_file(),​_load_list_param()</​code>​ <​code>​List::​_load_admin_file(),​_load_include_admin_user_file(),​_load_list_param()</​code>​
 +
   - Saving list configuration in file:    - Saving list configuration in file: 
 +
 <​code>​List::​_save_admin_file(),​_save_list_param()</​code>​ <​code>​List::​_save_admin_file(),​_save_list_param()</​code>​
 +
   - Tools to get parameter values: ​   - Tools to get parameter values: ​
 +
 <​code>​List::​get_param_value(),​_get_param_value_anywhere(),​_get_single_param_value()</​code>​ <​code>​List::​get_param_value(),​_get_param_value_anywhere(),​_get_single_param_value()</​code>​
 +
   - Tools to initialize list parameters with defaults:   - Tools to initialize list parameters with defaults:
 +
 <​code>​List::​_apply_default()</​code>​ <​code>​List::​_apply_default()</​code>​
 +
   - To present list parameters on the web interface: ​   - To present list parameters on the web interface: ​
 +
 <​code>​wwsympa::​do_edit_list_request(),​_prepare_edit_form(),​_prepare_data()</​code>​ <​code>​wwsympa::​do_edit_list_request(),​_prepare_edit_form(),​_prepare_data()</​code>​
 +
   - To get updates on list parameters from the web interface: ​   - To get updates on list parameters from the web interface: ​
 +
 <​code>​wwsympa::​do_edit_list(),​_check_new_value</​code>​ <​code>​wwsympa::​do_edit_list(),​_check_new_value</​code>​
  
  • internals/internals-list.1270799409.txt.gz
  • Last modified: 2010/04/09 09:50
  • by david.verdin@cru.fr