Procmail actions can make use of shell-style variables in their conditions and delivery destinations. For example, you could create an action that delivers to the file /mail/$LOGNAME, in which $LOGNAME is the username of the user to whom email is being delivered. Several variables (like .LOGNAME and DEFAULT) are set automatically by Procmail, while others can be set in the configuration file for later use. You can even override the automatic variables to change the behavior of the program, such as the default delivery destination or shell to use for executing commands.
To create a new variable assignment, follow these steps:
1. | On the module's main page, click on the Add a new variable setting link below the list of existing actions. The variable creation form will be displayed. |
2. | |
3. | In the Value field, enter the value to assign to this variable, such as Maildir/. The value can include references to other variables. |
4. | Hit the Create button to add the variable to the list on the main page. |
5. | Use the up arrow next to the new variable in the list to move it to the correct location, which will typically be at the top of the file. Variable assignments only effect actions and assignments after them, so one added at the bottom may not have any effect. |
As with actions, a variable can be edited or deleted by clicking on its name in the list. Variables can also be moved about with the up and down arrows next to them. Because they only effect actions and other assignments below them in the file, you will certainly want to move any new variable up to near the top of the list. One added and left at the bottom will not have any effect (except on the default delivery destination).
Procmail defines and allows you to change several special variables. The names and meanings of the most interesting ones are listed in Table 45.1.
3.15.31.206