BIG Update today
We’re now using the email's actual UID instead of sequence numbers generated based on its position in the mailbox, as that number can change when new messages arrive during the check.
This update should resolve the race condition that occasionally causes multiple tickets to be created from a single email, particularly in busy mailboxes.
We also added some debug code that logs each time the parser runs, detailing how long it operated, how many emails were processed into tickets, and how many emails are unprocessed (Not turned converted into a ticket) in the audit log.
Additionally, messages that aren't converted into tickets will no longer be marked as read; instead, they'll simply be flagged. We might consider removing the flagging altogether, as it may be unnecessary since we're using the email message UIDs instead.