either a warrant, or a good reason, ie, the package is dripping, or it stinks like weed, or it's ticking, lol.. even then, only the post master general is allowed to open packages, and not joe smoe front desk worker..
this is also the reason i always tell people if they're going to be sending anything via the mail, to use only the uspo and not say ups or fed ex or whom ever as any of those places can and will open any package at any time for any reason.. they have notices all over the offices saying this..