I have recently been plagued by very much the same problems and it was driving me to distraction.
The main problem is using Mastik sealant around sunroof frame as it just goes mushy when applied to wet surfaces. I shopped around and eventually got the problem solved by using product from a company which goes under the name of KENT.
It's expensive and its called Leak-Seal. It can be used in wet conditions and sets to a rubbery finish; I also applied same around the aerial base as this too is notorious for allowing water through the infra-red sensor housing. URL for product is as follows: