rob.mydomain.ru. A ip-- rob.mydomain.ru. MX rob.mydomain.ru.
robot: "|php -q ///.php"
robot
is the name of the mailbox;///.php
- script processing incoming.newaliases
commandmain.cf
settings, I recommend adding a parameter:recipient_delimiter = +
robot+someId@rob.mydomain.ru
someId
can be a user id or any other data. <?php /** * * * smtp- RECIPIENT, SENDER postfix * $_ENV; : * http://www.postfix.org/local.8.html EXTERNAL COMMAND DELIVERY */ // STDIN $msg = file_get_contents("php://stdin"); // $sender = getenv('SENDER'); // $recipient = getenv('RECIPIENT'); // list($header, $body) = explode("\n\n", $msg, 2); // Subject: From: $subject = ''; $from = ''; $headerArr = explode("\n", $header); foreach ($headerArr as $str) { if (strpos($str, 'Subject:') === 0) { $subject = $str; } if (strpos($str, 'From:') === 0) { $from = $str; } } // : $logMsg = "=== MSG ===\n"; $logMsg .= "SENDER: $sender\n"; $logMsg .= "RECIPIENT: $recipient\n"; $logMsg .= "$from\n"; $logMsg .= "$subject\n\n"; $logMsg .= "$msg\n"; file_put_contents('/tmp/inb.log',$logMsg, FILE_APPEND);
Source: https://habr.com/ru/post/126448/
All Articles