} else { if ($action == 'indexsince') { $totalcount = $selectresult['totalcount']; $searchresult = handmadeimap_earliest_index_since_time($connection, $time, $totalcount); if (!handmadeimap_was_ok()) { die("handmadeimap_earliest_index_since_time() failed: " . handmadeimap_get_error() . "\n"); } print "{$searchresult}:{$totalcount}\n"; } } } } handmadeimap_close_connection($connection); } else { if ($protocol == 'pop3s') { $connection = create_pop3_connection($mailserver, $port, $user, $password); if ($action == 'list') { die('Action "list" not supported for POP3'); } if ($action == 'totalcount') { $totalcount = handmadepop3_get_message_count($connection); echo $totalcount; } else { if ($action == 'fetchheaders') { $fetchresult = handmadepop3_fetch_message_headers($connection, $earliesttime); if (!handmadepop3_was_ok()) { die("FETCH failed: " . handmadepop3_get_error() . "\n"); } $messagexml = message_headers_to_xml($fetchresult, 'received'); print '<?xml version="1.0" encoding="ISO-8859-1"?><messagelist>' . "\n"; //'
} else { if ($action == 'indexsince') { $totalcount = $selectresult['totalcount']; $searchresult = handmadeimap_earliest_index_since_time($connection, $time, $totalcount); if (!handmadeimap_was_ok()) { die("handmadeimap_earliest_index_since_time() failed: " . handmadeimap_get_error() . "\n"); } print "{$searchresult}:{$totalcount}\n"; } } } } handmadeimap_close_connection($connection); } else { if ($protocol == 'pop3s') { $connection = create_pop3_connection($host, $port, $user, $password); if ($action == 'list') { die('Action "list" not supported for POP3'); } if ($action == 'totalcount') { $totalcount = handmadepop3_get_message_count($connection); echo $totalcount; } else { if ($action == 'fetchheaders') { $fetchresult = handmadepop3_fetch_message_headers($connection, $earliesttime); if (!handmadepop3_was_ok()) { die("FETCH failed: " . handmadepop3_get_error() . "\n"); } $messagexml = message_headers_to_xml($fetchresult, 'received'); print '<?xml version="1.0" encoding="ISO-8859-1"?><messagelist>' . "\n"; //'