'Retrieve the current connections UIDVALIDITY value
UIDVALIDITY value will be cached on the first call.
:returns: The UIDVALIDITY as (long) number.'

def get_uidvalidity(self):

    if hasattr(self, '_uidvalidity'):
        return self._uidvalidity
    imapobj = self.imapserver.acquireconnection()
    try:
        self.__selectro(imapobj)
        (typ, uidval) = imapobj.response('UIDVALIDITY')
        assert ((uidval != [None]) and (uidval != None)), "response('UIDVALIDITY')    returned    [None]!"
        self._uidvalidity = int(uidval[(-1)])
        return self._uidvalidity
    finally:
        self.imapserver.releaseconnection(imapobj)
