Sheikh Hânî al-Jubayr, judge at the Jeddah Supreme Court
The marriage contract cannot be terminated except by a divorce issued by the ruler or a duly appointed judge. Since you did not divorce that woman yourself and the said imâm was only an imâm of a mosque and not specialized in marital issues nor appointed to handle such cases for the Muslim community, and since you did not agree to submit yourself to his judgment, your marriage contract is still valid and the woman’s relationship with that other man is unlawful.
My advice to you is to divorce that woman and not try to keep her with you. Having done this, you must still let her know that she has to observe her full `iddah (the waiting period wherein a woman must remain unmarried after being divorced). She should begin her `iddah starting from her last sexual relationship with that other man. Then she must observe a second `iddah on account of her divorce from you. Thereafter, she can marry whomever she likes.
If you want to advise her to leave that man and return to you, it is alright, but do not touch her until she completes the legal `iddah on account of that so-called “marriage”. She must start observing that ‘iddah from the last time she had sexual relations with that other man. After completing that `iddah, she can resume a normal relationship with you without a new marriage contract.
May Allah help you and ease your affairs.
Source: Islam Today