By: MARTHA MENDOZA
SAN JOSE, Calif. (AP) -- Google's attorneys say their long-running practice of electronically scanning the contents of people's Gmail accounts to help sell ads is legal, and are asking a federal judge to dismiss a lawsuit that seeks to stop the practice.

In court records filed in advance of a federal hearing scheduled for Thursday in San Jose, Google argues that "all users of email must necessarily expect that their emails will be subject to automated processing."

The class action lawsuit, filed in May, says Google "unlawfully opens up, reads, and acquires the content of people's private email messages" in violation of California's privacy laws and federal wiretapping statutes. The lawsuit notes that the company even scans messages sent to any of the 425 million active Gmail users from non-Gmail users who never agreed to the company's terms.

Google has repeatedly described how it targets its advertising based on words that show up in Gmail messages. For example, the company says if someone has received a lot of messages about photography or cameras then it might display an advertisement from a local camera store. Google says the process is fully automated, "and no humans read your email..."

"This case involves Plaintiffs' effort to criminalize ordinary business practices that have been part of Google's free Gmail service since it was introduced nearly a decade ago," argue company attorneys in their motion to dismiss the case.

Privacy advocates have long questioned the practice.

"People believe, for better or worse, that their email is private correspondence, not subject to the eyes of a $180 billion corporation and its whims," said Consumer Watchdog president Jamie Court.

Copyright 2013 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.

About The Author

Zoë Schlanger is Frontpage Editor at TPM. Zoë was a TPM intern in 2011, and prior to returning here she was editor in chief of NYU Local, the alternative independent student news site at NYU. Zoë has interned at places like the Nation, InsideClimate News, The Rachel Maddow Show and Gothamist. She can be reached at zoe@talkingpointsmemo.com.