Thanks to a judge's order, Google must face another proposed class-action lawsuit over its scanning of Gmail. The issue is a lingering headache for the search giant, which has faced allegations for years now that scanning Gmail in order to create personalized ads violates US wiretapping laws.

In a 38-page order (PDF), US District Judge Lucy Koh rejected Google's argument that the scanning takes place within the "ordinary course of business."

"Not every practice that is routine or legitimate will fall within the scope of the 'ordinary course of business'," Judge Koh wrote.

Koh noted that while Google has to scan for other reasons, like virus and spam prevention, the company didn't have to scan for advertising purposes. She noted that in April 2014, Google "ceased intercepting, scanning, and analyzing, for advertising purposes, the contents of emails transmitted via Google Apps for Education."

According to Koh, that shows that Google is able to provide Gmail, at least to some users, without scanning email for ad purposes.

The order was published on Friday and first reported earlier today by Courthouse News. The ruling means that Google won't be able to get the lawsuit, which was filed in September, thrown out at an early stage.

However, the plaintiffs are a long way from seeing a payday. Google will likely fight hard to defend the way it has long run its Gmail service. The plaintiffs still have yet to pass key hurdles, including forming a class, which proved impossible in an earlier lawsuit.

Koh's order reviews the history of those earlier privacy cases, the first of which was filed in 2010. They were filed in various districts and ultimately consolidated in Koh's court as In re Google Inc. Gmail Litigation.

While Google wasn't able to get that suit thrown out either, the individual plaintiffs all dismissed their cases with prejudice after they failed to form a class. In that case, Koh ruled that the question of whether the plaintiffs had provided consent to scan their Gmail needed "individualized inquiries" and couldn't be addressed as a class action.

In the case Koh ruled on Friday, Matera v. Google, the plaintiffs are seeking to represent only users who do not use Gmail and have never had a Gmail account, but have still had the content of their emails scanned because they interacted with Gmail users. The plaintiffs in Matera say the scanning violates both the federal Electronic Communications Privacy Act and California state privacy laws.