A federal judge has defused a potentially massive privacy class action targeting Google’s scanning of Gmail messages to help sell ads.

In a 41-page order issued Tuesday evening, U.S. District Judge Lucy Koh of the Northern District of California shot down plaintiffs’ bids to certify sweeping classes of email users. Plaintiffs accused Google Inc. of intercepting Gmail messages to mine users’ personal information in violation of the Electronic Communications Privacy Act and state wiretap laws. They stressed that Google’s uniform practices made their claims perfect for class treatment.