External command to use instead of mailbox delivery
mailbox_command

This parameter specifies the optional external command to use instead of mailbox delivery. The command is run as the recipient with proper HOME, SHELL and LOGNAME environment settings. Exception: delivery for root is done as $default_user.

Other environment variables of interest: USER (recipient username), EXTENSION (address extension), DOMAIN (domain part of address), and LOCAL (the address localpart).

Unlike other Postfix configuration parameters, this parameter is not subjected to parameter substitutions. This is to make it easier to specify shell syntax (see example below).

Avoid shell meta characters because they will force Postfix to run an expensive shell process. Procmail alone is expensive enough.

IF YOU USE THIS TO DELIVER MAIL SYSTEM-WIDE, YOU MUST SET UP AN ALIAS THAT FORWARDS MAIL FOR ROOT TO A REAL USER.

Examples: