I've recently discovered my sunroof was admitting water to the cabin, and, on investigation, found the guttering around the roof frame was pretty well filled with fine mud, which I assume was from decayed vegetation (I park under a tree). My own fault for not keeping it clean. The rubber seal around the sunroof panel and the mating metal frame surface was also fouled, which could not have helped. The main problem, once I had cleaned out all the gunk, was that the drain tubes in the front corners of the guttering, which extend down the windscreen pillars, were clogged, so the nice clean guttering was not draining. I have heard that this can be fixed by blowing with a high pressure air line, but, not having one handy, I decided to try rodding with a very narrow flexible length of steel, stripped from an old windscreen wiper blade (I don't throw things away as often as I should).
It needed a bit of manipulation (largely twisting the rod), to get it past some obstructing discontinuity in the drain pipe, but suddenly, when the rod was about 2/3 in the drain, the water commenced flowing, and was gone in a couple of seconds. And the rod came back out past the obstruction without too much difficulty, so, success.
Hope this helps someone else.