Microsoft is in the process of dismissing its lawsuit against the Department of Justice after the government changed its policy related to secrecy orders attached to searches of emails.

Microsoft sued the U.S. government in 2016, saying it used overly broad gag orders with search warrants for customer emails and information stored in the cloud. The gag orders often prevented Microsoft, and other tech companies, from telling customers that the government had obtained their data.

The Department of Justice issued a memo last week saying it would allow email providers to notify customers unless there was specific protection order obtained with the warrant. Such protection orders should only apply for as long as necessary, DOJ said.

"This is an important step for both privacy and free expression," Microsoft President Brad Smith wrote in a blog post Monday.

A judge ruled earlier this year that Microsoft's lawsuit was allowed to continue, after the government sought to dismiss it.

Microsoft has challenged the government in court several times over customer privacy and how much reach the government has into digital storage. It is calling for Congress to update laws governing digital communications to bring them in line with modern technology, an issue several other tech companies and representatives have also taken up.

Past gag orders were sometimes indefinite, Microsoft said, meaning the company could never tell customers about the warrant. Privacy protections should apply to digital data as well as physical data, the company said.

"We believe strongly that these fundamental protections should not disappear just because customers store their personal information in the cloud rather than in file cabinets or desk drawers," Smith wrote.

A separate Microsoft suit involving the U.S. government's access to emails held in an Irish data center is scheduled to be heard by the Supreme Court.