Apparently the USPS does make an image of every envelope processed. http://www.nytimes.com/2013/07/04/us/monitoring-of-snail-mai...

But the basic idea is yes, you must comply with all laws. If you can prove it violates the constitution you can have a court invalidate the law (but before that it would be illegal to violate it). There are often laws that you could argue conflict with this law and get out of it that way.

Often if you have lots of money you can influence the enforcement of laws. That doesn't exempt you from a law but often it isn't really an issue of what the law allows but what the regulator or prosecutors decide to enforce. And if you can't do that you can fight the attempts by the regulators and prosecutors (and law enforcement officials) and argue they have not legal right to do what they are seeking to do. See Apple, for a recent example.

Your rights are often not just a matter of the law but of to what extent the government and law enforcement are bound by laws. In the recent experience in the USA we have examples of the Bush and Obama administrations seeking to avoid accountability for authoritarian overreaching. They often seem to get away with it. The recent attempt to push around Apple was stopped mainly due to Apple's lawyers and leaders refusing to be pushed around.

I do not know if the Brazilian example is one where the government and/or judge are attempting to compel behavior not legal in Brazil (either not what the law requires, using a non-legal punishment or neglecting another legal requirement that would override the law being used to compel the behavior). But I do think it would be possible to have such a law and have the judges actions be legal.

Certainly laws can compel companies to do things that they are not now capable of doing. Normally if some new law were to be created the regulatory framework and notice would be publicized and companies would be aware of the requirement (say to keep records or whatever sort). And then if they failed to do so that isn't a justification to fail to comply since they failed to do what was required in order to be able to comply with a further requirement. Their lawyers may also be able to argue the law was unrealistic in expecting compliance because even though we wanted to comply it just wasn't possible to do so. And making a case that they are doing everything they can may be taken into account to say that while they are not fully compliant yet, they are taking all reasonable action and therefore to the extent the judge has leeway they could make adjustments to the consequences.

While it is sometimes annoying the reality is there are so many complications it is often a matter of judgement for whether something is or is not ok and even if it isn't ok, what is a reasonable consequence. When the legal system is working well it makes these judgement in a sensible manner even if it leaves many people unhappy. And then you have things like the Eastern district of Texas making a mockery of abuse of society by patent trolls.

I certainly do believe the legal system can be systemically broken. And those failures can be left unaddressed by our representatives for decades. Could that be similar to what is happening in this Brazil case? Yes. Could it also be that this Brazil case is just a matter of a bad law and the legal system is properly carrying out the consequences of that law? Yes.