The campaign mailers that landed this week depict the mayor locked in a bitter struggle with a threatening foe. Martin J. Walsh, says the literature, won’t let this enemy’s “reckless policies hurt Boston.’’
But Tito Jackson, the city councilor on the ballot against Walsh on Tuesday, goes unmentioned in Walsh’s mailing.
Instead, the target of the piece — his name splashed across it four times and his picture up top — is President Trump.
Trump has, in some ways, shaped the contours of the mayoral campaign, much as he has injected himself into countless seemingly unrelated political debates across the country. He has served as a useful foil for Walsh, who gets to define himself in opposition to a president deeply unpopular in Boston — rather than to an affable city councilor.
“On the one hand, people would expect that if you’re running in a local election, the only person you’d be talking about is your opponent, your direct opponent. On the other hand, Trump makes the circumstances unique,’’ said Andrea Cabral, the former state public safety secretary and Suffolk County sheriff, who is now a WGBH contributor.
Cabral called Walsh’s anti-Trump stance “smart politics.’’
A Suffolk University/Boston Globe poll last month showed Trump to be reviled in Boston. Fifty-eight percent of respondents called him their least favorite national political figure among a list of eight options.
Jackson, in a telephone interview Friday, acknowledged Walsh’s strategy. “Yes, he wants to run against Donald Trump. That might be a race that he can win,’’he said.
“Mayor Walsh is running from the fact that I have a better vision for the city of Boston for all, that is going to provide real affordable housing for real people that live in Boston, that will invest in a great school in every neighborhood, and will have a comprehensive approach to violence prevention,’’ Jackson said.
But as Trump has devoured so much of the political bandwidth, he has helped prevent Jackson from gaining the spotlight he badly needed to wage his long-shot bid against a popular incumbent. The mayoral race has largely flown under the radar, a dynamic that generally helps incumbents who enjoy higher name recognition.
“It’s a good thing to take on a president [who] is not going to be terribly meaningful to the election,’’ said Bill Walczak, president and CEO of the South End Community Health Center, who waged an unsuccessful bid for mayor in 2013. In Boston, “coming out against Trump . . . makes people feel good.’’
Particularly for a mayor who has run into criticism for being too cozy with business interests — including on controversial topics such as the city’s affordable-housing crunch and its ill-fated bid for the 2024 Olympics —the chance to contrast his governing style with the real-estate-mogul-turned-president has proved irresistible.
Playing off Trump has allowed Walsh’s campaign to “defend the mayor against the charges by the Jackson campaign that Jackson is the real progressive in the race and that Walsh has been just the mayor of the rich, or the downtown people, or the developers, big business,’’ said Ira Stoll, a Boston resident, editor, and author of “JFK, Conservative.’’
Walsh has repeatedly made Trump a target of his rhetoric, both as mayor and candidate. In January, he held a dramatic City Hall press conference, where he ripped Trump’s proposal to strip federal funding from “sanctuary cities,’’ which shelter undocumented immigrants, and said those people could live in his office if need be. His stance drew numerous invitations to make national television appearances, raising his profile in the process.
In June, he bucked Trump on climate change, vowing that Boston would abide by the greenhouse-gas reduction accords of the Paris Agreement.
At the city’s annual Labor Day breakfast, Walsh, a former labor leader, spoke directly to audience members whose cars showcased their union affiliations alongside their support for Trump.Many political observers interpreted Walsh’s speech as a scolding for his union brethren.
“Those union numbers stand for something,’’ said Walsh, highlighting the gains labor has made through the years. “They stand for health care; they stand for pensions and annuities; they stand for the rights and protections [of workers] . . . they stand for the people who came before you.’’
On a broad range of issues, noted Walczak, Walsh “has declared Trump to be Beelzebub.’’
“You don’t see that very much in local elections, Trump being the unique set of circumstances, where his behavior is so extreme that what he says and tweets, and the policies he’s in favor of . . . resonate every day,’’ added Cabral.
Walsh’s campaign refused to disclose how many anti-Trump mailers were sent, or to which neighborhoods or voters. Walsh’s campaign manager, John Laadt, said the campaign had sent “tens of thousands of mailers’’ on a variety of topics.
“Every single neighborhood in the city has received mailers from the Martin J. Walsh campaign, and they’ve focused on issues that he cares deeply about,’’ Laadt said on Friday.
Walsh insiders acknowledge, though prefer not to highlight, that he and Trump share voters, particularly in the city’s outlying, largely white neighborhoods such as eastern Dorchester, South Boston, and West Roxbury. In those areas, Trump performed significantly better last year against Democratic presidential nominee Hillary Clinton than he did citywide.
Several of those wards also gave Walsh his largest margin against Jackson in September’s preliminary election, when Walsh took 63 percent to Jackson’s 29 percent.
The mayor’s ability to win the support of working-class residents in those neighborhoods make him an appealing figure within a party that has watched such voters abandon the Democratic label — and helped throw last year’s election to Trump.
“Walsh is interesting nationally to the Democrats for how the Democrats can win those voters, and attract the working-class white guy, or blue-collar white guy, that the Democratic Party has been losing,’’ said Stoll.
Jim O’Sullivan can be reached at jim.osullivan@globe.com. Follow him on Twitter at @JOSreports.