Postfix trigger when sending mail

I need to run the script after sending the postfix message and get its status (success, delay, etc.). Do the filters help me? I think this only works for incoming mail, but I need outgoing . I am thinking about parsing logs by message id. But this is not a good idea. Is there a better way?

+4
source share
2 answers

Filters will not have access to delivery status, so I don’t think that out-queue content filters will help. You can add a return receipt in the header, but it would be easier to enable delivery status notification in postfix. This still returns status to the original user, and I suspect that you meant something system-wide.

Taking DSN one more step, you could hack postfix rollback templates to contain either the “To:” or “Bcc:” header (if the user requested a status too?) By sending status messages to a specific central mailbox. This can lead to a change in the rollback itself to allow these headers.

Personally, I would go with the analysis of magazines, but you do not explain why this is bad or what specifically you want to accomplish.

+4
source

you can check if any mail is being delayed by issuing the postfix utility postqueue -p

0
source

All Articles