Afraid it's an expensive and common problem. When I first suffered the problem, I was under Warranty and BMW tried to dodge the issue. The second time they fixed it properly. Probably should have been a "Recall" item.
RepairPal Certified shops can diagnose and repair your 2004 BMW 325i. They provide transparent pricing with a minimum 12-month or 12,000-mile warranty on repairs and services.