ID:               40083
 Updated by:       [EMAIL PROTECTED]
 Reported By:      tuxracer69 at gmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Unknown/Other Function
 Operating System: Linux debi 2.6.17-2-k7 #1 SMP Fr
 PHP Version:      5.2.0
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

The function is a direct wrapper around smfi_getsymval() 
milter function. So the fact it does not return anything can 
be traced directly to milter and not PHP.


Previous Comments:
------------------------------------------------------------------------

[2007-01-09 20:51:26] tuxracer69 at gmail dot com

Description:
------------
The milter SAPI seems unable to get the values of the sendmail macros
using the smfi_getsymval function.

My steup:
0) I compile PHP with "--with-milter --disable-cli --disable-cgi"
1) I create a script milter1.php (code below)
2) I insert in my /etc/mail/sendmail.mc the two lines below:
======
define(`MILTER',`1')dnl
INPUT_MAIL_FILTER(`php-milter1',`S=local:/tmp/milter.sock,F=T,T=S:10m;R:10m;E:10m')dnl
======
3) I start the milter with:
php-milter -D -p /tmp/milter.sock milter1.php
4) I forge a mail to localhot using telnet to port 25
5) I look at the milter logs which shoud display the vaue of the "i"
sendmail macro (the sendmail queueid). 

Reproduce code:
---------------
<?php

function milter_log($msg)
{
    $GLOBALS['log'] = fopen("/var/log/milter.log", "a");
    fwrite($GLOBALS['log'], date("[H:i:s d.m.Y]
p").getmypid()."\t{$msg}\n");
    fclose($GLOBALS['log']);
}

function milter_init() {
    milter_log("-- startup --");
    milter_log("milter_init()");
}

function milter_envfrom($args){
    $queueid=smfi_getsymval("i");
    
    milter_log("queueid=".$queueid);
    milter_log("milter_envfrom(args[])");
    foreach ($args as $ix => $arg) {
        milter_log("\targs[$ix] = $arg");
    }
}
?>


Expected result:
----------------
After having started the milter:

# php-milter -D -p /tmp/milter.sock milter1.php

I forge a mail:

# telnet localhost 25
Trying 127.0.0.1...
Connected to debi.
Escape character is '^]'.
220 debi.local. ESMTP Sendmail 8.13.7/8.13.7/Debian-2; Tue, 9 Jan 2007
21:25:35 +0100; (No UCE/UBE) logging access from: debi(OK)-debi
[127.0.0.1]
helo me
250 debi.local. Hello debi [127.0.0.1], pleased to meet you
mail from: [EMAIL PROTECTED]
250 2.1.0 [EMAIL PROTECTED] Sender ok
quit
221 2.0.0 debi.local. closing connection
Connection closed by foreign host.

I get the queueid from the sendmail logs:
# tail -n 1 /var/log/mail.log
Jan  9 21:25:55 debi sm-mta[14429]: l09KPZRk014429:
[EMAIL PROTECTED], size=0, class=0, nrcpts=0, proto=SMTP,
daemon=MTA-v4, relay=debi [127.0.0.1]

And a  would expect a line in the milter logs saying

[21:25:49 09.01.2007] p14426    queueid=l09KPZRk014429

But (see below the logs I get),  I can not get any value for the "i"
macro.
I am sure it is set. If I strace -v -f the milter I see the queueid in
a read system call.

Actual result:
--------------
The third line in the milter logs shows a blank queueid

tail -f /var/log/milter.log
[21:25:26 09.01.2007] p14426    -- startup --
[21:25:26 09.01.2007] p14426    milter_init()
[21:25:49 09.01.2007] p14426    queueid=
[21:25:49 09.01.2007] p14426    milter_envfrom(args[])
[21:25:49 09.01.2007] p14426            args[0] = [EMAIL PROTECTED]


I tried to modify my PHP code and call the macro "{i}" but it does not
help.


I would say it is a PHP bug and not a sendmail bug; here is my sendmail
version anyway:
# sendmail -d0.1
Version 8.13.7
 Compiled with: DNSMAP LDAPMAP LDAP_REFERRALS LOG MAP_REGEX MATCHGECOS
                MILTER MIME7TO8 MIME8TO7 NAMED_BIND NETINET NETINET6
NETUNIX
                NEWDB NIS NISPLUS PIPELINING SASLv2 SCANF SOCKETMAP
STARTTLS
                USERDB USE_LDAP_INIT XDEBUG

============ SYSTEM IDENTITY (after readcf) ============
      (short domain name) $w = debi
  (canonical domain name) $j = debi.local.
         (subdomain name) $m = local.
              (node name) $k = debi
========================================================




------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=40083&edit=1

Reply via email to