Birds defecating on a mailbox is not only unsanitary, but cosmetically unacceptable. Preventing this seemingly normal act of nature requires a suitable deterrent, preventing the birds from alighting and relieving themselves upon your belongings. There are a variety of products that suit this niche need, so choose the one that appeals most to you.
Use an odor-based deterrent product to prevent birds from landing on your mailbox. These products generate an unpleasant odor that repels birds, keeping them from interfering with your property. This allows you to keep birds away without altering the physical properties of the mailbox in any way.
Consider bird spikes from a local hardware store and mount them atop your mailbox. These are closely positioned spikes that prevent birds from landing on the mailbox and relieving themselves upon it. This is a more drastic measure, permanently altering the look of your mailbox in exchange for a no-maintenance-required solution for your bird problem.
Consider a holographic tape product. This type of bird deterrent works by reflecting light in such a way to keep birds away from the area. This is a good alternative if you do not wish to reapply a scent-based product and do not wish to disturb the aesthetics of your mailbox by applying bird spikes.