RE: Smart Mailbox
I've seen a few people DIY them. You can put a reed switch or similar on the door, and watch for state changes, to trigger a "PostBox opened last at" style sensor, or use a light sensor in the box to do the same.
If you want to seriously over-engineer, you could put the box on a load cell, and measure the weight of the post.
Use an ESP32 for your control board, and its pretty much just basic ESPHome plumbing