Thanks ntozier, now I understand what do you mean.
"It is one of multiple ways that osTicket tries to match an email to an existing ticket." In regards to this, we thought that OSTicket used an internal_Id for the ticket, and it was added in the messages as I said in a e-mail before. We thought it because we have from time to time problems with forwarded e-mails sent from one OS_ticket to a different OS_ticket and not creating a new ticket but adding the information to an existing ticket (owned by a different user).
On the other hand, in our company we need OS_ticket to be able to receive e-mails from another ticketing system (not OS_ticket), and be able to act as if it was received from a user. But in this case it happens that allways creates a new ticket when receiving an e-mail from the other ticket system.
For those two reasons we want to create a "bridge" between the mailbox and OSticket that allows us to treat the e-mail before entering OS_Ticket to avoid this two problems. So we would need to know exactly how OS_Ticket establishes that an e-mail matches or not with an existing ticket. Where can we find this information?