I made a simple controller that just rises the flag when mail arrives. It is mounted on a standard US mailbox and it detects the presence of mail, newspapers, other, placed inside of it with a IR sensor under the bottom.
I got a sharp 0A51SK 15cm distance infrared sensor info here: https://www.pololu.com/product/2450 the library for the sensor:
https://github.com/DrGFreeman/SharpDistSensor
an arduino nano every
a letterbox
a flag (I modified the original flag and attached directly on the servo motor )
a servo motor
12V AC input from the door/bell circuit of the house
a switch that activate the circuit only when the letterbox is opened.