The company, which was bought by Verizon in July for US$4.83 billion, agreed to scan all mail accounts in line with a classified directive from the US government, Reuters said, citing two former Yahoo! workers and a third person who had been informed about it.
The directive came from the NSA or the FBI, the sources said.
What the spy agencies were after was not specified by the sources, who said only that they had asked Yahoo! to search for a set of characters.
Yahoo! chief executive Marissa Mayer bowed to the demand by US spy agencies.
In an article titled "Delete your Yahoo! account", the website The Intercept said the unwillingness of Yahoo! chief executive Marissa Mayer to put up any resistance to the intelligence agencies' request had likely been responsible for the departure of Alex Stamos, then the chief security officer for Yahoo!.
Stamos now works for Facebook as head of security but when The Intercept contacted him, he said he was not saying anything about Yahoo!. Asked whether Facebook had faced similar demands, Stamos told The Intercept that he would pass on the request to the communications staff.
Yahoo before: We fight any requests we deem improper or overbroad.— Christopher Soghoian (@csoghoian) 4 October 2016
Yahoo now: We follow the law.
The Intercept also said it had contacted Apple to inquire whether the company had faced such demands and was pointed to a part of a recent public letter by chief executive Tim Cook which an Apple spokesperson still applied:
"Finally, I want to be absolutely clear that we have never worked with any government agency from any country to create a backdoor in any of our products or services. We have also never allowed access to our servers. And we never will."
And a Google spokesperson told The Intercept, "We've never received such a request, but if we did, our response would be simple: 'no way'."
Microsoft was also contacted by The Intercept and issued this statement: "We have never engaged in the secret scanning of email traffic like what has been reported today about Yahoo!."
But the Microsoft spokesperson would not comment on the record as to whether such demands had been made on the company.
Nu Wexler, the public policy communications officer at Twitter, told The Intercept: "Federal law prohibits us from answering your question, and we’re currently suing the Justice Department for the ability to disclose more information about government requests."
Can somebody ask the President to read today's news? https://t.co/0iwpo9gcPE— Edward Snowden (@Snowden) 4 October 2016
Commenting on the Reuters report, the American Civil Liberties Union said in a statement: "Based on this report, the order issued to Yahoo appears to be unprecedented and unconstitutional. The government appears to have compelled Yahoo to conduct precisely the type of general, suspicionless search that the Fourth Amendment was intended to prohibit."
Staff attorney Patrick Toomey said: "It is deeply disappointing that Yahoo! declined to challenge this sweeping surveillance order, because customers are counting on technology companies to stand up to novel spying demands in court. If this surveillance was conducted under Section 702 of the Foreign Intelligence Surveillance Act, this story reinforces the urgent need for Congress to reform the law to prevent dragnet surveillance and require increased transparency."