|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65974 Unable to fetch emails from exchange server using imap
Submitted: 2013-10-27 08:18 UTC Modified: -
Avg. Score:4.5 ± 0.7
Reproduced:7 of 8 (87.5%)
Same Version:4 (57.1%)
Same OS:7 (100.0%)
From: anchal56 dot er at gmail dot com Assigned:
Status: Open Package: IMAP related
PHP Version: Irrelevant OS: LINUX
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: anchal56 dot er at gmail dot com
New email:
PHP Version: OS:


 [2013-10-27 08:18 UTC] anchal56 dot er at gmail dot com
I am using PHP IMAP tools to fetch the emails from various email server.

My code works for various email server like gmail, ymail etc, but when it comes to exchange server, I am able to make a hit on the exchange server but can't be able to fetch the mails from exchange server.

I used various php header like unseen/ALL etc but still i am not able to fetch the emails, instead I get only true as a response.

Test script:
if(strcmp($m_serv,'w2010ExchangeServer')==0 OR strcmp($m_serv,'w2003ExchangeServer')==0)
    // die('Could not write to file in exchange');  
    $str =  "{".$m_serv.":".$m_port."/imap/ssl}".$m_folder;          
    $m_mail = imap_open($str , $m_username, $m_password, NULL, 1, array('DISABLE_AUTHENTICATOR' => 'GSSAPI')) or die("ERROR : " . imap_last_error());   // pop is 993
    // die('Could not write to file'); 
    $m_mail = imap_open ($str, $m_username, $m_password) or die("ERROR : " . imap_last_error());
$m_gunixtp = array(2592000, 1209600, 604800, 259200, 86400, 21600, 3600);
//$m_gdmy = date('d-M-Y', time() - $m_gunixtp[$m_t]);
//$m_gdmy = date ( "d M Y", strToTime ( "-7 days" ) );
//$m_search=imap_search ($m_mail, 'UNSEEN SINCE ' . $m_gdmy . '');
//$m_search=imap_search ($m_mail, 'UNSEEN SINCE '.$m_gdmy.'');
//$m_search=imap_search ($m_mail, 'UNSEEN');
//$mc="UNSEEN TO ".$m_username;
$myFile = 'test.txt';
$fh = fopen($myFile, 'a+') or die("t open file");
//$stringData = $m_search;
fwrite($fh, $mc);
$m_search=imap_search ($m_mail, $mc);


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Sep 18 07:02:04 2020 UTC