It may be illegal but it can be done. I don't think every mail will be scanned. If crushed, and densely packed, marijuana can't be distinguished under the X-ray. Similarly, dogs cannot be used to sniff all the mails: there are millions of mails. And even when used, they may not be able to detect...