Please don't. One reason Dovecot is so easy to get up and running quickly is that it has minimal dependencies. For those of us who aren't running Linux on PCs that can become a headache very quickly, as the authors of many of the depended-upon libraries often get "creative" with nonportable GCCisms and other such nonsense. And even when one *is* running Linux on a PC, sometimes we don't want to build fifteen packages in order to build one.
That's not to say that simply adding one dependency on glib would cause a huge problem...but it indicates the adoption of a mindset, and it's a slippery slope.
I must say, though, that glib2 is rather excellent (and very portable)
It's among the few pieces of software that depending upon makes me trust more, not less.
Aria