× sympa.pl

  • This document was obsoleted.

This is the main script; it runs as a daemon and does the message/command processing. It uses these functions: DoFile(), DoMessage(), DoCommand(), DoSendMessage(), DoForward(), SendDigest(), CleanSpool(), sigterm(), sighup().

Concerning reports about message distribution, function List::send_file() (or List::send_global_file()) is called with mail template message_report. Concerning reports about commands, it is the mail template command_report.

DoFile()

Handles a received file: function called by the sympa.pl main loop in order to process files contained in the queue spool. The file is encapsulated in a Message object not to alter it. Then the file is read, the header and the body of the message are separated. Then the adequate function is called whether a command has been received or a message has to be redistributed to a list.

So this function can call various functions:

About command process a report can be sent by calling List::send_global_file() with template command_report. For message report it is the template message_report.

IN: file(+): the file to handle

OUT: $status - result of the called function undef

DoMessage()

Handles a message sent to a list (those that can make loop and those containing a command are rejected). This function can call various functions:

  • List::distribute_msg() for distribution (see list-distribute-msg, page [*])
  • List::send_auth() for authentification or topic tagging by message sender(see list-send-auth, page [*])
  • List::send_to_editor() for moderation or topic tagging by list moderator(see list-send-to-editor, page [*]).
  • List::automatic_tag() for automatic topic tagging (see list-automatic-tag, page [*]).

IN:

  1. which(+): 'list_name@domain_name - the concerned list
  2. message(+): ref(Message) - sent message
  3. robot(+): robot

OUT: 1 if everything went fine in order to remove the file from the queue undef

DoCommand()

Handles a command sent to sympa. The command is parse by calling Commands::parse() (see commands-parse, page [*]).

IN:

  1. rcpt: recepient <listname>-<subscribeunsubscribe>
  2. robot(+): robot
  3. msg(+): ref(MIME::Entity) - message containing the command
  4. file(+): file containing the message

OUT: $success - result of Command::parse() function undef.

DoSendMessage()

Sends a message pushed in spool by another process (ex: wwsympa.fcgi) by calling function mail::mail_forward() (see mail-mail-forward, page [*]).

IN:

  1. msg(+): ref(MIME::Entity)
  2. robot(+): robot

OUT: 1 undef

DoForward()

Handles a message sent to <listname>-editor: the list editor, <list>-request: the list owner or the listmaster. The message is forwarded according to $function by calling function mail::mail_forward() (see mail-mail-forward, page [*]).

IN:

  1. name(+): list name if ($function != 'listmaster')
  2. function(+): 'listmaster' 'request' 'editor'
  3. robot(+): robot
  4. msg(+): ref(MIME::Entity)

OUT: 1 undef

SendDigest()

Reads the queuedigest spool and send old digests to the subscribers with the digest option by calling List::send_msg_digest() function mail::mail_forward() (see list-send-msg-digest, page [*]).

IN: - OUT: - undef

CleanSpool()

Cleans old files from spool $spool_dir older than $clean_delay.

IN:

  1. spool_dir(+): the spool directory
  2. clean_delay(+): the delay in days

OUT: 1

sigterm()

This function is called when a signal -TERM is received by sympa.pl. It just changes the value of $signal loop variable in order to stop sympa.pl after endding its message distribution if in progress. (see stop-signals, page [*])

IN: - OUT: -

sighup()

This function is called when a signal -HUP is received by sympa.pl. It changes the value of $signal loop variable and switchs of the -mail (see stop-signals, page [*]) logging option and continues current task.

IN: - OUT: -

  • internals/internals-sympa.txt
  • Last modified: 2018/03/29 03:48
  • (external edit)