.SH SYNOPSIS
.B umpf
[-c config_file] [-m default_mailbox]
+.SH AVAILABILITY
+Linux only.
.SH DESCRIPTION
Umpf is a program that reads an e-mail from stdin and according to the config
file decides, what to do with it. It is possible to forward the e-mail,
refers to the output of last external program executed by action pipe
.SS COMMANDS
A command is either an action specification or an assignment. All the
-commands must with semicolon. Commands can be grouped in blocks bounded by
+commands must end with semicolon. Commands can be grouped in blocks bounded by
braces.
.SS ASSIGNMENTS
Assignment is specified in a following way:
.P
-.B Lvalue = Rvalue ;
+.B "Lvalue = Rvalue ;"
.P
Lvalue is a variable identifier. Rvalue can be variable, a constant (constant
must be given in double quotes) or an expression consisting of variables,
,
.B +
,
-.B -
+.B \-
,
.B *
and
, operation
.B .
stands for string contatenations, the rest of them are arithmetic operations.
-Doing arithemtic operations makes sense only on integers. Precedence of the
+Doing arithmetic operations makes sense only on integers. Precedence of the
operations can be specified using parentheses.
.SS ACTIONS
-Actions are specified with an arrow operator. Plain
+Actions are specified with an arrow operator.
.TP
-.B -> ;
+.B "-> ;"
means "deliver the e-mail to the default mailbox and exit".
.TP
-.B -> expression ;
+.B "-> expression ;"
means "deliver the e-mail the mailbox specified behind arrow and exit"
.TP
-.B -> pipe expression ;
+.B "-> pipe expression ;"
means "pipe the e-mail to the external program specified behind pipe
keyword". Output of the program is stored in
.B $LAST_OUTPUT
.B $LAST_EXIT_CODE
variable.
.TP
-.B -> filter expression
-means "pipe the e-mail to the external program and replace it with output of the program". All the headers variables,
+.B "-> filter expression"
+means "pipe the e-mail to the external program and replace it with output of the program". All the header variables,
.B $MAIL_LEN
and
.B $LAST_EXIT_CODE
are set accordingly.
.TP
-.B -> discard ;
+.B "-> discard ;"
means just "discard the email and exit".
.TP
.B -> mail expression ;
Some of the actions (delivery or forwarding an e-mail) can have keyword copy
in front of the arrow, ie.
.P
-.B copy -> "mailbox";
+.B "copy -> $mailbox;"
.P
When copy is specified, the program does not exit after doing an action but
-continues reading the rules. It also does not deliver to default mailbox if
+continues reading the rules. It also does not deliver to the default mailbox if
action fails.
.SS CONDITIONS
Conditional execution of commands can be specified in a following way:
.P
-.B if (condition) { ... }
+.B "if (condition) { ... }"
.P
-.B if (condtion) { ... } else { ... }
+.B "if (condtion) { ... } else { ... }"
.P
-.B if (condition) { ... } else if { ... } [ else { ... } ]
+.B "if (condition) { ... } else if { ... } [ else { ... } ]"
.P
where the condition can be a constant, a variable or an expression consisting
of following operations:
.TP
-.B &
+.B "&"
is binary boolean and
.TP
-.B |
+.B "|"
is binary boolean or
.TP
-.B ^
+.B "^"
is binary boolean xor
.TP
-.B !
+.B "!"
is unary boolean not
.TP -1
A variable or a constant has a boolean value 0, if its value is either "" or
Expressions can be compared using following binary relations.
.P
String comparisons:
-.P
-.TP
+.TP 5
.B ~~
means "matches" (left operand should be string, right one can be a perl compatible regular expression)
.TP
means "does not match"
.TP -1
Integer comparisons (does not make sense on strings):
-.TP
+.TP 5
.B ==
means "is equal to"
.TP