Nobody likes to be near a stinky sink since the odour can making using the sink or even being in the room unbearable. Once you have established the smell is coming from the overflow drain and not the sink's main drain, you will have a clearer course of action since you will not need to look at the sink's drainpipe for the root of the smell.
Offensive odours that come out of a sink often come from oils, make-up and soap scum getting washed down the drain, some of which sticks to the drainpipe's walls, creating a slimy film. This film will start to stink when bacteria starts to grow in the mixture, creating an offensive odour. Since the overflow tube has some of the same materials washed down it, it develops smells in the same way.
With main drains, you can clean off the film build-up using hot water, soap and a bottle brush. Sink overflow tubes may not have an opening that accommodates a brush of any type. If you can fit a brush of any size down the overflow drain opening, this provides the best way to get rid of the slime. You will not want to use the bottle brush for anything other than cleaning drains.
With overflow tubes you cannot scrub out, you are forced to turn to a liquid cleaning method for results. Bleach will kill bacteria, but if you simply pour it down the drain, it will not cover all of the walls of the overflow tube. Putting bleach in a squirt bottle will allow you to squirt the bleach onto all of the walls of the overflow tube. You must let the bleach sit for at least half an hour. If you don't have bleach, you can pour baking soda down the overflow tube and follow it up with some vinegar, creating a bubbling solution that will eat away at the film. The vinegar and baking soda method may need several applications to work completely, and you the smell may even become worse during the cleaning.
Instead of waiting until the sink's overflow tube smells bad, clean the overflow tube out regularly using a brush or one of the liquid cleaning solutions. If you have had the stinky overflow tube problems in the past, chances are the sink will develop the same problem in the future unless you drastically change how the sink is used. Depending on your habits with the sink, clean out the overflow every two months, making the problem easier to manage.