示例#1
0
def run(data):
    from MailIntegrator import MailIntegrator
    import re
    #retText = "ADDING NEW USER"
    data = re.sub("\n|\r\n","",data)
    data = data.split(" ")
    username = data[0]
    mi = MailIntegrator()
    try:
        password = data[1]
        status = mi.createMailBox(username,password)
    except:
        status = mi.createMailBox(username)	    
    print mi.debugStack
    mi = False
    if status:
	return "200 OK\n"
    else:
	return "500 ERROR Mailbox already exists\n"
示例#2
0
def run(data):
    from MailIntegrator import MailIntegrator
    import re

    # retText = "PURGE USER"
    try:
        data = re.sub("\n|\r\n", "", data)
        data = data.split(" ")
        username = data[0]
        # password = data[1]
        # print data
        mi = MailIntegrator()
        mi.deleteMailBox(username, physDelete=1)
        print mi.debugStack
        mi = False
        return "200 OK\n"
    except errorName:
        print errorName
        return "500 ERROR " + errorName.toString() + "\n"
示例#3
0
def run(data):
    from MailIntegrator import MailIntegrator
    import re
    #retText = "PURGE USER"
    try:
	data = re.sub("\n|\r\n","",data)
	data = data.split(" ")
	username = data[0]
	try:
	    quota = data[1]
	except:
	    quota = ""
	if quota != "":
        #print data
	    mi = MailIntegrator()
	    mi.resizeBox(username,quota)
	    print mi.debugStack
    	    mi = False
	    return "200 OK\n"
	else:
	    return "500 ERROR QUOTA NOT SET\n"
    except errorName:
	print errorName
	return "500 ERROR "+ errorName.toString() + "\n"