GNU Mailutils Manual (split by section):   Section:   Chapter:FastBack: Programs   Up: Programs   FastForward: Libraries   Contents: Table of ContentsIndex: Function Index

3.18 Comsat Daemon

Comsatd is the server which receives reports of incoming mail and notifies users about it. By default, it prints subject, sender name and email, followed by first five lines of each newly arrived message to the tty of the recipient user. Users can customize this behavior.

3.18.1 Starting comsatd

-d
--daemon

Run as a standalone daemon.

-i
--inetd

The server is started from /etc/inetd.conf file:

comsat dgram  udp wait  root  /usr/sbin/comsatd \
comsatd -c /etc/comsat.conf

This is the default operation mode.

-t[file]
--test[=file]

Test mode. In this mode, comsatd takes two arguments: URL of a mailbox and QID of the message from that mailbox and prints the notification to the current user tty (/dev/tty), or file, if it is supplied. If the ~/.biffrc file exists, it will be used. For example:

$ comsatd --test /var/mail/root 34589

Notice, that file is an optional argument. When supplied, it should follow the short option form immediately, or the long option form after the equals sign, e.g.:

$ comsatd --test=logfile /var/mail/root 34589

or

$ comsatd -tlogfile /var/mail/root 34589
--foreground

Don’t detach from the controlling terminal, remain in foreground.

See also Common Options.

3.18.2 Configuring comsatd

Following configuration statements affect the behavior of comsatd:

StatementReference
debugSee debug statement.
loggingSee logging statement.
mailboxSee mailbox statement.
lockingSee locking statement.
aclSee acl statement.

3.18.2.1 General Settings

These statements control the general behavior of the comsat daemon:

Comsatd Conf: max-lines number

Set maximum number of message body lines to be output.

Comsatd Conf: allow-biffrc bool

Enable or disable processing of user’s .biffrc file. By default, it is enabled.

3.18.2.2 Security Settings

These statements control the way comsatd fights possible flooding attacks.

Comsatd Conf: max-requests number

Set maximum number of incoming requests per ‘request-control-interval’.

Comsatd Conf: request-control-interval duration

Set the request control interval.

Comsatd Conf: overflow-delay-time duration

Set initial amount of time to sleep, after the first overflow occurs.

Comsatd Conf: overflow-control-interval duration

Set overflow control interval. If two consecutive overflows happen within that interval, the overflow-delay-time is doubled.

3.18.3 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 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 [-n] string [string...]

Output the arguments to the user’s terminal device. If several arguments are given they will be output separated by single spaces. The newline character will be printed at the end of the output, unless the -n option is used.

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"

The above example can also be written as:

echo Mail to \a$u@$h\a
echo ---
echo From: $H{From}
echo Subject: $H{Subject}
echo ---
echo $B(,5)
echo ---

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"

GNU Mailutils Manual (split by section):   Section:   Chapter:FastBack: Programs   Up: comsatd   FastForward: Libraries   Contents: Table of ContentsIndex: Function Index