Twisting their way through labyrinthine alleys, postmen in the Rio favela of Rocinha have to resort to detective work as they figure out where to deliver mail.

Police and the army moved in to clean up the sprawling mini-city of some 150,000 two years ago in a bid to rid Brazil's biggest slum of the scourge of drug dealers.

But even after "pacification" of the area, doing the rounds here can still be risky business.

"There's one house with a dog called warrior," said postal official Edson Martins.

Mailmen, no matter where, have long had to deal with vicious dogs. But their routes here are also rendered dangerous by Rocinha's maze of narrow streets and steep cliffside drops.

And then there's the fact that, as the area develops, some ramshackle abodes vanish and new ones spring up.

Just finding an address often requires a real sleuth.

"Sometimes, to get to a resident you have to go through the kitchen of another house," Martins told AFP.

Shanty houses dot the Rio hillside, with the structures providing shelter to tens of thousands -- many work-hungry migrants from Brazil's poverty-stricken northeast.

Rocinha was a lawless bastion of drug dealers for some 30 years until troops and police, backed by helicopters and armored vehicles, moved in two years ago.

Since then, authorities have attempted to modernize the area and draw up a registry of streets, number houses and generally make some sense of a maze of paths and a jumble of electrical wires.

The postal service, for one, is tasked with attributing a zip code to each region to enable residents to get their mail at home.

"Before, road number four was just a simple pathway; today it's a real road, wider. That makes our job easier," says mailman Ricardo Pinto, 52.

Previously, Pinto and his colleagues would barely venture into Rocinha's main street for fear of coming face to face with armed men.

Instead, they would drop the mail off with traders or residents would come pick it up.

Today, six mailmen do the rounds on foot, delivering some 5,200 items per day to houses on streets with a designated name.

A truck, meanwhile, serves as a "poste restante," where people can come and collect items.

Even so, Martins said, "these postmen still only cover around 30 percent of Rocinha."

One particularly tough neighborhood to navigate is above the "Valao" -- Rocinha's open sewer system -- where the roads are unnamed.

Friendly neighborhood service

"Our work starts where that of the postal service stops," Silas Vieira, 44, told AFP.

"We go into little alleyways which haven't been registered, to houses with no number."

Along with Carlos Pedro, 43, Vieira founded "Carteiro Amigo" ("Friendly Postman") 13 years ago with an unemployment insurance payout.

Today, their small company employs seven "mailmen" -- albeit ones who are not recognized by the official postal service.

They deliver mail to more than 8,000 households, which each pay around $7 a month for the service.

Vieira and Pedro both hail from Rocinha and have drawn up their own address registry based on names given by locals to some 3,000 pathways, alleyways, squares and even staircases.

Creating that was "a real detective's job," they said.

Neither Vieira nor Pedro will say what kind of revenue their fledgling firm has -- but they do let on that turnover has "tripled in ten years."

They have also opened franchises in ten other favelas.

Another colleague, a 32-year-old who only gave his name as Max, finds the work keeps him in shape as he logs some 10 kilometers (6.25 miles) a day on his route.

His work is highly appreciated by the locals.

"He has changed my life," said Norma Lucia, a woman in her 50s, as Max handed her a letter.

Yet some complain about having to pay for a service that elsewhere in Rio de Janeiro is provided for free.

"The post is a public service," complained a man who identified himself as Jose, 55.

Some two million people live in Rio's favelas.

Those in the southern part of the city have gradually been "pacified" since 2008 as authorities try to spruce up the metropolis ahead of next year's World Cup and the 2016 Rio Olympics.

Even so, many slum residents still lack basic services such as drinking water, sewage systems, refuse collection -- and mail delivery.