The system still will not fetch mail and keep failing to make a connection to the server. However, the code should work!
Here is some test code I wrote to test the connection server:
$mbox=(imap_open( "{mail.med.XXXX.edu:143/imap/novalidate-cert}INBOX" , 'mededuhelp' , 'XXXXX', NULL, 1, array('DISABLE_AUTHENTICATOR' => 'GSSAPI')));
echo "Mailboxes\n";
$folders = imap_listmailbox($mbox, "{mail.med.XXXX.edu:143/imap/novalidate-cert}", "*");
if ($mbox === FALSE) {
echo "(mbox === FALSE) True!\n";
} ELSE {
echo "($mbox === FALSE) False!\n";
}
print_r($mbox);
print_r(imap_errors());
print_r(imap_alerts());
$folders = imap_listmailbox($mbox, "{mail.med.XXXX.edu:143/imap/novalidate-cert}", "*");
echo " Mailboxes\n";
if ($folders == false) {
echo "Call failed\n";
} else {
foreach ($folders as $val) {
echo $val . "\n";
}
}
echo " Headers in INBOX\n";
$headers = imap_headers($mbox);
if ($headers == false) {
echo "Call failed\n";
} else {
foreach ($headers as $val) {
echo $val . "\n";
}
}
imap_close($mbox);
print_r(imap_last_error());
Here is the output of above code:
php /var/www/html/test.php
Mailboxes
(Resource id #4 === FALSE) False!
Resource id #4 Mailboxes
{mail.med.XXXX.edu:143/imap/novalidate-cert}Calendar
{mail.med.XXXX.edu:143/imap/novalidate-cert}Contacts
{mail.med.XXXX.edu:143/imap/novalidate-cert}Deleted Items
{mail.med.XXXX.edu:143/imap/novalidate-cert}Drafts
{mail.med.XXXX.edu:143/imap/novalidate-cert}INBOX
{mail.med.XXXX.edu:143/imap/novalidate-cert}Journal
{mail.med.XXXX.edu:143/imap/novalidate-cert}Junk E-Mail
{mail.med.XXXX.edu:143/imap/novalidate-cert}Notes
{mail.med.XXXX.edu:143/imap/novalidate-cert}Outbox
{mail.med.XXXX.edu:143/imap/novalidate-cert}Sent Items
{mail.med.XXXX.edu:143/imap/novalidate-cert}Suggested Contacts
{mail.med.XXXX.edu:143/imap/novalidate-cert}Sync Issues
{mail.med.XXXX.edu:143/imap/novalidate-cert}Sync Issues/Conflicts
{mail.med.XXXX.edu:143/imap/novalidate-cert}Sync Issues/Local Failures
{mail.med.XXXX.edu:143/imap/novalidate-cert}Sync Issues/Server Failures
{mail.med.XXXX.edu:143/imap/novalidate-cert}Tasks
Headers in INBOX
U 1)21-Feb-2012 XXXXX, XXXX X. test (2618 chars)
I have made a change in line 2998 of support.module to the imap_open:
from:
stream = imap_open($connect, $username, $password);
to:
stream = imap_open($connect, $username, $password, NULL, 1, array('DISABLE_AUTHENTICATOR' => 'GSSAPI'));
and it still refuses to connect!
I get this error:
Fetching mail for XXXX HELP DESK...
Failed to download messages for XXXX HELP DESK, connection to mail server failed.warning: imap_open(): Couldn't open stream {mail.med.XXXX.edu:143/imap/novalidate-cert}INBOX in /var/www/html/sites/all/modules/support/support.module on line 2998.
Mail server connection failure: connect({mail.med.XXXX.edu:143/imap/novalidate-cert}INBOX), username(mededuhelp), password(XXXXX)
Imap error: Can't connect to mail.med.XXXX.edu,143: Permission denied for user mededuhelp
Closed: outdated
1.8
Code