jbostoen/itop-jb-mail-to-ticket-automation-v2

Bug: No check if "message ID" even exists

Closed this issue · 0 comments

// There is a known issue here, probably due to SPAM messages.
// Tried to figure it out but no example yet.
// Sometimes an error is returned which outputs this as subject: "Retrieval using the IMAP4 protocol failed for the following message: <some-id>"
$aResponse = imap_fetch_overview($this->rImapConn, $sRange);
foreach($aResponse as $aMessage) {
if($bUseMessageId) {
$ret[] = array('msg_id' => $aMessage->msgno, 'uidl' => $aMessage->message_id, 'udate' => $aMessage->udate);
}
else {
$ret[] = array('msg_id' => $aMessage->msgno, 'uidl' => $aMessage->uid, 'udate' => $aMessage->udate);
}
}

If use_message_id_as_uid is set to true (= default value in this fork as it is actually recommended for the big e-mail providers such as Outlook and GMail), and the mail provider does NOT offer this property in the IMAP results; a warning is shown.