[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.14.2 Configuring comsatd

The configuration parameters for comsatd are kept in a single configuration file. The file uses line-oriented format: each line contains a single statement. Comments are introduced with the `#' sign and empty lines are ignored. You can specify the configuration file to use by using `-c' or `--config' command line switch.

The configuration file statements can logically be subdivided into General Settings, Security Settings and Access Control Lists. The following sections address each of these statement group in detail.

General Settings  
Security Settings  
Access Control Lists  

General Settings

These statements control the general behavior of the comsat daemon:

max-lines number
Set maximum number of message body lines to be output.
allow-biffrc ( yes | no )
Enable or disable processing of user's `.biffrc' file. By default, it is enabled.

Security Settings

These statements control the way comsatd fights possible flooding attacks.

max-requests number
Set maximum number of incoming requests per `request-control-interval'.
request-control-interval number
Set the request control interval (seconds).
overflow-delay-time number
Set the initial amount of time to sleep, after the first overflow occurs.
overflow-control-interval number
Set the overflow control interval. If two consecutive overflows happen within number seconds, the overflow-delay-time is doubled.

Access Control Lists

Access control lists determine from which addresses comsatd will receive mail notification messages.

The access control lists are introduced in configuration file using keyword `acl'. General format for an ACL rule is

 
acl action netlist

Here, action specifies the action to be taken when a request arrives from one of the networks, listed in netlist. There are two possible actions: `allow' and `deny'.

The netlist is a whitespace-separated list of network numbers. Each network number may be specified in one of the following forms:

netnum
Means a single host with IP address netnum.
netnum/netmask
netnum/masklen
`any'
Denotes any IP address. It is equivalent to `0.0.0.0/0'.

Upon receiving a notification message, comsatd compares its source address against each ACL rule in the order of their appearance in the configuration file. The first rule that matches the packet determines whether the message will be processed or rejected. If no matching rule was found, the default rule applies. Currently, default rule is

 
acl allow any

If you don't need such behavior, specify the default rule explicitly. For example, the common use would be:

 
acl allow 127.0.0.1
acl deny any

which makes comsatd receive the notification messages from localhost only.

A per-user Configuration File

By default, when a notification arrives, comsatd prints subject, from headers and the first five lines from the new message to the user's tty. The user is allowed to change this behavior by using his own configuration file. This file should be located in the user's home directory and should be named `.biffrc'. It must be owned by the user and have its permissions bits set to 0600. (Please note, that the use of per-user configuration files may be disabled, by specifying `allow-biffrc no' in the main configuration file, see see section 3.14.2 Configuring comsatd).

The `.biffrc' file consists of a series of statements. Each statement occupies one line and defines an action to be taken upon arrival of a new mail. Very long lines may be split using `\' as the last character on the line. As usual, comments may be introduced with `#' character.

The actions specified in `.biffrc' file are executed in turn. The following actions are defined:

beep
Produce an audible signal.
echo string
Output string to user's terminal device.
exec prog arglist
Execute program prog with arguments from arglist. prog must be specified with absolute pathname. It may not be a setuid or setgid program.

In the description above, string denotes any sequence of characters. This sequence must be enclosed in a pair of double-quotes, if it contains whitespace characters. The `\' character inside a string starts a C escape sequence. Following meta-characters may be used in strings:

$u
Expands to username
$h
Expands to hostname
$H{name}
Expands to value of message header `name'.
$B(c,l)
Expands to message body. c and l give maximum number of characters and lines in the expansion. When omitted, they default to 400, 5.

Example I

Dump to the user's terminal the contents of `From' and `Subject' headers followed by at most 5 lines of message body.
 
echo "Mail to \a$u@$h\a\n---\n\
From: $H{from}\n\
Subject: $H{Subject}\n\
---\n\
$B(,5)\
---\n"

Example II

Produce a bell, then pop up the xmessage window on display :0.0 with the text formatted in the same manner as in the previous example.

 
beep
exec /usr/X11R6/bin/xmessage \
-display :0.0 -timeout 10 "Mail to $u@$h \n---\n\
From: $H{from}\n\
Subject: $H{Subject}\n\
---\n\
$B(,5)\
---\n"


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by Sergey Poznyakoff on December, 23 2004 using texi2html