HAVING THE current foreign secretary and his predecessor locked in a battle to be prime minister makes this an awkward time for Britain’s Foreign Office. To make matters worse, it now has to hunt for the mole responsible for a deeply embarrassing leak of dispatches from the country’s ambassador to Washington, Sir Kim Darroch. Just when it should be preparing for a post-Brexit “Global Britain”, the Foreign Office finds itself fighting fires both at home and in relations with the countries it most needs to cultivate.

In truth Sir Kim’s cables assessing President Donald Trump and his policies, covering a period from 2017 to today and leaked on July 6th in the Mail on Sunday, revealed little that has not been said frequently in the press. Still, coming from a top British diplomat, the assessments make juicy reading. Sir Kim describes the Trump administration as “dysfunctional” and “diplomatically clumsy and inept”, and does not expect that to change. A memo from June 2017 described reports of “vicious infighting and chaos” inside the White House as “mostly true”. He depicts Mr Trump as “radiating insecurity”. More recently, Sir Kim warned that, although the president may have been dazzled on his recent state visit to Britain, America would continue to follow its self-interest in negotiations for a post-Brexit trade deal: “This is still the land of America First.”

Unsurprising as these views may be, their leaking is deeply damaging, and has set off a hunt for the mole and speculation on the motive. Frank, confidential assessments of the countries where they serve is core to diplomats’ jobs; if fear of leaks leads to self-censorship their work will be worth little. That the Darroch files emerged through a journalist, Isabel Oakeshott, who is a well-known Brexiteer has naturally fed theories that this is all part of the battle over Brexit. Sir Kim, who was Britain’s permanent representative to the European Union and national security adviser under David Cameron before heading to Washington in 2016, is seen as a Europhile. The suspicion is that the leak was designed to ensure that a more Brexit-friendly person is put in the key diplomatic post after, as is widely expected, Boris Johnson becomes prime minister later this month.

If Mr Trump had his way, Britain would have long ago appointed Nigel Farage, the Brexit Party leader, as its man in Washington. Since he does not actually have the ability to make such decisions, he has to content himself with making his views about Sir Kim plain. “The ambassador has not served the UK well, I can tell you that,” the president said. “We’re not big fans of that man.”

The following day, Monday July 8th , Mr Trump sharply escalated the affair via Twitter, announcing a boycott of Britain’s ambassador. “We will no longer deal with him,” he declared. For good measure, he rubbished the way Britain’s prime minister had handled Brexit (“What a mess she and her representatives have created”), and looked forward to her imminent replacement (“The good news for the wonderful United Kingdom is that they will soon have a new Prime Minister”). Sir Kim was reported to have been disinvited from a dinner on July 8th for the emir of Qatar hosted by America’s treasury secretary, Steven Mnuchin. Back home, Britain rallied behind its man, though the government distanced itself from his views. Mrs May insisted she had “full faith” in Sir Kim. William Hague, a former Conservative foreign secretary, told the BBC: “You can’t change an ambassador at the demand of a host country.”

The blip in Britain’s “special relationship” with one superpower comes as its supposed “Golden Era” in relations with another, China, is looking distinctly tarnished. Tensions over the recent demonstrations in Hong Kong are the latest in a series of irritations that include policies towards Huawei, a Chinese telecoms giant, and maritime rights in the South China Sea. Last week the Foreign Office summoned Liu Xiaoming, China's ambassador to the UK, to complain about his criticism of British "interference" in the affairs of Hong Kong, its former colony. A foreign-ministry spokesman in Beijing accused Jeremy Hunt, Britain’s foreign secretary, of “basking in the faded glory of British colonialism and obsessed with lecturing others.”

Britain is also at loggerheads with Iran. Last week it seized a tanker in Gibraltar that it suspected of smuggling Iranian oil to Syria, provoking threats of retaliation against Britain (including the seizure of British ships).

Mr Hunt’s real current obsession is vying with his predecessor as foreign secretary, Mr Johnson, for the role of Conservative Party leader, and hence prime minister. That creates an incentive for him to make headlines, whether over Hong Kong or sanctions enforcement with Iran. It does not necessarily make for effective foreign policy.

The contrast with France is striking. As Britain waits by the EU’s exit door and focuses on its own leadership contest, President Emmanuel Macron has not been idle. Last week he largely got his way in the share-out of top EU jobs (gone are the days when any of those roles goes to a Briton, including that of Europe’s foreign-affairs supremo, who is to be a well-respected Spaniard).

And on July 6th he had a telephone conversation with Iran’s president, Hassan Rouhani, which resulted in France and Iran agreeing to look at conditions for talks to save the nuclear deal of 2015, the Joint Comprehensive Plan of Action (JCPoA), under which Iran agreed to limit its nuclear activities in exchange for a partial lifting of sanctions. Mr Trump withdrew from the deal last year and has sought to cripple Iran’s economy. Military tensions have risen sharply in the Gulf after a series of incidents, including attacks on ships (blamed on Iran) and Iran’s shooting-down of an American drone. Britain’s foreign office merely says it is “co-ordinating with other JCPoA participants regarding the next steps under the terms of the deal”.

Britain’s trade minister, Liam Fox, is meant to be paving the way for a future trade deal with America, but in Washington this week he found himself having to defend his country’s ambassador after the embarrassing leaks. The EU, meanwhile, has been busy doing actual trade deals: its pact with Japan came into force in February and last month it reached agreements with Mercosur, a big Latin American trade club, and Vietnam. Global Britain has a lot of catching up to do—and damaging diplomatic leaks do not make the job any easier.