2

I have set up system where all mails are piped to my script. In master.cf I have:

phptran unix - n n - - pipe flags=DFORq user=nobody argv=/usr/bin/php5 /root/phptran.php ${sender} ${recipient}

I can get mail and headers but I cannot get all of RCPT TO command, specifically NOTIFY part, for example in command

RCPT TO:user@domain.com NOTIFY=SUCCESS,FAILURE

How can I get this information from script? Is maybe there a way to put that inside headers?

Any guidance would be highly appreciated.

Sebastijan
  • 31
  • 2

1 Answers1

1

I found solution but I realy don't like it (too complicated). So if anybody has any other idea I would highly appreciate.

From message header I can get ESMTP ID of message. With message ID I can get content of message in active queue (using postcat -q ).

In postcat result there is named_attribute: notify_flags, which is bitwise or from following values: never: 1 success: 2 failure: 4 delay: 8

Sebastijan
  • 31
  • 2