Anita Vasisht was going through her junk mail when she came across a surprising letter. It was printed on headed notepaper, from the Right Hon David Cameron MP, prime minister and leader of the Conservative party, and addressed to her personally. She was excited: she had never received a letter from No 10 before. “My daughters were in the living room. I went in and said, ‘The prime minister’s writing to me!’ Then I started reading it out.”

The letter, dated 15 March 2016, was about London’s mayoral election. The first few paragraphs were standard stuff, arguing that London was the most important city in the world, and explaining why Cameron was backing Zac Goldsmith. Then things started to get weird.

Under the heading The British Indian Community Makes London Great, Cameron wrote: “The British Indian community makes an extraordinary contribution to London and to Britain. Closer ties between the UK and India have been a priority for me as prime minister. I was pleased to join Zac Goldsmith in welcoming Prime Minister Modi to the UK last year at Wembley Stadium.” Then, under the heading The Risk Of A Corbyn-Khan experiment, Cameron described the policies of “Jeremy Corbyn’s candidate Sadiq Khan” as “dangerous”. If Khan won, Cameron said, “Londoners will become lab rats in a giant political experiment”.

Cameron did not use the words Muslim or Pakistani, but he didn’t need to; Vasisht knew well enough that Khan is a British Muslim of Pakistani origin. Khan made it perfectly clear himself when campaigning: he is proud to portray himself as the upwardly mobile son of a Pakistani bus driver, making his name as a human rights lawyer before becoming an MP.

It felt like my prime minister was writing to tell me he doesn't consider he and I are part of the same community Anita Vasisht

Vasisht’s daughters laughed at the letter: it seemed such a clumsy way to win votes. But the more she thought about it, the angrier Vasisht became. The implication was that she – and other British Asians – didn’t truly belong in Cameron’s Britain. “He talked of ‘your community’. No, David, you and I are members of the same community. It felt like my prime minister was writing to tell me he doesn’t consider he and I are part of the same community. Which is not very nice, is it?”

She took a photograph of the letter and tweeted it. Yes, it was funny in a way, not least the assumption that all British Indians are fans of Narendra Modi, who was banned from entering the UK between 2002 and 2012 after failing to stop riots in Gujarat in which about 1,000 Muslims died. But she was more angry than amused.

The following Monday, Vasisht, an immigration lawyer who previously worked for Amnesty International, asked her colleagues at Wilson solicitors if they had received similar letters. Yes, said Muhunthan Paramesvaran, a lawyer of Tamil origin: he had received a letter from Goldsmith. Under the heading The Tamil Community Has Contributed Massively To London, Goldsmith wrote: “I recognise that far too often Tamil households are targeted for burglary due to families owning gold and valuable family heirlooms.” Under the heading Sadiq Khan Will Put London’s Future And Your Community At Risk, he wrote: “As a government minister, Sadiq Khan did not use his position to speak about Sri Lanka or the concerns of the Tamil community in parliament. His party are beginning to adopt policies that will mean higher taxes on your family and your family’s heirlooms and belongings. We cannot let him experiment with these radical policies.” Paramesvaran received another letter from Cameron, promising that Goldsmith would “keep our streets safe from terrorist attacks”. For him, the implication was clear: a Muslim like Sadiq Khan would not.

Anita Vasisht, who has filed a police report about the Conservative mayoral campaign. Photograph: Sarah Lee/The Guardian

Vasisht began to scan social media to see what other Asian Londoners had said. She didn’t have to look far on Twitter. On 15 March, Atanu Roy tweeted: “Zac Goldsmith targeting my Hindu name to warn me about that Muzzer Sadiq Khan. Chip off the old racist block.” On the same day, Aakash Naik tweeted: “This is so wrong, racist and divisive @ZacGoldsmith needs to find who made this and sack them immediately.” On 18 March, Gurtej Sandhu tweeted: “Pls @ZacGoldsmith stop sending me racist & divisive leaflets. Shouldn’t matter that I’m Sikh/Punjabi/Hindu. #gutterpolitics #ZacGoldsmith.”

