HowTos/Auto Actions

From Scalix Wiki
Revision as of 10:27, 2 April 2006 by Florian (Talk | contribs)

Jump to: navigation, search

Introduction

Auto Actions are the Scalix method of representing server-based rules. They are linked to a users personal mailbox as a whole and are usually applied to incoming messages as they are received.

Note: This is work in progress and incomplete. Currently, for the first release of Scalix Wiki, it is an example of how things will look like here. I'll continue working on it.

Setting up Auto Actions

Auto Actions can be setup in multiple ways. Commonly used are to explicitly setup Auto Actions are:

  • The Outlook Out of Office Assistant
  • The Scalix Rules Wizard in Outlook
  • The Web-based server rules wizard
  • The sxaa tool

In some cases, they are also setup implicitly:

  • When setting up delegate access for a Outlook user, including forward of calendar items

Auto Actions Implementation on the server

The 3d file

Within Scalix you can set up quite a number of Auto Actions for a user. We are all used to auto answer messages and the auto forward facility. Indeed, we can set these from within most of the Scalix clients. There are other Auto Actions offered by Scalix that are not directly accessible from some (if any) of the clients. These are facilities like auto print, auto file, auto notify ...

When Auto Actions are setup for a user, a file is built in this user’s "home" directory, specifying what AutoActions are to be performed, that is, whether you want auto reply and/or auto forward and/or auto print, etc... All this is specified in one Auto Actions file - the 3d file in the user’s so-called "g" directory.

The 3d file is in Transaction File format. This is one of some Scalix-specific binary file formats. As it is a binary format, the 3d file cannot be edited directly. However, Transaction File format files can be converted to/from plaintext using the tf.browse tool provided by Scalix.

The User's "g" directory

This is a place where a lot of mailbox-specific information is stored. For a given user, it can be found using the -f option to the omshowu command. See the following example:

[root@demo root]# omshowu -n sxadmin -f
Authentication ID: sxadmin
User Name : sxadmin /CN=sxadmin
MailNode : scalix,demo
Internet Address : sxadmin@demo.scalix.com
System Login : sxadmin
Password : set
Admin Capabilities : YES
Mailbox Admin Capabilities : NO
Language : C
Virtual Vault : Enabled (default)
Mail Account: Unlocked
Last Signon : Never.
Receipt of mail : ENABLED
Service level : 0
Excluded from Tidying : NO
User Folder : ~/user/g000035/00000v8:1
User Class : Full

Note the User Folder line. The directory, in which the user folder is contained, is the user's home - or "g" - directory. The ~ represents the Scalix main data directory for your Scalix instance, so for the example user here the g directory would normally be /var/opt/scalix/user/g000035.

The "3d" file containing the Auto Actions will be called 000003d and is located in this directory.

Displaying the contents of the 3d file

You can display the 3d transaction file by using the tf.browse command with the -i option, e.g.:

[root@demo g000035]# tf.browse -i 000003d
HEADER            (DN)  1  0  2  1002  0x0  0x0  0  0x0  0x0  0x0  0x0  0x0  ""
AA_NO             ()  0x0  500  0  0  0  0  "SXAA FORWARD:500"  ""  ""  ""  ""
AA_SIMPLE_FORWARD ()  0x0  0x1  1167  0  0  ""  "ISO8859_1"  ""  ""  ""  ""  "\
"  ""  ""  ""

This shows a "forward" Auto Action as created by the sxaa command from the Scalix Admin Resource Kit.

Elements of the 3d file

Each transaction file is made of records. In the example above, there are 3 records, one HEADER record (1 per file), 1 AA_NO record (one per Auto Action; there can be any number of Auto Actions in a single 3d file) and the actual action record, in this case a forward record.

  • The HEADER record:
    HEADER (DN) 1 0 2 1002 0x0 0x0 0 0x0 0x0 0x0 0x0 0x0 ""
    This will be the same for every 3d file, so if you create your own 3d file from scratch, you would just copy/paste this record. It consists of multiple fields, each separated by spaces in the ASCII version. The most important fields will be the 3rd and 4th field - the 3rd field ("2") indicates that this is a Class-2 transaction file, used for special purposes (such as storing Auto Action information. Class-0 and Class-1 transaction files are actually used in message submission and routing); the 4th field ("1002") is actually a transaction file type, with 1002 indicating that this is an Auto Action file.
  • The AA_NO record:
    AA_NO () 0x0 500 0 0 0 0 "SXAA FORWARD:500" "" "" "" ""
    This is the header for the one Auto Action we have in the file. Again, it consists of multiple fields. Most of the "0" or "" values denote empty fields and default values and would be left as such for most examples. However, a few a relevant: The first field ("0x0") indicates that the Auto Action is enabled. If set to "0x1", it would be disabled. The second field ("500") is the Auto Action number; each action must have a unique number within the file. Some methods of creating Auto Actions (e.g. the Outlook Out Of Office assistant) always use the same number so that they can recognize Auto Actions created by them. The 7th field ("SXAA FORWARD:500") is a comment describing the Auto Action. This was put in there by the sxaa command to denote that very fact.
    Note: The command used to create this Auto Action was:
    sxaa --user sxadmin --forward demo@scalix.com
  • The AA_SIMPLE_FORWARD record:
    AA_SIMPLE_FORWARD () 0x0 0x1 1167 0 0 "" "ISO8859_1" ""  "" "" "" "" "" "" ""
    This indicates the actual forward action. For the time being, we just treat this as a command that must be left this way.