Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php imap_search since problem

Tags:

php

imap

I am using the following code to fetch all mails since 1 day less -

$yesterday = date("Y-m-d", strtotime ("-1 days"));
$searchQuery = 'SINCE "'.$yesterday.'"';

if($this->open($folder)) {
    $imap_search = imap_search($this->_imap, $searchQuery);
}

This works fine on my dev windows machine but when i put it on the test production server it doesn't work. I have even tried ALL as the search parameter but it does not seem to fetch anything. The connection to the mail account (the $this->_imap object) seems to be fine.

Any ideas?

like image 873
pinaki Avatar asked Dec 11 '25 00:12

pinaki


1 Answers

Since noone else answered, I will put it as a wiki for whoever comes in after me looking for the same issue. The problem I faced was with the php version used on the server (5.2.1). Seems like it has a bug which causes it to segfault. Upgrading the php version fixed the issue for me.

like image 120
pinaki Avatar answered Dec 13 '25 15:12

pinaki