Ontario's Appeal Court has ruled that Canada Post's constitutional rights trump municipal bylaws in a high-profile super mailbox court battle against the City of Hamilton.

Justices David Doherty, Gloria Epstein and Bradley Miller ruled Wednesday that the Crown corporation has the constitutional right to place community mailboxes on roadsides. The city argued that it has the ability to control its own right of ways.

The Appeal Court ruled with the city on its right to have a bylaw, but against it on the grounds of constitutional paramountcy, the idea that the constitution takes precedent over municipal bylaws. The city will also have to pay at least some of Canada Post's legal costs.

The city is "disappointed," it said in a statement.

"The Court of Appeal confirmed the validity of the bylaw as protecting against harm to property and persons using municipal roadways," said the statement. "The decision will be reviewed and council will consider its options moving forward."

Canada Post said it's pleased with the court's decision.

"We respect the unanimous ruling and remain committed to working with municipalities as the postal system evolves to meet the changing needs of Canadians," spokesman Jon Hamilton said.

Super mailboxes were to replace home delivery

Last year, Canada Post was moving ahead with a plan to phase out door-to-door mail delivery for 460,000 homes in Canada.

Hamilton city council, which already opposed the plan to eliminate door-to-door mail delivery, was upset about where the corporation was putting community mailboxes in the city.

The city tried to impose a fee and approvals process for placing the mailboxes. Canada Post, meanwhile, said it didn't have to abide by that, and that federal legislation trumps municipal law.

An Ontario court judge sided with Canada Post last year, saying the city bylaw was "inexplicable and inoperable," and an attempt to "thwart" the Crown corporation's plans.

But city council voted 9-4 to appeal it. The appeal, said Coun. Terry Whitehead, is not just about community mailboxes.

"It's not just about Canada Post anymore," he said last year. "It calls into question our whole regulatory regime as it comes to right of ways, period."

In the decision, the court said the city's bylaw is within the city's jurisdiction, but it conflicts with Canada Post's paramountcy.

"The power of the Postmaster General (and its successor, Canada Post) to locate mail receptacles in its national network, free of interference, has existed from Confederation," the decision reads.

Hamilton spent about $75,000 on the appeal, wherein lawyers Peter Griffin and Rory Gillis represented the city. It wrote 95 municipalities to help, and two did. Victoria contributed $2,500, and the small Quebec municipality of Baie-D'Urfé sent $750. The Federation of Canadian Municipalities had intervener status.

Meanwhile, the plan to replace door-to-door delivery with community mailboxes is up in the air right now. When Justin Trudeau's new Liberal government swept into power last October, he put the conversion on hold.

However, Canada Post is still grappling with revenue loss from the decline of postal mail.