Go to the first, previous, next, last section, table of contents.

25. The localuser director

The localuser director checks whether the local part of an address is the login of a local user, by calling the getpwnam() function. If it is, and if other conditions set by options are met, it accepts the address and sets up a transport for it. The generic transport option must always be specified, unless the generic verify_only option is set.

The user's uid and gid are set up by default to be used while running the delivery process. If the generic home_directory option (see chapter 21) is unset, the user's home directory is passed to the transport for use during delivery. Setting

home_directory = $home

does not work, because $home is not set during the expansion of home_directory.

When processing the require_files generic option, the value of $home is the value of home_directory if set, and otherwise the user's home directory. Using require_files it is possible to pick out all users with particular files in their home directories and route their mail to a specific transport. This could be used, for example, to check for a .procmailrc file and then to direct delivery via procmail if one is found.

match_directory (localuser)

Type: string, expanded
Default: unset

If this option is set, the user's home directory, as obtained from getpwnam(), must match the given string. If it does not, the director declines to handle the address. This provides a way of partitioning the local users by home directory. The string is expanded before use. If the expansion fails, Exim panics, unless the failure was explicitly triggered by a `fail' item in a conditional sub-expression in the expansion, in which case the director just declines to handle the address.

If the expanded string starts with an asterisk, the remainder must match the end of the home directory name; if it starts with a circumflex, a regular expression match is performed. In fact, the matching process is the same as is used for domain list items and may include file lookups.

If the pattern starts with an exclamation mark, the user's home directory must not match the rest of the given string. For example, with

match_directory = !^/group

the director declines if the user's home directory starts with /group.

On central systems at Cambridge University, when a user account is cancelled, it remains in the password file for a while, with the home directory set to /home/CANCELLED. We use the match_directory option to detect mail addressed to such users and bounce it with an explanatory message.

Go to the first, previous, next, last section, table of contents.