def sendmail(collection): view = collection.itsView name = collection.displayName dialog = SendMailDialog(name, view) dialog.CenterOnScreen() if dialog.ShowModal() == wx.ID_OK: params = dialog.getParameters(view) else: params = None dialog.Destroy() if params is not None: account = params['account'] commit = False if account is None: userid, server = params['to'].rsplit('@', 1) account = MailAccount(itsView=view, userid=userid, server=server, smtp=params['smtp'], imap=params['imap']) commit = True if collection.getACL('p2p', None) is None: acl = ACL() acl.append(ACE(schema.ns('p2p', view).all.itsUUID, Permissions.READ)) collection.setACL(acl, 'p2p') commit = True if commit: view.commit() account.login(setStatusMessage) account.send(params['to'], name)
def checkmail(view): dialog = CheckMailDialog(view) dialog.CenterOnScreen() if dialog.ShowModal() == wx.ID_OK: params = dialog.getParameters(view) else: params = None dialog.Destroy() if params is not None: account = params['account'] commit = False if account is None: userid, server = params['from'].rsplit('@', 1) account = MailAccount(itsView=view, userid=userid, server=server, smtp=params['smtp'], imap=params['imap']) view.commit() account.login(setStatusMessage) account.check(params['from'], None)
def sendmail(collection): view = collection.itsView name = collection.displayName dialog = SendMailDialog(name, view) dialog.CenterOnScreen() if dialog.ShowModal() == wx.ID_OK: params = dialog.getParameters(view) else: params = None dialog.Destroy() if params is not None: account = params['account'] commit = False if account is None: userid, server = params['to'].rsplit('@', 1) account = MailAccount(itsView=view, userid=userid, server=server, smtp=params['smtp'], imap=params['imap']) commit = True if collection.getACL('p2p', None) is None: acl = ACL() acl.append( ACE(schema.ns('p2p', view).all.itsUUID, Permissions.READ)) collection.setACL(acl, 'p2p') commit = True if commit: view.commit() account.login(setStatusMessage) account.send(params['to'], name)