Remember after Martha Coakley sued leading banks for illegal foreclosures in Massachusetts, when Ally Bank, one of the market leaders, stopped most of their lending in the state in a fit of pique? They actually only dropped their correspondent lending business, where a smaller bank does the origination and they pick up the loan later. They always continued direct lending to homeowners in Massachusetts. The entire enterprise was a bullying attempt to create bad headlines for Coakley and perceived repercussions for her actions.

Now, three months later, Ally has quietly returned to even the correspondent lending business.

Ally Financial Inc. has resumed some mortgage-lending activities in Massachusetts following a retreat from the state last year when it was sued by the state’s attorney general over improper foreclosures.

The government-owned lender started this week reaching out to “a few select correspondent lenders and wholesale brokers” in Massachusetts, Gina Proia, a spokeswoman for Ally, said Wednesday.

The decision is part of Ally’s normal evaluation of its business and is being done in a limited manner, she said.

The context for this is that Ally is in a lot of trouble. They were one of four banks to fail the stress tests released this week by the Federal Reserve. The government had to comp them half of their foreclosure fraud settlement penalty out of an “inability to pay” a $250 million fine. Ally may even put its subsidiary, Residential Capital, into bankruptcy, to evade some creditors, which would also help restart its forthcoming IPO. So I’m sure they’re looking for business anywhere they can get it at this point.

Meanwhile, the other half of this is that Coakley’s actual lawsuit, the impetus for Ally’s walkout, has been reduced significantly as a result of the settlement. She gave up the deceptive practices claims, while maintaining the “Ibanez” claims. Just yesterday, we learned that Coakley gave up some of the claims surrounding the banks’ use of MERS, and “cap any monetary relief it would seek from the banks for remaining claims at $2 million a bank.” So there’s far less danger for Ally to return to Massachusetts now. The “Ibanez” claims on illegal foreclosures may impact going-forward practices, but $2 million is a figure even Ally can handle.

One additional thing I didn’t mention about Ally – as the former GMAC Mortgage, it’s 74% owned by the government. So the government shaved off half of the penalty on a bank it mostly owns, so they can go public and pay back the government on its debts. Infuriating, ain’t it?