summaryrefslogtreecommitdiffstats
path: root/tests/functional/purge_imap.py
blob: f4d62e059c9c1dbb7fb643c4b732c599f07a8d5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import time

import pykolab

from pykolab import wap_client
from pykolab.imap import IMAP

conf = pykolab.getConf()


def purge_imap():
    time.sleep(2)

    imap = IMAP()
    imap.connect()

    for folder in imap.lm():
        try:
            imap.dm(folder)
        except:
            pass