Answer
(Fatwa: 789/789/M=1432)
The hadith mentioning that the salah of a drinker is not accepted for forty days is explained as to have threatening i.e. his salah will be valid but he will get no rewards thereupon. But, it is when one does not make taubah (repentance). If someone repents to Allah sincerely after drinking and resolves not to repeat it again, Allah will forgive his sins. Fasting for forty days is not a condition of taubah. But, it is established that good deeds cause to remove the sins; thus if someone fasts for forty days it will certainly be useful.
Allah (Subhana Wa Ta’ala) knows Best
Darul Ifta,
Darul Uloom Deoband