Oh, Caller ID. You make our lives easier by telling us when our friends and family are calling. And you mystify us when a number like 111-1111 shows up on our phones. We're getting really annoyed when someone spoofs a number that isn’t real.

The feds (and some states) have taken notice, too. Back in 2007, Congress first proposed a bill that would disallow such fakery. Three years later it passed, and we’ve all been happier since the Truth in Caller ID Act (TCIA) came into force.

That is, unless you’re a company that sells the “SpoofCard” (we’re guessing you can figure out what that does), and/or a company that uses such trickery as a way for mystery shoppers to evaluate customer service.

This week, the United States Court of Appeals for the Fifth Circuit in Atlanta has ruled (PDF) such spoofing is allowed, but only when it’s done for the right reasons.

The case dates back to 2010, when Mississippi passed a state law similar to (but stronger than) the federal spoofing bill. It was called the “Caller ID Anti-Spoofing Act,” or ASA.

“ASA is more restrictive than TCIA,” the Fifth Circuit wrote. “On the one hand, spoofing done with ‘intent to defraud, cause harm, or wrongfully obtain anything of value’ (harmful spoofing), in violation of TCIA, is also in violation of ASA. On the other hand, spoofing done without such intent, but ‘with the intent to deceive... or mislead the recipient of the call’ (non-harmful spoofing), violates only ASA.”

Two out-of-state companies, Teltech Systems (the makers of SpoofCard) and Wonderland Rentals (the mystery shopper folks) challenged the state law, saying it conflicted with the federal law and also violated the First Amendment and the Commerce Clause in the constitution.

A federal judge ruled in favor of the two out-of-state plaintiffs. On Monday, a federal appeals court agreed—albeit for different reasons. The appeals court drew a clear line between “harmful” and “non-harmful” spoofing—essentially affirming the right to non-harmful spoofing despite what any state law says.

“In the light of [TCIA]’s carefully drafted language and legislative history, and in spite of the presumption against preemption that attaches to a State’s exercise of its police power, there is an inherent federal objective in TCIA to protect non-harmful spoofing,” the Fifth Circuit concluded. “ASA’s proscription of non-harmful spoofing—spoofing done without ‘intent to defraud, cause harm, or wrongfully obtain anything of value’—frustrates this federal objective and is, therefore, conflict-preempted.”