I'd like to create a custom program for handling incoming mail from postfix. I'd like to hook this into postfix by making it the mailbox_command. The manual indicates that there are a number of environment variables which are set when this command is invoked, however it doesn't say much else and doesn't include any particular requirements of this command.
Specifically I'd like to know:
- how (if at all) the return code is used by postfix (what are the expected return codes and what effect do they have).
- The mail itself appears to be handed to the command by passing it into the stdin. Is this a pipe or a temp file or is this not defined? The difference this makes is that a temp file can be memory mapped where as a pipe needs to be read byte by byte.
- Can this command deffer accepting a mail (effectively tell postfix to try again later) - this could be answered by (1).
- Is the stdout / std error logged or otherwise used in any way?
Does anyone know where this information can be found?