As well as Tamil families, Hindus and Sikhs (or people with Hindhu-, Sikh- or Tamil-sounding names) were sent letters warning that their jewellery was unsafe, because Khan planned to introduce a wealth tax. Cameron wrote to Barbara Patel, a retired biochemist, who replied, “Boy, have you got the wrong Patel.” White and Jewish, she pointed out that her husband’s family were lapsed Muslims, not Hindu, as whoever put them on the mailing list must have assumed.

Vasisht wasn’t naive – she knew politics could be dirty – but not like this; not in 21st-century London. “Alienating different groups within society in order to get some people to vote for you is ugly and dangerous,” she says.

She decided the campaign was not simply offensive, it could constitute incitement to racial and religious hatred, both crimes in Britain. She wrote a report: “There is... a real concern that, in targeting apparently those voters identified as ‘British Indians’... the intention of Zac Goldsmith and others including the prime minister would appear to be to deliberately incite feelings of hatred for Sadiq Khan in those believed to be of Indian (presumably Hindu) ethnicity – and this, in order to win their votes.”

Vasisht filed her report to the Metropolitan police and asked them to investigate.

***

A week after Cameron wrote to Vasisht, Goldsmith officially launched his campaign at a south London microbrewery. He reeled off his priorities in a lacklustre monotone: more affordable housing, better transport, clean air. It was only when he got to Khan that he became animated: “The man is so unprincipled that he will twist and turn and simply adjust his position on every big issue London faces, depending on the audience he is talking to.”

An hour later, I interviewed him. Goldsmith was quietly spoken, likable and thoroughly decent – until he started speaking about Khan. He insisted he was right to describe him as radical and dangerous, and said he would continue to do so. But he looked uncertain, chewing on his knuckles.

Goldsmith was accompanied by his media adviser, Katy Eustice, a former journalist who works for the Australian campaign strategist Lynton Crosby, famous for his “dog-whistle” politics and negative campaigning. The analogy is to those high-frequency whistles that can be heard by dogs, but are inaudible to the human ear. It’s a form of campaigning that uses coded language – euphemisms, juxtapositions – that can have one meaning to the general population and another to a specific group.

Everyone will shout, "Jeez, there's a dead cat" – and will not be talking about the issue causing you so much grief Boris Johnson

The tactic was famously used in the campaigns of Australian prime minister John Howard, who won four terms in power partly because of his tough stance on immigration. While the language Howard used was never overtly racist, the use of words such as “illegals” and “un-Australian” appealed to those with racist leanings. Crosby was Howard’s principal strategist. In 2013, he worked on Tony Abbott’s successful bid for power in Australia, won largely on the strength of a four-word slogan: “Turn back the boats.”

Crosby’s signature move is known as “the dead cat”. Boris Johnson, who was advised by Crosby during his two London mayoral campaigns, has described the tactic like this: “There is one thing that is absolutely certain about throwing a dead cat on the dining room table – and I don’t mean that people will be outraged, alarmed, disgusted. That is true, but irrelevant. The key point, says my Australian friend, is that everyone will shout, ‘Jeez, mate, there’s a dead cat on the table!’ In other words, they will be talking about the dead cat – the thing you want them to talk about – and they will not be talking about the issue that has been causing you so much grief.”

Boris Johnson with strategist Lynton Crosby, who masterminded both his London mayoral campaigns. Photograph: Alan Davidson/The Picture Library Ltd

When I interviewed Goldsmith, I told him I believed he was a better man than his campaign suggested. He looked uncomfortable, but stuck to his line. “I don’t agree. It’s not a dead cat.”

