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

The smartuser director

The `smartuser' director matches any local part, so it can be used to handle local addresses that all other directors have failed. It is, of course, subject to the generic director options, so specific instances can be used for all addresses in certain domains, or all local parts with certain prefixes or suffixes, or specific local parts, or any other generic condition.

`Smartuser' can generate a new address from the old one, and cause that to be reprocessed, or it can set a transport, optionally changing the address. Common uses are to pipe the message to a script that generates an information message to be returned to the sender, or to send the message to another host for processing.

new_address (smartuser) option

Option: new_address
Type: string
Default: unset

This option specifies a new address, to replace the current one. It must be a qualified address (that is, contain an @ character). The string is expanded, and so settings such as

new_address = ${local_part}@some.new.host

can be used, or a file lookup on the local part can be done. If no transport is specified, this option is required, and the new address is processed by the directors and routers in the normal way, as if it were the result of aliasing or forwarding. In particular, if it is a duplicate of any other address in the message, it is discarded.

On the other hand, if a transport is specified for `smartuser', the new address replaces the old one when the message is delivered by the given transport, and no checking for duplication takes place. The original address is available to the transport via the expansion variables `$original_local_part' and `$original_domain'.

panic_expansion_fail (smartuser) option

Option: panic_expansion_fail
Type: boolean
Default: true

If the expansion of `new_address' fails as a result of an explicit `fail' item in an expansion sub-expression, the director just fails to handle the address. Otherwise, an expansion failure is treated as a serious configuration error, and causes a panic, unless this option is set false, in which case the same action is taken as for `fail'.

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