The mess in which Hewlett-Packard finds itself, based on an internal investigation into leaks from its board of directors, is the product of a number of failures. Among the most significant, Hewlett-Packard’s lawyers failed in their primary duty to protect the client, by allowing outsiders to take control of the investigation of leaks from the boardroom. The self-important goal of ferreting out a leaker led to an investigation that included obtaining the private records of board members, executives and journalists by a method called “pretexting” — a fancy name for lying and deceit.

Like any corporate scandal, the Hewlett-Packard imbroglio contains a number of important lessons, especially for corporate lawyers. Two situations, both involving e-mails, stand out in showing how the company’s lawyers were not as careful as they should have been.