Andy Rubin
Android cofounder Andy Rubin.
Flickr/Joi Ito
One email sent by Android cofounder Andy Rubin in 2006 may end up costing Google billions in its ongoing legal war with Oracle.

At the core of the case is whether Google infringed on Oracle's copyright by putting key pieces of the Java technology into the mega-popular Android operating system.

Java was first developed by Sun Microsystems, a company that Oracle acquired in 2009.

Shortly after the acquisition, Oracle filed a series of lawsuits against Google alleging infringement.

To prove its case, Oracle's legal team today dredged up an email from 2006, in which Rubin acknowledged that the Java programming-language APIs were copyrighted by Sun. This was reported by Vice Motherboard contributing editor Sarah Jeong on Twitter.

On the surface, this email shows that not only did Rubin, who was then leading Android, know that the Java application program interfaces were copyrightable, but that Google was knowingly and willfully circumventing Sun's copyright.

If and when the jury has to calculate damages owed to Oracle, this could end up seriously hurting Google.

Google, and the technology world at large, have been contending that APIs are not subject to copyright in the first place— it would make it legally difficult or impossible to build any kind of interoperability. That said, in 2014, an appeals court found in favor of Oracle in this lawsuit and ruled that APIs are, indeed, copyrightable.

This email doesn't necessarily sink Google's case entirely, though. The lawsuit is ongoing, and Google's defense hinges on the concept of fair use — the claim that it was legally allowed to use the Java APIs in Android regardless of whether Oracle can copyright them.

And while on the stand, Rubin walked this email back a little bit, saying that he merely meant that the implementation of the APIs was copyrightable, not the APIs themselves. It's a nerdy, but important, distinction.

But if the jury finds against Google in this case, then there's lots of buzz around the courtroom that Rubin's bombshell email could still demonstrate "willfulness," a big factor in determining the damages awarded to Oracle. With Oracle asking for $9 billion in damages, this one email could potentially tip the scales and cost Google millions or billions or dollars.

So as you've probably heard before: Be careful what you say in your work email account, or in your company Slack channel, or anywhere a record is kept. You never know when and where it'll come back to haunt you.

Get the latest Google stock price here.