*302The action was continued nisi for advisement, and the opinion of the Court delivered at the following March term, in Suffolk, by
Parsons, C. J.On the first count it is manifest that the action cannot be maintained. The consideration of the contract was a violation of the plaintiff’s official duty, and he cannot support an action to recover an indemnity for his own voluntary illegal conduct.
The plaintiff has urged his right to recover on the second count upon equitable grounds. But this count must share the same fate with the first. However this question might be settled on moral principles between parties equally guilty, we must be governed by the established maxims of law. The plaintiff has no legal remedy, either against Patterson, the debtor, or against Darling [ * 388 ] or Houghton; for an express promise to indemnify * him against the consequences of his own breach of duty cannot be valid, neither will the law imply a promise on an illegal consideration.
But it is said that if Patterson or Darling had paid the plaintiff the amount of Cassin’s execution, no action could be maintained to recover back the money so paid; and that as the money paid by Patterson to Darling must be considered as paid to Darling as the bailiff of the plaintiff, and as a voluntary payment to the plaintiff by Patterson, which he could not revoke, neither could Darling withhold the money from the plaintiff.
This position cannot be admitted in all its extent. If a debtor should send by his own servant, money which he owed to his creditor, and the servant refused to deliver it and retained it, an action for the money might be maintained by the creditor against the servant. But if the debtor had, before payment by the servant, countermanded his orders, and received back the money from his servant, he would not be liable to an action by the creditor; and any person, by whom the money was sent, would for this purpose be the servant of the debtor. It would be otherwise if the money had been sent, not by a servant of the debtor, but by an agent of the creditor; for then the debtor could have no further control over it, and the re ceipt of the money by the agent of the creditor would discharge the debtor.
In the present case, we cannot consider Patterson as a debtor to the plaintiff. But if we could, and that he sent the money by Darling to the plaintiff, Darling must be considered as the servant of Patterson, and not as the agent of the plaintiff; and the former might, before payment over, revoke the orders he had' given to Darling, and retake the money. For it is agreed that the plaintiff *303had no knowledge of the transactions between Patterson and Darling. and there could be no legal privity between Darling and the. plaintiff.
* This view of the question will not authorize a judg- [ * 389 ] ment for the plaintiff; and it is a view more favorable for him than the facts will warrant.
When Darling supposed that he was liable to the plaintiff upon his contract of indemnity, he applied to Patterson for an indemnity against his own contract with the plaintiff. The money was placed in his hands as a security against that contract, to enable him to repay to the plaintiff the amount of Cassin’s execution. But after-wards the same money was appropriated to Patterson's use by his order, and with Darling's assent. If Darling was willing to part with his security, the plaintiff has no legal ground of complaint; for Darling was not his agent to receive the money to his use from Patterson, the judgment debtor.
We do not discover any principles of law, on which the plaintiff can have judgment on his second count.
It is to be regretted that officers, having a plain path before them, will not pursue it. If they deviate from it, it must be at their own peril: and they cannot protect themselves against the damages arising from a breach of official duty, by any collateral stipulation for indemnity.
Plaintiff nonsuit.