A judge has ruled the state must turn over e-mails to a man who wants to see messages sent between his wife and a male co-worker at a state office.

Franklin County Circuit Judge Phillip J. Shepherd granted Stephen Malmer's open-records request Monday after the state Attorney General's Office said the Justice and Public Safety Cabinet had violated the law by refusing to the release the e-mails.

Malmer, who suspected his wife, Bobbie Malmer, of having an affair, wants to see messages sent between her and former state employee David Moss from 2005 and 2006.

• Click here for FOXNews.com's Personal Technology Center.

Malmer says his wife has acknowledged an affair and supports his efforts but no longer has access to the e-mails and can't provide them herself.

Bobbie Malmer did not immediately return phone and e-mail messages seeking comment Tuesday, and Moss did not immediately return a call.

The cabinet's general counsel had said the e-mails were exempt from public disclosure for reasons including a personal privacy exception to the statute.

"It's been such a nightmare," Stephen Malmer said. "I was horrified by the amount of opposition I ran up against."

The judge noted that the subject matter of the e-mails was private, but he concluded they should be released anyway because they involved the activities of public workers who were on the job.

"The fact that state employees are using state resources to exchange nonwork-related messages during working hours is a matter of legitimate inquiry for the public," Shepherd wrote.

Cabinet attorney Emily Dennis said the agency likely would appeal.

Bobbie Malmer still works for the cabinet. Moss resigned in May 2006 for undisclosed reasons.