Hi -
I'm not sure if this is the right place for this. If not
can someone please point me to an appropriate place?
That said, I've been trying to invoke a php script from the
postfix mta. the Email is delivered just fine to 'localuser',
the postfix log shows no errors, yet there is no indication
that the script ever ran. All the script does is create
several files and ouput some text to them. Works fine from
the console.
Anyone have any ideas how to go forward troubleshooting this?
Thanks,
Gene
Details follow below ...
Postfix runs as user 'postfix'.
Script permissions are:
-rwxrwxrwx 1 postfix localuser 236 Apr 27 08:47 test4.php
From /etc/mail/aliases:
testuser: localuser, "|/usr/local/bin/php -q /home/localuser/testmail/test4.php"
I've also tried:
testuser: localuser, "/home/localuser/testmail/test4.php"
with #!/usr/local/bin/php as the first line in the php script.
The following is from Postfix's log file (Times & other irrelevant junk removed):
brightstar postfix/local[39848]: 8645B385: to=<localuser@domain.net>,
orig_to=<testuser@brightstar.domain.net>, relay=local, delay=0.19,
delays=0.16/0.01/0/0.02, dsn=2.0.0, status=sent (delivered to mailbox)
brightstar postfix/local[39848]: 8645B385: to=<testuser@brightstar.domain.net>,
relay=local, delay=0.31, delays=0.16/0.01/0/0.14, dsn=2.0.0, status=sent
(delivered to command: /usr/local/bin/php -q /home/localuser/testmail/test4.php)
brightstar postfix/qmgr[1017]: 8645B385: removed
The script:
<?php
$pta = fopen('pointa', 'w');
fputs($pta,"Success pta\n");
fclose($pta);
$ptb = fopen('pointb', 'w');
fputs($ptb,"Success ptb\n");
fclose($ptb);
$ptc = fopen('pointc', 'w');
fputs($ptc,"Success ptc\n");
fclose($ptc);
?>