Eustice intervened: “Lynton’s not even involved,” she said. And, technically, this is true: the man masterminding Goldsmith’s campaign is Mark Fullbrook, co-founder of CTF Partners (alongside Crosby and pollster Mark Textor); he is also a former head of campaigns for the Conservatives, and was deputy director of Johnson’s successful 2012 mayoral campaign. But you don’t need Crosby at the helm for a campaign to bear all his hallmarks; his staff have been visible at many of Goldsmith’s campaign events. The CTF website boasts that Fullbrook was “described by Newt Gingrich as the UK’s own Lee Atwater”. Atwater, who could be said to be the forefather of dog-whistle politics, was an American strategist who famously described in a 1981 interview how Republicans could win racist votes without sounding racist. There is no suggestion that Fullbrook endorses his views.

When we met, Goldsmith insisted his use of “radical” and “dangerous” to describe Khan is purely political, and that only Khan had interpreted this as anything to do with his ethnic or religious background. “He is a fundamentally partisan figure,” Goldsmith argued. “It is obvious to anybody who is not unfair or wanting to misinterpret, the terms I was using were in a political context. I have not met a normal person who has chosen to intepret [campaign literature] like that.”

***

Crosby first teamed up with the Conservative party in 2005, to help out the then leader of the opposition, Michael Howard. Howard promised an annual limit on immigration and quotas for asylum seekers, together with a curb on work permits through an Australian-style points system and 24-hour security at ports. His campaign banners promised “controlled immigration”; he repeatedly said that, “Change was happening too quickly” and that, “It’s not racist to talk about immigration”. The Tory slogan became, “Are you thinking what I’m thinking?”

The Conservatives lost to Tony Blair, but Crosby went on to lay the groundwork for future campaigns – two more general elections and two mayoral elections, all successful.

Cameron’s former speechwriter, Clare Foges, recently wrote that working for Crosby, as she did in 2015, could be jolly: “He is prone to tooting on an antique trumpet to rally the troops and blasting out Queen’s One Vision over and over again,” she wrote in the Times. And it could be “tedious, thanks to his famed strategy of ‘scraping the barnacles off the boat’: paring the message down to a couple of well-polling lines to be repeated endlessly”. For Crosby’s team, nuance is just a distraction. Cutting through to swing voters needed “brutal simplicity”, according to Foges.

I talk to veteran spin doctor Bruce Hawker, who worked for the Australian Labour party through many elections and knows first-hand how the Crosby machine works. “He’s always been very good at what we call wedge politics; where you try to drive your usual Labour followers from the candidate or the leadership.”

This wedge is heavily researched. Crosby’s business partner Textor surveys large numbers of micro groups to find out what would put them off a candidate. “In the last British election, Ukip was going to be the wedge point,” Hawker says. “But the circumstances changed and it became Scotland. They look to the weakest spot in the Labour campaign and just work and work at that weakness, till it blows up into something much more significant.” Is it possible to beat Crosby in a clean fight? Hawker laughs – he’s not so sure there is such a thing. “Campaigning is always a combination of building up the strengths of your leader and being prepared to go hard against your opponent. You don’t tend to see too much elevation of the leader as a man of great principle in Crosby’s campaigns, but you do see an effective demolition of the opposition as dangerous, out of touch, untrustworthy, extreme.”

Zac Goldsmith and Sadiq Khan at the London Conference in November 2015. Photograph: Philip Toscano/PA

Does he have moral qualms about the way Crosby works? “Ah, yes. It’s fair enough to say somebody is extreme or whatever, but you’ve got to back it up with the evidence, to demonstrate what that actually means to the voter, rather than just leave it hanging there like a nasty smell in the lavatory.”

I ask Hawker who tends to be the boss on a campaign, Crosby or the politician? “Oh, I think Crosby. He always makes sure he’s very close to the leader and has their confidence. You saw that with Cameron in the last election. A lot of other people had their nose put out of joint because they felt they were being squeezed out.” It has to be this way, Hawker says. “The campaign has to be run with military precision, because it is the closest thing in civil life to actually having a war.”

