>В /etc/aliases пишем
>mymail:|/home/user/mail.php
>
>В mail.php читаем стандартный ввод fopen("php://stdin","r") в /etc/aliases дописал:
gpk: |/home/gpk/www/mail/inc/box.php
в /home/gpk/www/mail/inc/box.php:
#!/usr/bin/php
<?
file_put_contents( '/home/gpk/www/mail/inc/log.htm', $txt . "\n(1)\n", FILE_APPEND );
$txt = file_get_contents( 'php://stdin' );
file_put_contents( '/home/gpk/www/mail/inc/log.htm', $txt . "\n(2)\n", FILE_APPEND );
file_put_contents( '/home/gpk/www/mail/inc/log.htm', $txt . "\n\n------\n\n", FILE_APPEND );
file_put_contents( '/home/gpk/www/mail/inc/log.htm', $txt . "\n(3)\n", FILE_APPEND );
?>
в /var/log/syslog вывлдит:
Apr 11 19:01:07 localhost sendmail[4610]: m3BG0ugd004610: from=<*@rambler.ru>, size=467, class=0, nrcpts=1, msgid=<252199787.1208002866.161268808.33448@mcgi47.rambler.ru>, proto=ESMTP, daemon=MTA, relay=mcgi47.rambler.ru [81.19.67.71]
Apr 11 19:01:07 localhost smrsh: uid 8: attempt to use "box.php" (stat failed)
Apr 11 19:01:07 localhost sendmail[4625]: m3BG0ugd004610: to=|/home/gpk/www/mail/inc/box.php, ctladdr=<****@***.**> (8/0), delay=00:00:08, xdelay=00:00:00, mailer=prog, pri=30654, dsn=5.0.0, stat=Service unavailable
/home/gpk/www/mail/inc/log.htm пуст