By Jim Reed
Newsbeat technology reporter
A Google engineer has developed a way to avoid random emailing late at night when you're most likely to be drunk. Jon Perlow's new Mail Goggles application, built into Google's GMail service, forces the user to answer basic maths questions in 60 seconds before a message can be sent on its way.
Mail Goggles gets you to answer maths questions before you send an email
If you are in a fit state to be chatting to your ex, for example, then the puzzles should not be too challenging.
The feature is time sensitive and by default only kicks in late at night on the weekend, although those settings can be changed by the user.
In his Google blog, Jon Perlow said: "Sometimes I send messages I shouldn't send.
"Like the time I told that girl I had a crush on her over text message.
"Or the time I sent that late night email to my ex-girlfriend that we should get back together.
"Hopefully Mail Goggles will prevent many of you out there from sending messages you wish you hadn't.
"Like that late night memo - I mean mission statement - to the entire firm."
Perlow used his Google Labs time to build the service.
All engineers at the company are encouraged to spend a day a week working on personal projects, some of which are later developed into full products or services.