What is it 2004?! of course it's legal, same as "scanning" mail content to identify spam or enable full text search. This lawsuit is ridiculous, it's either a money making scam or a PR stunt or both.
It's a stupid question. They want webmail services (nay all cloud services) to cease automatically processing data they store. It's nonsense, that is what these services are all about, they want them to become useless, basically destroying their whole functionality and the economy related to them.