Doolally is a term for someone who’s a bit mad or eccentric, usually temporarily. It’s a shortened version of a British military slang expression, ‘doolally tap’. This basically means ‘camp fever’ (‘tap’ being an Urdu word for fever). The doolally part is a corruption of Deolali, the name of a military camp near Bombay (now Mumbai) in India.
Established in 1861, Deolali had a large barracks and was a chief staging point (i.e. a transit camp for troops or equipment), acting both as a training camp for soldiers who’d just arrived, and a place for British troops whose enlistments had expired to hang out while they waited for transport home. Because ships only sailed between November and March, this could mean some men stayed at Deolali for months waiting for repatriation. This is where we get the ‘losing your mind’ part from. Conditions in the camp were pretty awful – malaria was rife and soldiers were bored, driven nuts by sandflies and often afflicted with all the fun stuff you got from hanging out in the brothels and gin palaces that inevitably sprung up near to barracks (alcoholism, syphilis and other delightful venereal diseases). These men were described as being in ‘full doolally tap’, which we’ve since shortened to just ‘doolally’.
If you’re of a certain age then you might remember a 70s sitcom called ‘It Ain't Half Hot Mum’ which was set in Deolali. Like most British sitcoms from the 70s it’s since been accused of racism, homophobia and pandering to imperialism, meaning it’s now been assigned to the recycling bin of TV history.