Mayor Rahm Emanuel is not shy about talking up his pro-immigrant bona fides.

The mayor has emailed journalists at national news outlets to tout them. He filed a pre-emptive lawsuit against the administration of President Donald Trump over the planned withdrawal of some federal grants for cops. On the first day of school for Chicago kids, Emanuel declared schools a “Trump-free zone” to reassure students, and their parents, that they are safe from immigration raids at schools.

Really, though, Emanuel could do more. If he truly wants to go to bat for undocumented immigrants, he can strengthen his Welcoming City ordinance, Chicago’s version of a “sanctuary” ordinance, in three ways.

EDITORIAL

The ordinance, enacted five years ago, prohibits Chicago Police from acting as de facto immigration agents. But it’s not strong enough. Included in the legislation are four exceptions that give cops wide latitude to work with immigration agents to deport someone. That robs some undocumented immigrants of due process when it comes to American justice, even as Emanuel portrays Chicago as a city that treats all immigrants fairly — whether they are here legally or illegally.

Ald. Carlos Ramirez-Rosa (35th) has proposed amending the ordinance to eliminate all four exceptions. The proposal has 27 co-sponsors but is stalled in committee, likely because Emanuel isn’t on board.

We support the elimination of three of the ordinance’s four carve-outs. Chicago should no longer allow cops to, first of all, turn over to immigration agents undocumented immigrants who have outstanding criminal warrants. Second, they should not turn over defendants in criminal cases. Third, they should not turn over immigrants who have been identified as gang members in a gang database.

Under the carve-outs, police can give U.S. Immigration and Customs Enforcement access to people in custody and can tell ICE when people will be released. “ICE can use that access and information to pull those individuals out of the criminal justice system before they have had their day in court, denying them and the community due process,” Fred Tsao of the Illinois Coalition for Immigrant and Refugee Rights, told us in an email.

It’s wrong to allow deportations based merely on the suspicion a person has committed a crime. People deserve their day in court if they have outstanding criminal warrants or are awaiting trials.

As for the city’s gang database, it is known to be faulty. Nobody should trust it. The MacArthur Justice Center and American Civil Liberties Union say the database is inaccurate and racially biased. We see two big problems with it: First, all the ways people can end up on the list aren’t clear. Second, people put on the list often are not aware of it. They can’t clear their names.

Ramirez-Rosa, with support from immigrant advocacy groups, also wants to eliminate the exception that allows cops to turn over to ICE undocumented immigrants with felony convictions.

Our view is that the ordinance should allow cooperation between local cops and ICE when immigrants have convictions for aggravated felonies such as murder, rape, sex abuse of minors and drug trafficking, if not necessarily for lesser felonies such as shoplifting. Even properly documented immigrants — those with green cards — face immediate deportation in such circumstances once time is served.

If the justice and immigration systems are working right, local cops won’t even run into undocumented immigrants with past convictions for aggravated felonies. They are sent packing after serving time.

Five years ago, when Chicago’s sanctuary ordinance was passed, it was hailed as a big step in bringing immigrants out of the shadows and giving them a comfort level to cooperate with police if crimes were committed in their communities. But over time, people have figured out that the exceptions water it down.

Cook County and some suburbs have sanctuary ordinances with fewer exceptions. Illinois Gov. Bruce Rauner late last month signed the Trust Act, which has no exceptions but requires a judicial warrant for cooperation between cops and ICE. It is superseded by local ordinances.

Chicago has fallen behind. That won’t stop Emanuel from fashioning himself as a champion for immigrant rights. But it should.

Send letters to: letters@suntimes.com