Bug 63809 - imap support non-functional in latest php
imap support non-functional in latest php
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: php (Show other bugs)
7.3
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Phil Copeland
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-04-18 18:25 EDT by David Lawrence
Modified: 2007-04-18 12:42 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-04-18 18:25:43 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description David Lawrence 2002-04-18 18:25:38 EDT
Description of Problem:  
imap support not behaving properly in latest php-imap package. If I downgrade 
to php that shipped with 7.2 I can get this to work. Here is the sample script 
I am using to test. 
 
<html> 
<head><title> PHP IMAP Test Page </title></head> 
<body bgcolor="#ffffff"> 
 
<?php 
 
$username = "test"; 
$password = "password"; 
$mailserver = "127.0.0.1:143"; 
 
$mbox = imap_open ("\{$mailserver}INBOX", $username, $password); 
 
echo "<p><h1>Mailboxes</h1>\n"; 
$folders = imap_listmailbox ($mbox, "{localhost}", "*"); 
 
if ($folders == false) { 
        echo "Call failed<br>\n"; 
} else { 
        while (list ($key, $val) = each ($folders)) { 
                echo $val."<br>\n"; 
        } 
} 
 
echo "<p><h1>Headers in INBOX</h1>\n"; 
$headers = imap_headers ($mbox); 
 
if ($headers == false) { 
        echo "Call failed<br>\n"; 
} else { 
        while (list ($key,$val) = each ($headers)) { 
                echo $val."<br>\n"; 
        } 
} 
imap_close($mbox); 
 
?> 
 
</body> 
</html> 
 
Here is the output I get in the browser. 
 
Warning: Couldn't open stream {localhost:143}INBOX in 
/var/www/html/test_imap.php on line 11 
  
Mailboxes 
Warning: Supplied argument is not a valid imap resource in 
/var/www/html/test_imap.php on line 14 
 Call failed 
  
Headers in INBOX 
Warning: Supplied argument is not a valid imap resource in 
/var/www/html/test_imap.php on line 25 
 Call failed 
  
Warning: Supplied argument is not a valid imap resource in 
/var/www/html/test_imap.php on line 34 
   
 
Version-Release number of selected component (if applicable):  
php-4.1.2-7 
php-imap-4.1.2-7 
  
Additional Information:  
I have properly enable IMAP support in xinet.d and I can successfully connect 
as the test user when doing the following line from the console 
 
[test@dhcp59-206 test]$ mutt -f '{localhost:143}INBOX'
Comment 1 Phil Copeland 2002-04-19 03:42:02 EDT
This is caused by a change of behaviour.

Even if you don't ASK for ssl negotiation, the connection will always try and
negotiate ssl and when the client tries to validate the server's certificate, it
fails.

The script is *almost* correct.
The problem is that the imap/ssl interaction uses a self signed certificate that
we supply that instead of being signed by a cert authority,  ergo the ssl
connection will fail because it's not signed by a trusted authority.

You need to change
  $mailserver = "127.0.0.1:143"; 
to
  $mailserver = "127.0.0.1:143/novalidate-cert"; 

and suddenly everything will be fine again.. or you could go pay lots of money
to a key certificate authority (CA) and get yourself a certificate that will
pass the validation checks.

Phil
=--=

Note You need to log in before you can comment on or make changes to this bug.