I can't find any change I have made that may cause such a behaviour.
But I've got a question regarding the source code in class.pop3.php:
function fetchTickets($emailid,$max=20,$deletemsgs=false){
$nummsgs=imap_num_msg($this->mbox);
//echo 'New Emails: '. $nummsgs;
for($i=1; $i<=$nummsgs; $i++){
if($this->createTicket($i,$emailid)){
if($deletemsgs)
imap_delete($this->mbox,$i);
}
if($max && $i>=$max)
break;
}
<USERMENTION username="imap_expunge">@imap_expunge</USERMENTION>($this->mbox);
db_query('UPDATE '.POP3_TABLE.' SET errors=0, lastfetch=NOW() WHERE email_id='.db_input($emailid));
return $i;
}
The function is called via $pop3->fetchTickets($row,30,$row?true);
Now, osTicket fetches only 30 mails from the server. And then, 5 minutes later, it fetches again 30 mails - but unfortunately exactly the same 30 messages. Of course it does, because although $nummsgs is getting bigger with every new mail on the server the loop still starts with 1 and breaks with 30.
I think here is missing a mechanism which checks if the mail has already been imported.
And: There needs to be a way to ensure that closed or deleted tickets are not created anew if the messages are still on the server (we don't delete mails from the server, we use IMAP&POP3 and keep the mails)