A California federal court judge granted preliminary approval of a settlement agreement in a lawsuit accusing Yahoo of reading e-mail messages for ad-targeting purposes.

Several plaintiffs filed class actions against the company, alleging that Yahoo violated the Stored Communications Act and the California Information Privacy Act.

Yahoo successfully narrowed its potential liability by pointing to its terms of service which notified users that the company analyzes e-mails for advertising purposes. The court certified two classes of the remaining plaintiffs (a national class under the SCA and a California class pursuing the CIPA claim), all of whom received messages from Yahoo users and argued they had no knowledge of Yahoo's terms of service because they were not Yahoo users themselves.

The parties then reached a deal.

Pursuant to the agreement, Yahoo will not pay any money to consumers (although the company may pay up to $4 million to class counsel). Instead, the company agreed to make technical changes to the way it scans e-mails for a three-year period, possibly longer, and henceforth only read the messages once they are no longer in transit.

In addition, the company will add language that provides additional warnings. For example, on its Privacy Center page, Yahoo will post the following statement: "Yahoo analyzes and sorts all communications content, including email content from incoming and outgoing mail." The company's Mail page will incorporate new language stating, "Yahoo may share keywords, package tracking and product identification numbers with third parties in order to enhance your user experience and provide targeted ads."

U.S. District Court Judge Lucy H. Koh noted that the nature of the claims in the consolidated complaints would have only allowed the class to obtain injunctive relief and not monetary damages. She also noted that the deal did not involve the release of any claims for monetary damages against Yahoo, leaving class members with that opportunity to separately pursue.

"The Settlement Agreement provides Plaintiffs the relief that Plaintiffs seek under both the SCA and CIPA: Yahoo will now only analyze emails for content when these emails are no longer in transit and after these emails reach a Yahoo user's inbox or outbox," Judge Koh wrote.

A hearing to consider final approval of the settlement agreement was scheduled for August.

To read the settlement agreement in In Re Yahoo Mail Litigation, click here.

To read the order granting preliminary approval, click here.

Why it matters: The settlement ends more than two years of litigation over charges that Yahoo illegally scanned e-mails for ad-targeting purposes. The company managed to avoid paying any award to class members agreeing to add language about its scanning practices and waiting to scan messages until they are no longer in transit.