Zbigniew Szczęsny
2021-01-26 01:10:10 UTC
Hi,
I try to integrate Postix with an external sales application.
PHP sales application is delivering voucher information via e-mail. It registers related customer-id and order-id information in specific e-mail X-Headers.
I would love to have these data in Postfix log. I was able to rely Postfix log to Rsyslog and pass it via UDP to a simple UDP server where it is organized using queue ids as keys.
Using header_check I was able to successfully collect such a collection for a deliverable message:
Array
(
[queue_id] => 6FDC5900000006187D
[from] => ***@my-server.org
[log_start_time] => 2021-01-26 01:55:28
[message_id] => ***@my-server.org
[log_updt_time] => 2021-01-26 01:55:29
[pid] => 123456
[oid] => 7654321
[mt] => 1
[to] => ***@other-server.org
[status] => sent
[comment] => 250 OK id=1l4Cdk-0000tg-4f
)
You may notice: pid, oid and mt are "person_id", "offer_id" and "message type" scrapped from relating X-Header data.
But for undeliverable e-mail header checks are skipped by the Postfix cleanup server - for better "performance" - so I cannot track undelivered e-mails in my sales application :-/
Any idea how to log queue_id and X-Header data for outgoing messages also in case of undeliverable e-mails???
Please notice - I do not want to filter messages actually. I want to know what has happened with given message sent by the sales application. I need "delivery tracking system" for e-mails.
Workable ideas will be appreciated - thanks ahead!
I try to integrate Postix with an external sales application.
PHP sales application is delivering voucher information via e-mail. It registers related customer-id and order-id information in specific e-mail X-Headers.
I would love to have these data in Postfix log. I was able to rely Postfix log to Rsyslog and pass it via UDP to a simple UDP server where it is organized using queue ids as keys.
Using header_check I was able to successfully collect such a collection for a deliverable message:
Array
(
[queue_id] => 6FDC5900000006187D
[from] => ***@my-server.org
[log_start_time] => 2021-01-26 01:55:28
[message_id] => ***@my-server.org
[log_updt_time] => 2021-01-26 01:55:29
[pid] => 123456
[oid] => 7654321
[mt] => 1
[to] => ***@other-server.org
[status] => sent
[comment] => 250 OK id=1l4Cdk-0000tg-4f
)
You may notice: pid, oid and mt are "person_id", "offer_id" and "message type" scrapped from relating X-Header data.
But for undeliverable e-mail header checks are skipped by the Postfix cleanup server - for better "performance" - so I cannot track undelivered e-mails in my sales application :-/
Any idea how to log queue_id and X-Header data for outgoing messages also in case of undeliverable e-mails???
Please notice - I do not want to filter messages actually. I want to know what has happened with given message sent by the sales application. I need "delivery tracking system" for e-mails.
Workable ideas will be appreciated - thanks ahead!