Dennis Quaid's wife, Kimberly Buffington-Quaid, has filed for legal separation ... but sources tell us it's only a formality and the legal docs will be changed to a full-on divorce in several months.
Kimberly is asking for joint legal and sole physical custody of the couple's 4-year-old twins. She's down with Dennis getting visitation.
Kimberly, who's repped by disso-queen Laura Wasser, also wants spousal support and attorney's fees.
Kimberly filed for divorce in March but withdrew her petition 2 months later.
A source connected with the couple say "Kimberly is fed up with Dennis' cheating and wants out of the marriage." The source added, "He's not a good husband."
Here's the snag. They moved to California during the summer, and there's a 6-month residency requirement before someone can file for divorce, so she has to wait it out a few more months before pulling the trigger.
As you know, the couple has been through a lot. The twins almost died shortly after birth because they were given a massive overdose of a drug at the hospital.
Dennis and Kimberly have been married for 8 years.