The 4th Amendment of the US constitution prohibits unreasonable searches and seizures. Generally, this can be taken to mean that the police cannot pull a random passer by aside and go wrist deep into your rectal cavity on the off chance you might have something illegal up there, as it is unreasonable. I think I will get no disagreement on that.
Now, the reason that the above example is an unreasonable search is that it is absurdly invasive and there is no warrant, and in that particular scenario, there is no way to easily verify that the police officer doing the search did not plant evidence (or basically lie about finding a quantity of drugs or contraband up there).
The above example might become reasonable if the authorities were to follow due process and had reasonable cause to believe that there is something deep inside the suspects rectal cavity.
I think most people get hung up on the idea that the only reasonable search is one that has a warrant.
If the authorities opt instead to data mine thousands of e-mails looking for evidence of random wrongdoing the assumption of many is going to be that it is an unreasonable search. But on what basis is it unreasonable? Lets say such a search of several thousand suspects the authorities identify a few potential suspects of legit crimes, and the authorities then prosecute them. The people that were not implicated in that search will probably never know they were under scrutiny, and they would be hard pressed to prove any actual harm from that search.
So why exactly is that kind of search unreasonable? I am not about to say that such a search is reasonable (at least not without a warrant to go looking for something specific), but the only argument against it is for an expectation of privacy. While such an argument is valid, I am not aware of any laws in the US that guarantee privacy from non invasive scrutiny.