<?php
set_time_limit(900);
include '_dirinfo.php';
include(PATH_TO_ROOT.'init.php');
include(PATH_TO_ROOT."_support/class.db.php");

include 'MailCatcher.php';

//$db = new db;
$db->ChangeDatabase("Warpit_Webuserspool");	


$mc = new MailCatcher($db);
$tmp =  $mc->catch_mails("{212.18.50.27:110/pop3/notls}INBOX","bostjan.rmplus.si","ritkica007");

if($tmp>0)
	echo "{success:true,newMsgs:true, note: 'Uspesno zapisal $tmp mailov!'}";
elseif($tmp===0)
	echo "{success:true,newMsgs:false, note:'Ni novih sporočil.'}";
else
	echo "{success:false,note:\"Napaka pri zapisovanju v bazo: ".$db->GetError().'"}';

?>