Seriously, that's legal?
Generally, you can't set deadly traps on your property.
Rigging a package to set off a blank shotgun shell exposes you to potential criminal and civil liability. It's a terrible idea.
What if the person who picks up the package is a neighbor who is trying to be helpful, a postal worker who moves it to stack more packages that have arrived, a neighbor's young child who doesn't know any better?
What if the loud noise causes a heart attack or ejects hot gas or plastic shrapnel that injures someone?