SAN FRANCISCO — Yahoo Inc. must face a class action challenging the company’s interception, scanning and storage of incoming emails, a federal judge ruled Tuesday.

U.S. District Judge Lucy Koh of the Northern District of California certified a nationwide class in a privacy suit brought on behalf of non-Yahoo mail subscribers who claim their emails were impermissibly scanned to help sell targeted ads.