some more mail stuff
This commit is contained in:
BIN
zefie_wtvp_minisrv/ServiceVault/wtv-mail/ROMCache/DottedLine.gif
Normal file
BIN
zefie_wtvp_minisrv/ServiceVault/wtv-mail/ROMCache/DottedLine.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 98 B |
BIN
zefie_wtvp_minisrv/ServiceVault/wtv-mail/ROMCache/PaperBase.gif
Normal file
BIN
zefie_wtvp_minisrv/ServiceVault/wtv-mail/ROMCache/PaperBase.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 186 B |
BIN
zefie_wtvp_minisrv/ServiceVault/wtv-mail/ROMCache/PaperTop.gif
Normal file
BIN
zefie_wtvp_minisrv/ServiceVault/wtv-mail/ROMCache/PaperTop.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
@@ -62,7 +62,8 @@ if (!intro_seen && !request_headers.query.intro_seen) {
|
|||||||
message_list_string = "No new mail messages for ";
|
message_list_string = "No new mail messages for ";
|
||||||
} else {
|
} else {
|
||||||
if (total_unread_message_count > 0) {
|
if (total_unread_message_count > 0) {
|
||||||
message_list_string = total_unread_message_count + " new mail message" + ((total_message_count != 1) ? 's' : '') + ", " + total_message_count + " mail message" + ((total_message_count != 1) ? 's' : '') + " for ";
|
message_list_string = total_unread_message_count + " new mail message" + ((total_message_count != 1) ? 's' : '');
|
||||||
|
if (total_message_count - total_unread_message_count > 0) message_list_string += ", " + (total_message_count - total_unread_message_count) + " mail message" + (((total_message_count - total_unread_message_count) != 1) ? 's' : '') + " for ";
|
||||||
} else {
|
} else {
|
||||||
message_list_string = total_message_count + " mail message" + ((total_message_count != 1) ? 's' : '') + " for ";
|
message_list_string = total_message_count + " mail message" + ((total_message_count != 1) ? 's' : '') + " for ";
|
||||||
}
|
}
|
||||||
@@ -282,7 +283,6 @@ ${username}@${minisrv_config.config.service_name}
|
|||||||
var message = message_list[k];
|
var message = message_list[k];
|
||||||
var message_font_open = "<font color=#7A9FCC>";
|
var message_font_open = "<font color=#7A9FCC>";
|
||||||
var message_font_close = "</font>";
|
var message_font_close = "</font>";
|
||||||
console.log(message);
|
|
||||||
if (message.unread) {
|
if (message.unread) {
|
||||||
message_font_open = `<b><font color=#99E6FF>`;
|
message_font_open = `<b><font color=#99E6FF>`;
|
||||||
message_font_close = "</font></b>"
|
message_font_close = "</font></b>"
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ From:
|
|||||||
<td width=10>
|
<td width=10>
|
||||||
<td>`;
|
<td>`;
|
||||||
if (message.from_name != message.from_addr) {
|
if (message.from_name != message.from_addr) {
|
||||||
data += `${html_entities.encode(message.from_addr)}<a href="client:showalert?sound=none&message=To%20add%20%3Cblackface%3E${escape(escape(message.from_name))}%3C%2Fblackface%3E%20to%20your%20Address%20book,%20choose%20%3Cb%3EAdd%3C%2Fb%3E.&buttonlabel2=Cancel&buttonaction2=client:donothing&buttonlabel1=Add&buttonaction1=wtv-mail:/addressbook%3Faction%3Deditfromheader%26noresponse%3Dtrue%26nickname%3D${escape(escape(message.from_name))}%26address%3D${escape(escape(message.from_addr))}%26new_address%3Dtrue">(${html_entities.encode(message.from_name)})</a>`;
|
data += `${html_entities.encode(message.from_addr)} <a href="client:showalert?sound=none&message=To%20add%20%3Cblackface%3E${escape(escape(message.from_name))}%3C%2Fblackface%3E%20to%20your%20Address%20book,%20choose%20%3Cb%3EAdd%3C%2Fb%3E.&buttonlabel2=Cancel&buttonaction2=client:donothing&buttonlabel1=Add&buttonaction1=wtv-mail:/addressbook%3Faction%3Deditfromheader%26noresponse%3Dtrue%26nickname%3D${escape(escape(message.from_name))}%26address%3D${escape(escape(message.from_addr))}%26new_address%3Dtrue">(${html_entities.encode(message.from_name)})</a>`;
|
||||||
} else {
|
} else {
|
||||||
data += `${html_entities.encode(message.from_addr)}`;
|
data += `${html_entities.encode(message.from_addr)}`;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,22 +28,33 @@ if (!intro_seen && !request_headers.query.intro_seen) {
|
|||||||
'noback': true,
|
'noback': true,
|
||||||
}).getURL();
|
}).getURL();
|
||||||
|
|
||||||
|
if (request_headers.query.sendoff == "Send") {
|
||||||
|
var from_addr = address;
|
||||||
|
var to_addr = request_headers.query.message_to;
|
||||||
|
var msg_subject = request_headers.query.message_subject;
|
||||||
|
var msg_body = request_headers.query.message_body;
|
||||||
|
var to_name = request_headers.query.whatever_webtv_sends_this_as || null;
|
||||||
|
var signature = ssid_sessions[socket.ssid].getSessionData("subscriber_signature") || null;
|
||||||
|
var messagereturn = ssid_sessions[socket.ssid].mailstore.sendMessageToAddr(from_addr, to_addr, msg_body, msg_subject, userdisplayname, to_name, signature);
|
||||||
|
if (messagereturn !== true) {
|
||||||
|
var errpage = wtvshared.doErrorPage(400, messagereturn);
|
||||||
|
headers = errpage[0];
|
||||||
|
data = errpage[1];
|
||||||
|
} else {
|
||||||
|
headers = `300 OK
|
||||||
|
wtv-expire: wtv-mail:/listmail
|
||||||
|
Location: wtv-mail:/listmail`;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
headers = `200 OK
|
headers = `200 OK
|
||||||
Content-type text/html`;
|
Content-type text/html`;
|
||||||
|
|
||||||
data = `<display poweroffalert >
|
data = `<html>
|
||||||
<sendpanel
|
|
||||||
action="javascript:Submit()"
|
|
||||||
message="Send this message now"
|
|
||||||
label="Send message">
|
|
||||||
<savepanel message="Messages that you are writing cannot be saved. Send it to yourself if you would like a copy.">
|
|
||||||
<HTML>
|
|
||||||
<head>
|
<head>
|
||||||
|
<display poweroffalert >
|
||||||
<script language=javascript>
|
<script language=javascript>
|
||||||
function Submit() { if (document.sendform.message_to.value == "") { location = "client:showalert?message=Your%20message%20could%20not%20be%20sent.%3Cp%3E%0AYou%20must%20specify%20an%20addressee%20in%20the%20%3Cblackface%3ETo%3A%3C%2Fblackface%3E%20area.%0A&buttonLabel1=Continue%0A&buttonAction1=client%3Adonothing&buttonLabel2=";
|
function Submit() { window.open("client:showsplash?message=Sending%20Message&animation=file://ROM/Animations/mail.ani&action=client:submitform%3Fname%3Dsendform%26submitname%3Dsendoff%26submitvalue%3DSend");
|
||||||
} else { location = "client:showsplash?message=Sending%20Message&animation=file://ROM/Animations/mail.ani&action=client:submitform%3Fname%3Dsendform%26submitname%3Dsendoff%26submitvalue%3DSend";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
function ErasingMedia(victim) { var myURL;
|
function ErasingMedia(victim) { var myURL;
|
||||||
myURL = "client:submitform?name=sendform&submitvalue=false" + "&submitname=" + victim;
|
myURL = "client:submitform?name=sendform&submitvalue=false" + "&submitname=" + victim;
|
||||||
@@ -51,198 +62,316 @@ if (victim == "gabbing") { document.forms.sendform.elements.message_voicemail_da
|
|||||||
}
|
}
|
||||||
if (victim == "snapping") { document.forms.sendform.elements.message_snapshot_data.disabled = true;
|
if (victim == "snapping") { document.forms.sendform.elements.message_snapshot_data.disabled = true;
|
||||||
}
|
}
|
||||||
location = myURL;
|
window.open(myURL); }
|
||||||
location.reload(); }
|
function DoneSnapping() { var myURL;
|
||||||
function Signing(desiredState) { var myURL;
|
myURL = "client:submitform?name=sendform&submitname=snapping&submitvalue=cache%3Asnapshot.jpg";
|
||||||
myURL="client:submitform?name=sendform&submitvalue=false"+"&submitname=togglesign";
|
window.open(myURL); }
|
||||||
location = myURL;
|
|
||||||
location.reload();
|
|
||||||
}
|
|
||||||
function DoneSnapping() { location = "client:submitform?name=sendform&submitname=snapping&submitvalue=true";
|
|
||||||
location.reload(); }
|
|
||||||
function DoneGabbing() { var myURL;
|
function DoneGabbing() { var myURL;
|
||||||
myURL = "client:submitform?name=sendform&submitname=gabbing&submitvalue=cache%3Avoicemail.wav";
|
myURL = "client:submitform?name=sendform&submitname=gabbing&submitvalue=cache%3Avoicemail.jpg";
|
||||||
location = "client:submitform?name=sendform&submitname=gabbing&submitvalue=true";
|
window.open(myURL); }
|
||||||
location.reload(); }
|
|
||||||
</script>
|
</script>
|
||||||
|
<sendpanel
|
||||||
|
action="javascript:Submit()"
|
||||||
|
message="Send this message now"
|
||||||
|
label="Send message"
|
||||||
|
>
|
||||||
|
<savepanel message="Messages that you are writing cannot be saved. Send it to yourself if you would like a copy." >
|
||||||
<title>
|
<title>
|
||||||
Write an e-mail message
|
Write a message
|
||||||
</title>
|
</title>
|
||||||
</head>
|
</head>
|
||||||
<body bgcolor="#171726" text="#82A9D9" link="#BDA73A" vlink="#62B362" vspace=0 hspace=0>
|
<print blackandwhite>
|
||||||
|
<sidebar width=114 height=420 align=left>
|
||||||
|
<table cellspacing=0 cellpadding=0 bgcolor=333b5a>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 width=104 absheight=4>
|
||||||
|
<td rowspan=100 width=10 height=420 valign=top align=left bgcolor=191919>
|
||||||
|
<img src="wtv-mail:/ROMCache/Shadow.gif" width=6 height=420>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=6>
|
||||||
|
<td abswidth=93 absheight=76>
|
||||||
|
<table href="wtv-home:/home" absheight=76 cellspacing=0 cellpadding=0 width=100%>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=6>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1>
|
||||||
|
<td align=center>
|
||||||
|
<img src="${minisrv_config.config.service_logo}" width=87 height=67>
|
||||||
|
</table>
|
||||||
|
<td abswidth=5>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=middle align=center bgcolor=202434>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=1 valign=top align=left>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=top align=left bgcolor=515b84>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=6>
|
||||||
|
<td abswidth=93 absheight=26>
|
||||||
|
<table href="wtv-mail:/listmail"
|
||||||
|
cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=5>
|
||||||
|
<td abswidth=90 valign=middle align=left>
|
||||||
|
<table bgcolor=333b5a cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td absheight=1>
|
||||||
|
<tr>
|
||||||
|
<td maxlines=1><shadow><font sizerange=medium color="E7CE4A">Mail list</font></shadow>
|
||||||
|
</table>
|
||||||
|
</table>
|
||||||
|
<td abswidth=5>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=middle align=center bgcolor=202434>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=1 valign=top align=left>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=top align=left bgcolor=515b84>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=6>
|
||||||
|
<td abswidth=93 absheight=26>
|
||||||
|
<table href="client:openaddresspanel" id=addressbook
|
||||||
|
cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=5>
|
||||||
|
<td abswidth=90 valign=middle align=left>
|
||||||
|
<table bgcolor=333b5a cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td absheight=1>
|
||||||
|
<tr>
|
||||||
|
<td maxlines=1><shadow><font sizerange=medium color="E7CE4A">Address</font></shadow>
|
||||||
|
</table>
|
||||||
|
</table>
|
||||||
|
<td abswidth=5>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=middle align=center bgcolor=202434>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=1 valign=top align=left>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=top align=left bgcolor=515b84>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=6>
|
||||||
|
<td abswidth=93 absheight=26>
|
||||||
|
<table href="client:videocapture?notify=javascript%3ADoneSnapping()&device=video&width=75%25&height=75%25&name=cache%3Asnapshot.jpg&donebuttonlabel=Add%20to%20Message&open"
|
||||||
|
cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=5>
|
||||||
|
<td abswidth=90 valign=middle align=left>
|
||||||
|
<table bgcolor=333b5a cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td absheight=1>
|
||||||
|
<tr>
|
||||||
|
<td maxlines=1><shadow><font sizerange=medium color="E7CE4A">Photo</font></shadow>
|
||||||
|
</table>
|
||||||
|
</table>
|
||||||
|
<td abswidth=5>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=middle align=center bgcolor=202434>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=1 valign=top align=left>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=top align=left bgcolor=515b84>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=6>
|
||||||
|
<td abswidth=93 absheight=26>
|
||||||
|
<table href="client:soundcapture?notify=javascript%3ADoneGabbing()&device=audio&rate=8000&name=cache%3Avoicemail.wav&donebuttonlabel=Add%20to%20Message&open"
|
||||||
|
cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=5>
|
||||||
|
<td abswidth=90 valign=middle align=left>
|
||||||
|
<table bgcolor=333b5a cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td absheight=1>
|
||||||
|
<tr>
|
||||||
|
<td maxlines=1><shadow><font sizerange=medium color="E7CE4A">Recording</font></shadow>
|
||||||
|
</table>
|
||||||
|
</table>
|
||||||
|
<td abswidth=5>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=middle align=center bgcolor=202434>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=1 valign=top align=left>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=top align=left bgcolor=515b84>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=6>
|
||||||
|
<td abswidth=93 absheight=26>
|
||||||
|
<table href="client:showalert?sound=none&message=Are%20you%20sure%20you%20want%20to%20erase%20the%20changes%20to%20this%20message%3F&buttonlabel2=Don't%20Erase&buttonaction2=client:donothing&buttonlabel1=Erase&buttonaction1=wtv-mail:/sendmail%3Fclear%3Dtrue%26wtv-saved-message-id%3Dwritemessage-outbox#focus"
|
||||||
|
cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=5>
|
||||||
|
<td abswidth=90 valign=middle align=left>
|
||||||
|
<table bgcolor=333b5a cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td absheight=1>
|
||||||
|
<tr>
|
||||||
|
<td maxlines=1><shadow><font sizerange=medium color="E7CE4A">Erase</font></shadow>
|
||||||
|
</table>
|
||||||
|
</table>
|
||||||
|
<td abswidth=5>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=middle align=center bgcolor=202434>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=1 valign=top align=left>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=top align=left bgcolor=515b84>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=6>
|
||||||
|
<td abswidth=93 absheight=26>
|
||||||
|
<table href="client:submitform?name=sendform&submitname=spelling&submitvalue=true"
|
||||||
|
cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=5>
|
||||||
|
<td abswidth=90 valign=middle align=left>
|
||||||
|
<table bgcolor=333b5a cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td absheight=1>
|
||||||
|
<tr>
|
||||||
|
<td maxlines=1><shadow><font sizerange=medium color="E7CE4A">Spelling</font></shadow>
|
||||||
|
</table>
|
||||||
|
</table>
|
||||||
|
<td abswidth=5>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=middle align=center bgcolor=202434>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=1 valign=top align=left>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=top align=left bgcolor=515b84>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=6>
|
||||||
|
<td abswidth=93 absheight=26>
|
||||||
|
<table href="wtv-guide:/help/Mail/Write/Writing"
|
||||||
|
cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td abswidth=5>
|
||||||
|
<td abswidth=90 valign=middle align=left>
|
||||||
|
<table bgcolor=333b5a cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td absheight=1>
|
||||||
|
<tr>
|
||||||
|
<td maxlines=1><shadow><font sizerange=medium color="E7CE4A">Help</font></shadow>
|
||||||
|
</table>
|
||||||
|
</table>
|
||||||
|
<td abswidth=5>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=middle align=center bgcolor=202434>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=1 valign=top align=left>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 absheight=2 valign=top align=left bgcolor=515b84>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
|
<tr>
|
||||||
|
<td colspan=3 height=81 valign=bottom align=right>
|
||||||
|
<tr><td colspan=3 absheight=36>
|
||||||
|
</table>
|
||||||
|
</sidebar>
|
||||||
|
<body instructions="wtv-guide:/helpindex?title=Index_Mail"
|
||||||
|
bgcolor=191919
|
||||||
|
text=42BD52
|
||||||
|
link=189CD6
|
||||||
|
vlink=189CD6
|
||||||
|
vspace=0
|
||||||
|
hspace=0
|
||||||
|
>
|
||||||
|
<table cellspacing=0 cellpadding=0>
|
||||||
|
<tr>
|
||||||
|
<td height=16 valign=top align=left>
|
||||||
|
<tr>
|
||||||
|
<td height=47 valign=top>
|
||||||
|
<font size=+1 color="E7CE4A">
|
||||||
|
<blackface>
|
||||||
|
<shadow>
|
||||||
|
<a id=focus></a>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=4 height=2>
|
||||||
|
Write a message
|
||||||
|
</shadow>
|
||||||
|
</blackface>
|
||||||
|
</font>
|
||||||
|
</table>
|
||||||
<form action="wtv-mail:/sendmail#focus" method="post" name=sendform >
|
<form action="wtv-mail:/sendmail#focus" method="post" name=sendform >
|
||||||
<input type=hidden name=skey value="Kx0uv4a00C4">
|
|
||||||
<input type=hidden name="wtv-saved-message-id" value="writemessage-outbox">
|
<input type=hidden name="wtv-saved-message-id" value="writemessage-outbox">
|
||||||
<input type=hidden name="message_reply_all_cc" value="">
|
<input type=hidden name="message_reply_all_cc" value="">
|
||||||
<input type=hidden name="saveoff" value="true" autosubmit="onleave">
|
<input type=hidden name="saveoff" value="true" autosubmit="onleave">
|
||||||
<sidebar width=109>
|
<table cellspacing=0 cellpadding=0 bgcolor="242424"
|
||||||
<table cellspacing=0 cellpadding=0>
|
background=""
|
||||||
|
>
|
||||||
<tr>
|
<tr>
|
||||||
<td width=104 height=420 bgcolor=#262E3D valign=top>
|
<td rowspan=100 abswidth=10 bgcolor=191919>
|
||||||
<table cellspacing=0 cellpadding=0>
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=10 height=1>
|
||||||
|
<td colspan=9 abswidth=422 valign=bottom>
|
||||||
|
<img src="wtv-mail:/ROMCache/PaperTop.gif" noprint width=422 height=26>
|
||||||
<tr>
|
<tr>
|
||||||
<td height=7 colspan=3>
|
<td rowspan=100 abswidth=2 absheight=0 bgcolor=313131>
|
||||||
<spacer type=vertical size=7>
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
<tr>
|
<td rowspan=100 abswidth=14 absheight=0>
|
||||||
<td width=7>
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
<spacer type=horizontal size=7>
|
<td colspan=2 abswidth=386>
|
||||||
<td width=87 href="wtv-home:/home">
|
<td rowspan=100 abswidth=14 absheight=0>
|
||||||
<img src="${minisrv_config.config.service_logo}" width=87 height=67>
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
<td width=10>
|
<td rowspan=100 abswidth=3 bgcolor=0b0b0b absheight=0>
|
||||||
<spacer type=horizontal size=10>
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
</table>
|
<td rowspan=100 abswidth=1 bgcolor=0f0f0f absheight=0>
|
||||||
<spacer type=vertical size=6>
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
<table cellspacing=0 cellpadding=0 border=0>
|
<td rowspan=100 abswidth=1 bgcolor=131313 absheight=0>
|
||||||
<tr> <td bgcolor=#4A525A height=2 width=104 colspan=3>
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
<tr>
|
<td rowspan=100 abswidth=1 bgcolor=171717 absheight=0>
|
||||||
<td width=10 height=26>
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=1>
|
||||||
<td width=89 valgn=middle>
|
<tr absheight=30>
|
||||||
<table cellspacing=0 cellpadding=0 href="wtv-mail:/listmail" >
|
<td abswidth=80 valign=top align=right>
|
||||||
<tr>
|
<font color="42BD52">
|
||||||
<td height=1>
|
From:
|
||||||
<tr>
|
<td abswidth=306>
|
||||||
<td><shadow><font sizerange=medium color=#E6CD4A>Mail list</font></shadow>
|
<font color="42BD52">
|
||||||
</table>
|
|
||||||
<td width=5>
|
|
||||||
<tr> <td bgcolor=#4A525A height=2 width=104 colspan=3>
|
|
||||||
<tr>
|
|
||||||
<td width=10 height=26>
|
|
||||||
<td width=89 valgn=middle>
|
|
||||||
<table cellspacing=0 cellpadding=0 href="client:openaddresspanel" id=addressbook>
|
|
||||||
<tr>
|
|
||||||
<td height=1>
|
|
||||||
<tr>
|
|
||||||
<td><shadow><font sizerange=medium color=#E6CD4A>Address</font></shadow>
|
|
||||||
</table>
|
|
||||||
<td width=5>
|
|
||||||
<tr> <td bgcolor=#4A525A height=2 width=104 colspan=3>
|
|
||||||
<tr>
|
|
||||||
<td width=10 height=26>
|
|
||||||
<td width=89 valgn=middle>
|
|
||||||
<table cellspacing=0 cellpadding=0 href="client:videocapture?notify=javascript%3ADoneSnapping()&device=video&width=100%25&height=100%25&name=cache%3Asnapshot.jpg&donebuttonlabel=Add%20to%20Message&open" id=addressbook>
|
|
||||||
<tr>
|
|
||||||
<td height=1>
|
|
||||||
<tr>
|
|
||||||
<td><shadow><font sizerange=medium color=#E6CD4A>Photo</font></shadow>
|
|
||||||
</table>
|
|
||||||
<td width=5>
|
|
||||||
<tr> <td bgcolor=#4A525A height=2 width=104 colspan=3>
|
|
||||||
<tr>
|
|
||||||
<td width=10 height=26>
|
|
||||||
<td width=89 valgn=middle>
|
|
||||||
<table cellspacing=0 cellpadding=0 href="client:soundcapture?notify=javascript%3ADoneGabbing()&device=audio&rate=8000&name=cache%3Avoicemail.wav&donebuttonlabel=Add%20to%20Message&open" id=addressbook>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td height=1>
|
|
||||||
<tr>
|
|
||||||
<td><shadow><font sizerange=medium color=#E6CD4A>Recording</font></shadow>
|
|
||||||
</table>
|
|
||||||
<td width=5>
|
|
||||||
<tr> <td bgcolor=#4A525A height=2 width=104 colspan=3>
|
|
||||||
<tr>
|
|
||||||
<td width=10 height=26>
|
|
||||||
<td width=89 valgn=middle>
|
|
||||||
<table cellspacing=0 cellpadding=0 href="client:showalert?sound=none&message=Are%20you%20sure%20you%20want%20to%20erase%20this%20entire%20message%3F&buttonlabel2=Don't%20Erase&buttonaction2=client:donothing&buttonlabel1=Erase&buttonaction1=wtv-mail:/sendmail%3Fclear%3Dtrue%26wtv-saved-message-id%3Dwritemessage-outbox" id=addressbook>
|
|
||||||
<tr>
|
|
||||||
<td height=1>
|
|
||||||
<tr>
|
|
||||||
<td><shadow><font sizerange=medium color=#E6CD4A>Erase</font></shadow>
|
|
||||||
</table>
|
|
||||||
<td width=5>
|
|
||||||
<tr> <td bgcolor=#4A525A height=2 width=104 colspan=3>
|
|
||||||
<tr>
|
|
||||||
<td width=10 height=26>
|
|
||||||
<td width=89 valgn=middle>
|
|
||||||
</table>
|
|
||||||
</sidebar>
|
|
||||||
<table cellspacing=0 cellpadding=0 border=0>
|
|
||||||
<tr>
|
|
||||||
<td width=451 colspan=2 align=center bgcolor=#5B6C81>
|
|
||||||
<spacer type=vertical size=13>
|
|
||||||
<tr>
|
|
||||||
<td height=8 bgcolor=#171726 colspan=2>
|
|
||||||
<img src="wtv-mail:/content/images/CornerTop.gif" width=8 height=8>
|
|
||||||
<tr>
|
|
||||||
<td bgcolor=#171726 width=451 valign=top>
|
|
||||||
<table cellspacing=0 cellpadding=0 width=451>
|
|
||||||
<tr>
|
|
||||||
<td bgcolor=#171726 width=13>
|
|
||||||
<spacer type=horizontal size=13>
|
|
||||||
<td height=80>
|
|
||||||
<img src="wtv-mail:/content/images/Mail.gif" width=87 height=45>
|
|
||||||
<img src="wtv-mail:/content/images/${ssid_sessions[socket.ssid].mailstore.getMailboxIcon()}" width=74 height=45 transparency=60>
|
|
||||||
<td width=250 align=left><font sizerange=small>
|
|
||||||
</table>
|
|
||||||
<tr>
|
|
||||||
<td colspan=2>
|
|
||||||
<table cellspacing=0 cellpadding=0 bgcolor=#2C323D>
|
|
||||||
<tr>
|
|
||||||
<td width=451 absheight=25>
|
|
||||||
<table cellspacing=0 cellpadding=0>
|
|
||||||
<tr>
|
|
||||||
<td width=13 absheight=25>
|
|
||||||
<spacer type=horizontal size=13>
|
|
||||||
<td width=370 maxlines=1>
|
|
||||||
<font sizerange=medium color=#D6D6D6><blackface>
|
|
||||||
Write an e-mail message
|
|
||||||
</blackface></font>
|
|
||||||
<!--
|
|
||||||
<td width=21>
|
|
||||||
<img src="wtv-mail:/content/images/widget.gif" width=16 height=16 noprint>
|
|
||||||
<td width=36>
|
|
||||||
<spacer type=vertical size=1><br>
|
|
||||||
<a href="wtv-guide:/help?topic=Mail&subtopic=Index&appName=Mail" ><img src="wtv-mail:/content/images/mail_help_image.gif" width=35 height=17 noprint></a> -->
|
|
||||||
<td width=13>
|
|
||||||
<spacer type=horizontal size=13>
|
|
||||||
</table>
|
|
||||||
</table>
|
|
||||||
</table>
|
|
||||||
<table cellspacing=0 cellpadding=0 border=0>
|
|
||||||
<tr>
|
|
||||||
<td bgcolor=#171726 width=13>
|
|
||||||
<spacer type=horizontal size=13>
|
|
||||||
<td bgcolor=#171726 width=438 valign=top>
|
|
||||||
<spacer type=vertical size=5><br>
|
|
||||||
<table cellspacing=0 cellpadding=0 bgcolor="#1F2033">
|
|
||||||
<tr>
|
|
||||||
<td absheight=2 colspan=5 bgcolor=#495360>
|
|
||||||
<tr>
|
|
||||||
<td abswidth=2 bgcolor=#495360>
|
|
||||||
<td absheight=13 colspan=3>
|
|
||||||
<td abswidth=2 bgcolor=#000000>
|
|
||||||
<tr>
|
|
||||||
<td abswidth=2 bgcolor=#495360>
|
|
||||||
<td abswidth=13>
|
|
||||||
<td abswidth=385>
|
|
||||||
<table cellspacing=0 cellpadding=0> <tr>
|
|
||||||
<td width=80 valign=top align=right>
|
|
||||||
<font color=#82A9D9>From: </font>
|
|
||||||
<td width=305 valign=top>
|
|
||||||
<font color=#82A9D9><table cellspacing=0 cellpadding=0 border=0>
|
|
||||||
<TR><TD maxlines="1">
|
|
||||||
${address}
|
${address}
|
||||||
</TD></TR>
|
(${userdisplayname})</font>
|
||||||
</TABLE></font>
|
|
||||||
<font color=#82A9D9>(${userdisplayname})</font>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td height=13 valign=middle colspan=2>
|
<td colspan=2 absheight=5>
|
||||||
<img src="wtv-mail:/content/images/sendmail_panel_dots.gif" width=385 height=2>
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=5>
|
||||||
|
<tr absheight=4>
|
||||||
|
<td colspan=2>
|
||||||
|
<img src="wtv-mail:/ROMCache/DottedLine.gif" width=386 height=2>
|
||||||
<tr>
|
<tr>
|
||||||
<td width=80 valign=top align=right>
|
<td colspan=2 absheight=5>
|
||||||
<a href="client:openaddresspanel">To:</a>
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=5>
|
||||||
<td width=305 valign=top>
|
<tr height=30>
|
||||||
|
<td abswidth=80 valign=top align=right>
|
||||||
|
<a href="client:openaddresspanel">
|
||||||
|
To:</a>
|
||||||
|
<td abswidth=306>
|
||||||
<textarea
|
<textarea
|
||||||
bgcolor="#1F2033"
|
bgcolor="242424"
|
||||||
cursor=#BDA73A
|
cursor=#cc9933
|
||||||
nosoftbreaks
|
nosoftbreaks
|
||||||
borderimage="file://ROM/Borders/textfield.alt1.bif"
|
borderimage="file://ROM/Borders/textfield.alt1.bif"
|
||||||
nohardbreaks
|
nohardbreaks
|
||||||
selected
|
selected
|
||||||
font=proportional
|
font=proportional
|
||||||
text=#82A9D9
|
text="42BD52"
|
||||||
name="message_to"
|
name="message_to"
|
||||||
border=0
|
border=0
|
||||||
width=305 rows=1
|
width=306 rows=1
|
||||||
growable
|
growable
|
||||||
autoactivate
|
autoactivate
|
||||||
addresses
|
addresses
|
||||||
@@ -250,22 +379,29 @@ autoascii
|
|||||||
nohighlight
|
nohighlight
|
||||||
></textarea>
|
></textarea>
|
||||||
<tr>
|
<tr>
|
||||||
<td height=13 valign=middle colspan=2>
|
<td colspan=2 absheight=5>
|
||||||
<img src="wtv-mail:/content/images/sendmail_panel_dots.gif" width=385 height=2>
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=5>
|
||||||
|
<tr absheight=4>
|
||||||
|
<td colspan=2>
|
||||||
|
<img src="wtv-mail:/ROMCache/DottedLine.gif" width=386 height=2>
|
||||||
<tr>
|
<tr>
|
||||||
<td abswidth=83 valign=top align=right>
|
<td colspan=2 absheight=5>
|
||||||
<font color=#82A9D9>Subject: </font>
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=5>
|
||||||
<td width=305 valign=top>
|
<tr height=30>
|
||||||
|
<td abswidth=80 valign=top align=right nowrap>
|
||||||
|
<font color="42BD52">
|
||||||
|
Subject:
|
||||||
|
<td abswidth=306>
|
||||||
<textarea
|
<textarea
|
||||||
bgcolor="#1F2033"
|
bgcolor="242424"
|
||||||
cursor=#BDA73A
|
cursor=#cc9933
|
||||||
nosoftbreaks
|
nosoftbreaks
|
||||||
borderimage="file://ROM/Borders/textfield.alt1.bif"
|
borderimage="file://ROM/Borders/textfield.alt1.bif"
|
||||||
nohardbreaks
|
nohardbreaks
|
||||||
text=#82A9D9
|
text="42BD52"
|
||||||
name="message_subject" font=proportional
|
name="message_subject" font=proportional
|
||||||
border=0
|
border=0
|
||||||
width=305 rows=1
|
width=306 rows=1
|
||||||
growable
|
growable
|
||||||
autoactivate
|
autoactivate
|
||||||
maxlength=70
|
maxlength=70
|
||||||
@@ -273,36 +409,52 @@ nohighlight
|
|||||||
autohiragana
|
autohiragana
|
||||||
></textarea>
|
></textarea>
|
||||||
<tr>
|
<tr>
|
||||||
<td height=13 valign=middle colspan=2>
|
<td colspan=2 absheight=5>
|
||||||
<img src="wtv-mail:/content/images/sendmail_panel_dots.gif" width=385 height=2>
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=5>
|
||||||
|
<tr absheight=4>
|
||||||
|
<td colspan=2>
|
||||||
|
<img src="wtv-mail:/ROMCache/DottedLine.gif" width=386 height=2>
|
||||||
<tr>
|
<tr>
|
||||||
<td width=305 colspan=2>
|
<td colspan=2 absheight=5>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=5>
|
||||||
|
<tr>
|
||||||
|
<td colspan=2 absheight=10>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=10>
|
||||||
|
<tr>
|
||||||
|
<td colspan=2 abswidth=386 !!xabswidth=386>
|
||||||
<textarea nosoftbreaks
|
<textarea nosoftbreaks
|
||||||
bgcolor="#1F2033"
|
bgcolor="242424"
|
||||||
text=#82A9D9
|
text="42BD52"
|
||||||
cursor=#BDA73A
|
cursor=#cc9933
|
||||||
name="message_body" font=proportional
|
name="message_body" font=proportional
|
||||||
border=0
|
border=0
|
||||||
rows=4
|
rows=5
|
||||||
width=386
|
width=386
|
||||||
nohighlight
|
nohighlight
|
||||||
autoactivate
|
autoactivate
|
||||||
autohiragana
|
growable></textarea>
|
||||||
growable
|
<input type=hidden name="no_signature" value="true">
|
||||||
nextdown="Send"></textarea>
|
<tr>
|
||||||
|
<td colspan=2 absheight=8>
|
||||||
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=8>
|
||||||
</table>
|
</table>
|
||||||
<body bgcolor=#1F2033
|
<table cellspacing=0 cellpadding=0>
|
||||||
text=#82A9D9
|
<tr>
|
||||||
link=#BDA73A
|
<td rowspan=100 abswidth=10>
|
||||||
vlink=#62B362
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=10 height=2>
|
||||||
vspace=0
|
<td abswidth=422>
|
||||||
hspace=0>`;
|
<img src="wtv-mail:/ROMCache/PaperBase.gif" noprint
|
||||||
if (!ssid_sessions[socket.ssid].getSessionData("subscriber_signature") || ssid_sessions[socket.ssid].getSessionData("subscriber_signature") == "") {
|
width=422 height=6>
|
||||||
data += `<input type=hidden name="no_signature" value="true"> <td abswidth=13>`;
|
<tr>
|
||||||
} else {
|
<td absheight=6>
|
||||||
data += `<input type=checkbox name="no_signature"> <td abswidth=13> Disable Signature`;
|
<img src="wtv-home:/ROMCache/Spacer.gif" width=1 height=6>
|
||||||
}
|
</table>`;
|
||||||
data += `
|
if (!ssid_sessions[socket.ssid].getSessionData("subscriber_signature") || ssid_sessions[socket.ssid].getSessionData("subscriber_signature") == "") {
|
||||||
|
data += `<input type=hidden name="no_signature" value="true"> <td abswidth=13>`;
|
||||||
|
} else {
|
||||||
|
data += `<input type=checkbox name="no_signature"> <td abswidth=13> Disable Signature`;
|
||||||
|
}
|
||||||
|
data += `
|
||||||
<td abswidth=2 bgcolor=#000000>
|
<td abswidth=2 bgcolor=#000000>
|
||||||
<tr>
|
<tr>
|
||||||
<td abswidth=2 bgcolor=#495360>
|
<td abswidth=2 bgcolor=#495360>
|
||||||
@@ -334,4 +486,5 @@ USESTYLE NOARGS>
|
|||||||
</body>
|
</body>
|
||||||
</HTML>
|
</HTML>
|
||||||
`;
|
`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -228,13 +228,23 @@ class WTVMail {
|
|||||||
var self = this;
|
var self = this;
|
||||||
var files = this.fs.readdirSync(mailbox_path)
|
var files = this.fs.readdirSync(mailbox_path)
|
||||||
.map(function (v) {
|
.map(function (v) {
|
||||||
|
var message_data_raw = null;
|
||||||
|
var message_date = null;
|
||||||
|
var message_path = mailbox_path + self.path.sep + v;
|
||||||
|
if (self.fs.existsSync(message_path)) message_data_raw = self.fs.readFileSync(message_path);
|
||||||
|
if (message_data_raw) {
|
||||||
|
var message_data = JSON.parse(message_data_raw);
|
||||||
|
if (message_data) message_date = message_data.date;
|
||||||
|
}
|
||||||
|
var message_date_ret = (message_date) ? message_date : self.fs.statSync(mailbox_path + self.path.sep + v).mtime.getTime();
|
||||||
|
self.fs.statSync(mailbox_path + self.path.sep + v).mtime.getTime()
|
||||||
return {
|
return {
|
||||||
name: v,
|
name: v,
|
||||||
time: self.fs.statSync(mailbox_path + self.path.sep + v).mtime.getTime()
|
time: message_date_ret
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
.sort(function (a, b) {
|
.sort(function (a, b) {
|
||||||
if (reverse_sort) return b.time - a.time;
|
if (!reverse_sort) return b.time - a.time;
|
||||||
else return a.time - b.time;
|
else return a.time - b.time;
|
||||||
})
|
})
|
||||||
.map(function (v) {
|
.map(function (v) {
|
||||||
@@ -289,7 +299,6 @@ class WTVMail {
|
|||||||
|
|
||||||
checkUserExists(username, directory = null) {
|
checkUserExists(username, directory = null) {
|
||||||
// returns the user's ssid, and user_id and userid in an array if true, false if not
|
// returns the user's ssid, and user_id and userid in an array if true, false if not
|
||||||
var username_match = false;
|
|
||||||
var search_dir = this.minisrv_config.config.SessionStore;
|
var search_dir = this.minisrv_config.config.SessionStore;
|
||||||
var return_val = false;
|
var return_val = false;
|
||||||
var self = this;
|
var self = this;
|
||||||
@@ -299,17 +308,15 @@ class WTVMail {
|
|||||||
return_val = self.checkUserExists(username, search_dir + self.path.sep + file);
|
return_val = self.checkUserExists(username, search_dir + self.path.sep + file);
|
||||||
}
|
}
|
||||||
if (!file.match(/.*\.json/ig)) return;
|
if (!file.match(/.*\.json/ig)) return;
|
||||||
if (username_match) return;
|
|
||||||
try {
|
try {
|
||||||
var temp_session_data_file = self.fs.readFileSync(search_dir + self.path.sep + file, 'Utf8');
|
var temp_session_data_file = self.fs.readFileSync(search_dir + self.path.sep + file, 'Utf8');
|
||||||
var temp_session_data = JSON.parse(temp_session_data_file);
|
var temp_session_data = JSON.parse(temp_session_data_file);
|
||||||
if (temp_session_data.subscriber_username.toLowerCase() == username.toLowerCase()) {
|
if (temp_session_data.subscriber_username.toLowerCase() == username.toLowerCase()) {
|
||||||
username_match = true;
|
return_val = search_dir.replace(this.minisrv_config.config.SessionStore + self.path.sep, '').replace("user", '').split(self.path.sep);
|
||||||
return_val = search_dir.replace(this.minisrv_config.config.SessionStore + self.path.sep, '').replace("user",'').split(self.path.sep);
|
return_val.push(temp_session_data.subscriber_name);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(" # Error parsing Session Data JSON", file, e);
|
console.error(" # Error parsing Session Data JSON", file, e);
|
||||||
username_match = true;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return return_val;
|
return return_val;
|
||||||
@@ -320,18 +327,19 @@ class WTVMail {
|
|||||||
if (user_data) {
|
if (user_data) {
|
||||||
var user_wtvsession = new this.WTVClientSessionData(this.minisrv_config, user_data[0]);
|
var user_wtvsession = new this.WTVClientSessionData(this.minisrv_config, user_data[0]);
|
||||||
user_wtvsession.user_id = user_data[1];
|
user_wtvsession.user_id = user_data[1];
|
||||||
var user_mailstore = new WTVMail(this.minisrv_config, ssid, user_wtvsession)
|
var user_mailstore = new WTVMail(this.minisrv_config, user_wtvsession)
|
||||||
return user_mailstore;
|
return user_mailstore;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
sendMessageToAddr(from_addr, to_addr, msgbody, subject = null, from_name = null, to_name = null, signature = null) {
|
sendMessageToAddr(from_addr, to_addr, msgbody, subject = null, from_name = null, to_name = null, signature = null) {
|
||||||
if (!to_addr.indexOf('@')) {
|
if (!to_addr) return "You must type a destination address for your message.";
|
||||||
return "The m-mail address <strong>" + to_addr + "</strong> is not a valid m-mail address.<br><br>An m-mail address should look like:<br>: <strong>zefie@ZefieTV</strong>";
|
|
||||||
}
|
|
||||||
|
if (to_addr.indexOf('@') === -1) to_addr += "@"+this.minisrv_config.config.service_name;
|
||||||
var username = to_addr.split("@")[0];
|
var username = to_addr.split("@")[0];
|
||||||
var dest_minisrv = to_addr.split("@")[1];
|
var dest_minisrv = to_addr.split("@")[1] || this.minisrv_config.config.service_name;
|
||||||
|
|
||||||
// local only for now
|
// local only for now
|
||||||
if (dest_minisrv.toLowerCase() !== this.minisrv_config.config.service_name.toLowerCase()) {
|
if (dest_minisrv.toLowerCase() !== this.minisrv_config.config.service_name.toLowerCase()) {
|
||||||
@@ -340,10 +348,15 @@ class WTVMail {
|
|||||||
|
|
||||||
// find user if local
|
// find user if local
|
||||||
if (dest_minisrv.toLowerCase() === this.minisrv_config.config.service_name.toLowerCase()) {
|
if (dest_minisrv.toLowerCase() === this.minisrv_config.config.service_name.toLowerCase()) {
|
||||||
var dest_user_mailstore = getUserMailstore(to_addr);
|
var dest_user_mailstore = this.getUserMailstore(username);
|
||||||
// user does not exist
|
// user does not exist
|
||||||
if (!dest_user_mailstore) return "The user <strong>" + username + "</strong> does not exist on MiniSrv <strong>" + dest_minisrv + "</strong>";
|
if (!dest_user_mailstore) return "The user <strong>" + username + "</strong> does not exist on MiniSrv <strong>" + dest_minisrv + "</strong>";
|
||||||
|
|
||||||
|
if (!to_name) {
|
||||||
|
var userExistsData = this.checkUserExists(username);
|
||||||
|
to_name = userExistsData[2];
|
||||||
|
}
|
||||||
|
|
||||||
// check if the destination user's Inbox exists yet
|
// check if the destination user's Inbox exists yet
|
||||||
if (!dest_user_mailstore.mailboxExists(0)) {
|
if (!dest_user_mailstore.mailboxExists(0)) {
|
||||||
// mailbox does not yet exist, create it
|
// mailbox does not yet exist, create it
|
||||||
@@ -352,7 +365,7 @@ class WTVMail {
|
|||||||
if (mailbox_exists) dest_user_mailstore.createWelcomeMessage();
|
if (mailbox_exists) dest_user_mailstore.createWelcomeMessage();
|
||||||
}
|
}
|
||||||
// if the mailbox exists, deliver the message
|
// if the mailbox exists, deliver the message
|
||||||
if (dest_user_mailstore.mailboxExists(0)) createMessage(0, from_addr, to_addr, msgbody, subject, from_name, to_name, signature);
|
if (dest_user_mailstore.mailboxExists(0)) this.createMessage(0, from_addr, to_addr, msgbody, subject, from_name, to_name, signature);
|
||||||
else return "There was an internal error sending the message to <strong>" + to_addr + "</strong>. Please try again later";
|
else return "There was an internal error sending the message to <strong>" + to_addr + "</strong>. Please try again later";
|
||||||
|
|
||||||
// clean up
|
// clean up
|
||||||
@@ -369,12 +382,12 @@ class WTVMail {
|
|||||||
if (this.checkMessageIdSanity(messageid)) {
|
if (this.checkMessageIdSanity(messageid)) {
|
||||||
if (this.mailstoreExists()) {
|
if (this.mailstoreExists()) {
|
||||||
this.fs.readdirSync(this.mailstore_dir).every(mailbox => {
|
this.fs.readdirSync(this.mailstore_dir).every(mailbox => {
|
||||||
if (mailboxid) return false;
|
if (mailboxid) return false;
|
||||||
this.fs.readdirSync(this.mailstore_dir + self.path.sep + mailbox).every(file => {
|
self.fs.readdirSync(self.mailstore_dir + mailbox).every(file => {
|
||||||
var regexSearch = ".*" + this.msgFileExt;
|
var regexSearch = messageid + self.msgFileExt;
|
||||||
var re = new RegExp(regexSearch, "ig");
|
var re = new RegExp(regexSearch, "ig");
|
||||||
if (!file.match(re)) return true;
|
if (!file.match(re)) return true;
|
||||||
if (file.indexOf(messageid) !== -1) mailboxid = mailbox;
|
mailboxid = mailbox;
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
@@ -386,6 +399,7 @@ class WTVMail {
|
|||||||
|
|
||||||
getMessageByID(messageid) {
|
getMessageByID(messageid) {
|
||||||
var mailbox_name = this.getMessageMailboxId(messageid);
|
var mailbox_name = this.getMessageMailboxId(messageid);
|
||||||
|
console.log(mailbox_name);
|
||||||
if (!mailbox_name) return false;
|
if (!mailbox_name) return false;
|
||||||
|
|
||||||
var mailboxid = this.mailboxes.findIndex((value) => value == mailbox_name);
|
var mailboxid = this.mailboxes.findIndex((value) => value == mailbox_name);
|
||||||
|
|||||||
Reference in New Issue
Block a user