Previous: Built-in Actions, Up: Actions


5.7.2 External Actions

Editor's note:

The information in this node may be obsolete or otherwise inaccurate. This message will disappear, once this node revised.

GNU Mailutils is shipped with a set of external Sieve actions. These actions are compiled as loadable modules and must be required prior to use (see Require Statement).

— Action: moderator [:keep] [:address address(string)] [:source sieve-file(string)]


Synopsis:

          require "moderator"
          moderator args;


Description: This action is a moderator robot for Mailman-driven mail archives. A Mailman moderation request is a MIME message consisting of the following three parts:

N Content-Type Description
1 text/plain Introduction for the human reader.
2 message/rfc822 Original submission.
3 message/rfc822 Mailman control message.

Replying to part 3 (keeping the subject intact) instructs Mailman to discard the original submission.

Replying to part 3 while adding an `Approved:' header with the list password in it approves the submission.

The moderator action spawns an inferior Sieve machine and filters the original submission (part 2) through it. If the inferior machine marks the message as deleted, the action replies to the control message, thereby causing the submission to be discarded. The ‘From:’ address of the reply can be modified using :address tag. After discarding the message, moderator marks it as deleted, unless it is given :keep tag.

The argument of :source tag, if given, specifies the Sieve source file to be used on the message. If :tag is not present, moderator will create and use a copy of the existing Sieve machine.

The action checks the message structure: it will bail out if the message does not have exactly 3 MIME parts, or if parts 2 and 3 are not of ‘message/rfc822’ type. It is the responsibility of the caller to make sure the message is actually a valid Mailman moderation request (see the example below).


Example:

          if allof(header :is "Sender" "mailman-bounces@gnu.org",
                   header :is "X-List-Administrivia" "yes")
            {
               moderator :source "~/.sieve/mailman.sv";
            }
— Action: pipe [:envelope] command(string)


Synopsis:

          require "pipe";
          if pipe args
            {
               ...
            }


Description: The pipe action sends executes a command specified by its argument and sends the entire message to its standard input. The command argument supplies the command line.

The envelope of the message is included, if the :envelope tag is given.


Example: The example below uses the maidag utility (see maidag) to forward the message to user ‘gray’ on the machine ‘mail.gnu.org’.

          require "pipe";
          
          pipe "/usr/sbin/maidag --url smtp://gray@mail.gnu.org"
— Action: vacation [:days ndays(number)] [:subject subject(string)] [:aliases addrlist(string-list)] [:addresses noreply-address(string-list)] [:reply_regex expr(string)] [:reply_prefix prefix(string)] reply-text(string)


Syntax:

          require "vacation";
          vacation args;


Description: The vacation action returns a message with reply-text to the sender. It is intended to inform the sender that the recipient is not currently reading his mail.

If the :subject tag is given, its argument sets the subject of the message. Otherwise, the subject is formed by prefixing original subject with ‘Re:’, or prefix, given with the :reply_prefix tag. Before prefixing, any original prefixes matching extended regular expression expr (:reply_regex tag) are stripped from the subject line. If :reply_regex is not specified, the default regexp is ‘^re: *’.

The :aliases tag instructs vacation to handle messages for any address in addrlist in the same manner as those received for the user's principal email.

Before processing, vacation compares the sender address with its address exclusion list. Elements of this list are extended case-insensitive regular expressions. If the sender address matches any of these expressions, the message will not be replied. The default exclusion list is:

              .*-REQUEST@.*
              .*-RELAY@.*
              .*-OWNER@.*
              ^OWNER-.*
              ^postmaster@.*
              ^UUCP@.*
              ^MAILER@.*
              ^MAILER-DAEMON@.*

New entries can be added to this list using :addresses tag.

The :days tag sets the reply interval. A reply is sent to each sender once in ndays days. GNU Sieve keeps track of sender addresses and dates in a DBM file .vacation stored in the user's home directory. This tag is available only if Mailutils is compiled with DBM support.