This is not finished yet. More work than what I expected but the main part is done.
It will need a lot of testing... There is still a bug when activating a new extension
in development mode (ie. with python web server), I think it does not occur behind
a real web server.
This commit is contained in:
tonio
2010-05-04 17:25:23 +02:00
parent af8c33e659
commit 7480e479e7
15 changed files with 171 additions and 52 deletions
-1
View File
@@ -16,7 +16,6 @@ from mailng.lib import tables, imap_utf7, parameters
class WMtable(tables.Table):
tableid = "emails"
idkey = "imapid"
# selection = tables.SelectionColumn("selection", width="20px", first=True)
_1_flags = tables.ImgColumn("flags", width="4%",
header="<input type='checkbox' name='toggleselect' id='toggleselect' />")
_2_subject = tables.Column("subject", label=_("Subject"),
+5 -2
View File
@@ -34,6 +34,11 @@ def init():
parameters.register("webmail", "SMTP_SECURED", "list_yesno", "no",
help=_("Use a secured connection to access SMTP server"))
def destroy():
events.unregister("UserMenuDisplay", menu)
events.unregister("UserLogin", userlogin)
parameters.unregister_app("webmail")
def infos():
return {
"name" : "Webmail",
@@ -139,14 +144,12 @@ def viewmail(request, folder, mail_id=None):
def getmailcontent(request, folder, mail_id):
msg = fetchmail(request, folder, mail_id, True)
if "class" in msg.keys() and msg["class"] == "unseen":
#IMAPconnector(request).msg_read(*msg["imapid"].split("/"))
IMAPconnector(request).msg_read(folder, mail_id)
email = ImapEmail(msg, mode="html", links="1")
try:
pageid = request.session["page"]
except KeyError:
pageid = "1"
#folder, imapid = msg["imapid"].split("/")
return _render(request, "common/viewmail.html", {
"headers" : email.render_headers(folder, mail_id),
"folder" : folder, "imapid" : mail_id, "mailbody" : email.body,