I contact Crosby’s team a number of times for comment. Eventually, a spokesman for CTF Partners emails to say: “Despite the Guardian’s repeated and false allegations it is well known that Lynton is not working on the mayoral campaign. This is a matter for the campaign, not Lynton or CTF.” When I ask why it is not an issue for CTF, since the campaign is led by Fullbrook, I receive no response.

Meanwhile, a spokesman for Back Zac says: “This allegation [of racial profiling] is complete nonsense... The only person who has brought faith into the race is Sadiq Khan.”

***

Ken Livingstone knows what it’s like to be Crosbied. The Tory campaign against him for re-election as London mayor in 2008 was sustained, personal and unpleasant. As with Goldsmith, Crosby’s team decided the only way to win was to focus on the doughnut – outer London – where people tend to be more conservative.

Rather than championing Johnson, Crosby and Fullbrook rubbished Livingstone. “I was being smeared as a tax dodger – by David Cameron for God’s sake!” It was also suggested that Livingstone, who I spoke to before he was suspended from the Labour party amid accusations of anti-semitism, was overfriendly with ethnic minorities, particularly Muslims; it was implied that they would receive a disproportionate amount of public money. “Four years ago, people were telling me that a Tory canvasser had told them that if I was elected mayor, I was going to introduce sharia law. Given that the [Tory-leaning] London Evening Standard was reporting that I was an alcoholic, it was difficult to equate these two things.”

But this is nothing compared with the Goldsmith campaign, says Livingstone. “It’s poisonously divisive. Shameful.”

Livingstone says there were times during the last London mayoral election when it was obvious that even Johnson struggled to retain control of his campaign. “Crosby said, ‘We’ve got to get the issue away from transport fares.’ And on one occasion Boris said he was going to try to keep fares down, and Crosby just berated him in front of my staff for not toeing the line.” He pauses. “Zac looks as if he’s heading for a breakdown, because he’s being forced to behave in a way that isn’t natural to him. Given the cosmopolitan nature of his family, he can’t possibly believe all this crap.” Goldsmith’s father was Jewish, while his sister Jemima was married to the former Pakistani cricketer and politician Imran Khan, to whom he remains close.

Livingstone thinks this is the dirtiest campaign he has witnessed. “There’s been the occasional nasty stuff about immigration, but this makes Michael Howard’s campaign look uplifting and good-humoured.” What does he most fear in terms of consequences? “Some Muslim kids seeing this will think, ‘We’re looked at as not part of British society, and as a threat.’”

The Tories are fighting a battle more suited to the early 20th century, he argues. “I always say, never forget the Daily Mail headline in 1906: ‘Jews bring crime and disease to Britain.’ And it’s been selling papers, and unprincipled politicians have been using fear, throughout time immemorial.”

***

Shadow education minister Lucy Powell ran day-to-day operations for Labour’s 2015 general election campaign. That year’s dog-whistle consisted of telling the electorate, again and again, that Labour had never apologised for destroying the economy, and that Ed Miliband stabbed his brother in the back and would almost certainly do the same to Britain.

Powell says she felt much of the coded language in the Tory campaign was about Miliband being Jewish, not least the focus on him mishandling a bacon bap. Other messages about his ethnicity verged on the subliminal: repeated references to his roots in north London, a more Jewish area of the city, for instance.

While Powell thinks Crosby might well have been behind this strategy, she says she doesn’t believe for a minute that he is antisemitic or Islamophobic. It’s simply expedience: “It’s pure cynicism – he doesn’t care what the means are by which he can move swing voters. But once he finds it, he’ll just go after it, even if it’s wrong or personal or immoral, or in some cases all three.”

