php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28226 imap-c-client installed, but not working as expected, undefined functions
Submitted: 2004-04-30 01:17 UTC Modified: 2004-05-05 22:41 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: dev dot null at multiartstudio dot com Assigned:
Status: Not a bug Package: IMAP related
PHP Version: 4.3.6 OS: rh7.2
Private report: No CVE-ID: None
 [2004-04-30 01:17 UTC] dev dot null at multiartstudio dot com
Description:
------------
hello to all,
sorry im coming up with that again, i saw and read other bugreports about that, but this doesnt solve my problem.

i tried to get help from the list, but its growing to fast as somebody will take acknowledge to my request.
also i searched the web, but this was not very useful.

i have some trouble using imap functions with php.
php 4.3.6 has been compiled with --with-imap=/usr/local
and the imap-c-client2004rc9 include files rfc822.h/mail.h/linkage.h where copied to /usr/local/include

phpinfo() tells me it has in version 4.1 also.
also courier-imap works fine.

now i tried to write a tool to get all accounts from database and login via imap to list the quotas. 

Reproduce code:
---------------
$MAILSRV="MYIP:143/imap";
$mbox = imap_open ("{".$MAILSRV."}INBOX", "user", "pass")
    or die("can't connect: " . imap_last_error());

...this is what i use to connect my imapserver, MYIP=xxx.xxx.xxx.xxx, oficial ip with ptr
but connection fails and server says:
*
Warning*: imap_open(): Couldn't open stream {217.175.253.115:143/imap}INBOX in */home/WWW/m000000/share/html/.testflug.de/imapquota.php* on line *3*
can't connect: Can not authenticate to IMAP server: Authentication failed.

but user and pass is the same as for pop3,
and if i use pop3 login:

$MAILSRV="MYIP:110/pop3";

then connecting the server goes well!
my imap server is courier 3.0.3 (but also on 1.4x and 2.x this script fails) 

Expected result:
----------------
$MAILSRV="MYIP:143/imap";
$mbox = imap_open ("{".$MAILSRV."}INBOX", "user", "pass")
    or die("can't connect: " . imap_last_error());

...this is what i use to connect my imapserver, MYIP=xxx.xxx.xxx.xxx, oficial ip with ptr
but connection fails and server says:
*
Warning*: imap_open(): Couldn't open stream {217.175.253.115:143/imap}INBOX in */home/WWW/m000000/share/html/.testflug.de/imapquota.php* on line *3*
can't connect: Can not authenticate to IMAP server: Authentication failed.

but user and pass is the same as for pop3,
and if i use pop3 login:

$MAILSRV="MYIP:110/pop3";

then connecting the server goes well!
my imap server is courier 3.0.3 (but also on 1.4x and 2.x this script fails) 



Actual result:
--------------
yours sincerely
volker


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-30 01:25 UTC] dev dot null at multiartstudio dot com
mail-log says:
==> /home/LOGS/MAIL/maillog <==
 tomcat imapd: Connection, ip=[::ffff:MYIP]
 tomcat imapd: LOGOUT, ip=[::ffff:MYIP]
--
not wondering why login fails.....
there was NO login into imap... no username given
--
normally logfile looks like:
==> /home/LOGS/MAIL/maillog <==
tomcat imaod: Connection, ip=[::ffff:217.175.253.115]
tomcat imapd: LOGIN, user=m000000-410, ip=[::ffff:217.175.253.115]
tomcat imapd: LOGOUT, user=m000000-410, ip=[::ffff:217.175.253.115], top=0, retr=0


normally there is also a LOGIN before LOGOUT, also the username is missing....


ok, i use pop3, and hope imap functions can work on it ;) dont know.....
i try to get quota from server:
...

$quota = imap_get_quotaroot($mbox, "INBOX");
or
$quota = imap_get_quota($mbox, "INBOX");
....

and php tells me:

*Fatal error*: Call to undefined function: imap_get_quotaroot()

but why? php.net says:
This function is currently only available to users of the c-client2000 or greater library.
and i have installed he library and compiled static into php, php static into apache, everythings working very well, except my own imap scripts ;)

it seems that some of the functions may not be implemented anymore or not yet? maybe i did something wrong....
thanks in advance for any kind of help and hints, tips :)
a bug in php?
 [2004-05-03 01:05 UTC] dev dot null at multiartstudio dot com
Hello again,

i now solved the problem of the undefined functions.
it was because c-client brings some include-files, and also have some other stuff in it, so linking the header files to /usr/local/include is not everything, you better compile php by gving it the source directory of c-client and add symlinks for include and lib.... some of this is mentioned at the php-site user comments for c.-client.

but this didnt fix the problem of broken imap connections.
i itested everything posted on php.net comments for imap_open etc. but with php 4.3.6 and c-client, imap connections fails for the same user for who pop3 login works fine. user can access imap through any client etc, but not with imap.
the log output of php and courier shows the error (bug), php doesnt give a username to the imap daemon, here is what it looks like: (username is missing at all with imap and php)



==> /home/LOGS/PHP/php.log <==
[03-May-2004 00:53:28] PHP Warning:  imap_open(): Couldn't open stream {MYIP:143/imap/novalidate-cert}INBOX in /somePath/recycle.php on line 40

more errors follow....because of broken connection!

mailog of courier says:

==> /home/LOGS/MAIL/maillog <==
May  3 00:53:28 tomcat imapd: Connection, ip=[::ffff:MYIP]
May  3 00:53:28 tomcat imapd: LOGIN: DEBUG: ip=[::ffff:MYIP], command=STARTTLS
May  3 00:53:28 tomcat imapd: LOGIN: DEBUG: ip=[::ffff:MYIP], command=CAPABILITY
May  3 00:53:28 tomcat imapd: LOGIN: DEBUG: ip=[::ffff:MYIP], command=AUTHENTICATE
May  3 00:53:28 tomcat imapd: LOGIN: DEBUG: ip=[::ffff:MYIP], command=LOGOUT
May  3 00:53:28 tomcat imapd: LOGOUT, ip=[::ffff:MYIP]

normally! there is a username logged!
like so:
==> /home/LOGS/MAIL/maillog <==
May  3 01:03:13 tomcat imapd: Connection, ip=[::ffff:MYIP]
May  3 01:03:13 tomcat imapd: LOGIN: DEBUG: ip=[::ffff:MYIP], command=CAPABILITY
May  3 01:03:26 tomcat imapd: LOGIN: DEBUG: ip=[::ffff:MYIP], command=LOGIN
May  3 01:03:26 tomcat imapd: LOGIN: DEBUG: ip=[::ffff:MYIP], username=m000000-400
May  3 01:03:26 tomcat imapd: LOGIN, user=m000000-400, ip=[::ffff:MYIP], protocol=IMAP

is this still a bug in php?

any comments would be greatly appreciated,
i would be grateful if you can send any comments, because there many users having the same problem outside here in the world ;) 

yours sincerely
volker
 [2004-05-05 22:41 UTC] sniper@php.net
It's still not bug in PHP. Please ask support questions about how to use PHP someplace else..

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 06:01:30 2024 UTC