I have altered the script to allow answers from third-party on same ticket (i removed the unique email filter).
Now, when a response from a third-party (not from the creator of the ticket) is added to the db, it gets multiplied until the mail is deleted and script can no longer find it on server.
I also have set the script to delete emails after reading them, but some are deleted and some are not. Without a clear pattern.
What should i do to allow the script to add the response only once?