Powell believes the demonisation of Miliband was largely ineffectual. It was only when Crosby and the Tories found their dead cat that anything began to stick. After Miliband’s popular promise to crack down on tax dodgers and non-doms, Conservative defence secretary Michael Fallon “revealed” that the Labour leader would strike a power-sharing deal with the SNP, and was willing to sacrifice Trident to do so. Trident was the dead cat: the story came out of nowhere, says Powell, was wholly unfounded – and it worked. “They were on the back foot about tax evasion and sent Michael Fallon out there with a baseless story,” Powell says. “But with highly emotive language and a couple of splashes in their friendly press, the strategy worked, knocking the other story off the agenda.”

It was also Fallon who threw the first dead cat in the mayoral election – making a speech on 1 March that Khan was “unfit” to be mayor and describing him as a “Labour lackey who speaks alongside extremists. A man who has said Britain’s foreign policy is to blame for the terrorist threat.” (In 2006, Khan was a signatory to a letter arguing that Blair’s foreign policy in Iraq and on Israel offered “ammunition to extremists” and put British lives “at increased risk”.)

Powell believes that what Miliband or even Livingstone had to contend with was relatively benign. “Sadiq has had it worse than I’ve ever known,” she says. “I think Zac will look back with a huge amount of regret.”

David Cameron at prime minister’s questions on 20 April. Photograph: PA

If ever the gloves were on in this contest, by mid-April they were well and truly off. When asked by the London Evening Standard whether his campaign is “making racist capital out of Khan’s Muslim faith”, Goldsmith responded, “We have never, ever, referenced Sadiq Khan’s religion or ethnic background. Not once.”

But then he added, “What he is actually doing is, I think, incredibly dangerous. He is calling Islamophobia to prevent legitimate questions being asked. They are about his willingness to share platforms with people who want to ‘drown every Israeli Jew in the sea’. It’s about his having employed someone who believed the Lee Rigby murder was fabricated [Khan’s junior adviser, Shueb Salar, was sacked last month after a string of offensive tweets came to light]. It’s about his career before being an MP, coaching people in how to sue the police. He is hiding behind Britain’s Muslims in order to avoid having the spotlight pointed at him.”

Other Conservative heavyweights lent their support. On 9 April, Boris Johnson told the Conservative spring conference that “Sadiq Khan has shared platforms, to put it at its mildest, with some pretty dodgy people with some pretty repellent views”. Home Secretary Theresa May said he was “unsafe” to run London at a time when we face “a significant threat of terrorism”, because of his history of defending extremists as a lawyer. The next day, Johnson wrote in the Telegraph: “In Islam and the Labour party there is a struggle going on, and in both cases Khan – whatever his real views – is pandering to the extremists. I don’t want him running our capital.”

The message was as brutally simple as the Back Zac team could hope for: Khan could not be trusted. And few mainstream Conservatives were willing to rock the barnacle-free boat. Even the Conservative Muslim Forum has refused to be drawn on the character assassination. Mohammed Amin, chair of CMF, tells me, “I never comment on our own campaigns – or what Lynton Crosby calls process issues.”

I tell him I have not even mentioned Crosby. “What you can ask me is how I intend to vote, and what I think of the candidates. First of all, I’m going to vote for Zac Goldsmith, because I think he will be a much better mayor and Sadiq Khan’s policies on transport are terrible.”

Does he think many Muslims will have been offended at the way Khan is being portrayed? “I do not think Sadiq Khan is an extremist, but I’m not going to start commenting on Zac Goldsmith’s campaign.”

The only senior Conservative publicly to dissent is former chairman Sayeeda Warsi, who tweets, “If @SadiqKhan isn’t an acceptable enough Muslim 2 stand for London mayor, which Muslim is?”

***

A week after getting in touch, Vasisht emails me, full of fire. “Did you see this? It’s brilliant.” At last, she says, she has found a Conservative who has spoken out. She sends me a link to an article in the New Statesman by the Muslim businesswoman and former Conservative party parliamentary candidate for Leigh, Shazia Awan.

Awan wrote: “I am deeply upset by the intrusive, patronising and divisive tactics being used by the party in the mayoral race. To resort to, for want of a better description, ‘racially profiling’, in one of the most beautifully diverse cities... is not only a desperate and arguably foolish tactic but one that will no doubt see a Labour mayor voted in.”

Awan tells me she has found the campaign, and speaking out against it, traumatic; it has made her question her core beliefs. “I am disgusted with myself for not having the courage to speak out against the very real and deep-rooted racism in the Conservative party sooner. The silence from the Conservative Muslim Forum, and indeed all Conservatives in the party, makes them as guilty as Zac Goldsmith and his campaign team. How people like Sajid Javid and others can keep tight-lipped about this is beyond my understanding.”

But Vasisht is furious at the response from the police, who have written to tell her they will not be pursuing her complaint: “The evidence you have presented does not breach the Public Order Act, or any other offence to which I have knowledge.” If she is offended, they suggest, she should make a complaint to Goldsmith or the Conservative party.

She promises she won’t be giving up yet. With Wilson solicitors, she has presented an 80-page document to the Crown Prosecution Service.

Cameron accused Khan of sharing a platform with Suliman Gani. In fact, Gani canvassed for the Conservatives

In the weeks running up to the election, the Tory press seems to run a story linking Khan to a new extremist every day, including radical preacher Suliman Gani. One story claims that Khan shared a platform with Yasser al-Sirri, an Egyptian militant who reportedly claimed Osama bin Laden died an honourable death. Khan argues that this is not surprising: as chair of Liberty, a human rights lawyer and a politician, you often have to speak alongside people with whom you disagree.

There is less reporting of the bigger issues: the dog-whistle and dead cat strategies appear to have worked perfectly.

Or have they? At time of writing, Khan was leading by 16 points in the latest YouGov poll. And for Goldsmith, the tactic appears to have backfired. On 13 April, Gani tweeted a photograph of himself with Goldsmith. On 20 April, at prime minister’s questions, Cameron accused Khan of sharing a platform with Gani on nine occasions, stating that Gani was an Isis supporter. Gani responded that he did not support Isis; in fact, he had canvassed and voted for the Conservatives at the last general election, at their request. On 18 April, Goldsmith had to defend himself against charges of tokenism after the release of a bizarre video by grassroots organisation Conservative Connect called Goldsmith Jette Ga! (He Will Win), with lyrics in English, Hindi, Urdu, Punjabi and Bengali. Goldsmith’s team has denied involvement.

When the Guardian asks Cameron to respond to the accusation of racial profiling, his press team refuses to respond in his name. Instead, a Conservative spokesman says, “Zac Goldsmith has made clear he will reach out to every single part of London, and that means reaching out to every part of the community.” Asked about the concern that Cameron’s letter could constitute a race-hate crime, it does not respond.

Powell is convinced that this election will prove that dog-whistle politics has had its day. “I think the world is moving on. Jeremy Corbyn and the other anti-establishment politicians coming to the fore right now suggests the public don’t want cynical, one-dimensional campaigns any more. And they’re not going to be effective in London.”

As for Vasisht, she does not merely hope that we will see the end of dog-whistle politics; she is determined to stop it. In a letter dated 14 April, the CPS has written back to say that, as there is insufficient evidence for the police to charge, it will not be taking further action. But she is not letting it go: she has reminded the CPS of its own definition of a racist incident: “Any incident which is perceived to be racist by the victim or any other person.”

“I told the CPS that I was a victim of race-hate, but actually, we’re all victims of it. The Tory party is using bloody and violent political histories between groups of people to turn people against Sadiq Khan in order to get their votes. Then they’re going to go away and get on with whatever they do in their political life, and in the meantime they have left communities with all these stirred-up feelings. In my view, this is not merely offensive, it could be a criminal offence. I’ve never seen this before in Britain. And I never want to see it again.”