clean up file structure

This commit is contained in:
zefie
2022-11-30 08:44:33 -05:00
parent 89407e7d51
commit 08de059758
2254 changed files with 2399 additions and 1317 deletions

View File

@@ -0,0 +1,93 @@
var minisrv_service_file = true;
headers = `200 OK
Content-type: text/html`;
data = `
<html>
<head>
<title>
Welcome to Mail
</title>
<display
noscroll
>
</head>
<body hspace=0 vspace=0
text='E6E6E6' link='E6E6E6' vlink='E6E6E6'
fontsize='medium'
bgcolor=00292f
>
<table cellspacing=0 cellpadding=0>
<tr>
<td width=560 height=96 valign=top>
<table background="wtv-mail:/ROMCache/help/common/helpMastheadBlank.swf" width=560 height=96 cellspacing=0 cellpadding=0>
<tr>
<td width=107 height=96 valign=top rowspan=2>
<spacer type=vertical height=7><br>
<spacer type=horizontal width=7>
<a href='wtv-home:/home'>
<img src="${minisrv_config.config.service_logo}" width=87 height=67>
</a>
<td width=453 valign=top>
<spacer type=vertical height=54><br>
<font size=+3><blackface>
Welcome to Mail&nbsp;
</blackface></font>
<tr>
<td align=right>
&nbsp;
</table>
<tr>
<td width=560 valign=top height=225>
<table cellpadding=0 cellspacing=0 width=560>
<tr>
<td width=25 height=17>
<td width=535>
<tr>
<td>
<td height=225 rowspan=2 valign=top>
<table cellpadding=0 cellspacing=0 height=225 width=535>
<tr>
<td height=15>
<tr>
<td>
<td valign=top>
In Mail, you can exchange typed messages&#151;called
<i>m-mail</i>&#151;with anyone who is on ${minisrv_config.config.service_name}, as well as anyone using other compatible MiniSrvs around the world. This is your m-mail address:
<blockquote>
<b>${session_data.getSessionData("subscriber_username")}@${minisrv_config.config.service_name}</b>
</blockquote>
Choose <b>Begin</b> to start using Mail. <!-- Or to learn more,
choose this link:
<spacer type=vertical height=12><br>
<table bgcolor=001316 cellpadding=0 cellspacing=8 href="wtv-guide:/help?topic=Common&subtopic=PreTour&tourTopic=Mail">
<tr>
<td height=20><font color=4B7136>
<b>&#128;
<td>
<font color=4B7136><b>Introductory tutorial about Mail
<td>&nbsp;
</table>
-->
<tr>
<td width=35>&nbsp;
<td width=450>&nbsp;
<td width=50>&nbsp;
</table>
</table>
<tr>
<td valign=top height=55 align=right>
<form method="POST" action="${(request_headers.query['came-from']) ? request_headers.query['came-from'] : "wtv-mail:/listmail"}">
<input type="hidden" name="intro_seen" value="true">
<font color=ffcf69><shadow>
<input type=submit usestyle borderimage="file://ROM/Borders/ButtonBorder2.bif"
value="Begin"
width='110'
selected>
<spacer type=horizontal width=20>
</shadow></font>
</form>
</table>
</body>
`;

View File

@@ -0,0 +1,211 @@
var minisrv_service_file = true;
if (request_headers.query.action == "editfromheader") {
function parseAddress() {
var nickname = request_headers.query.nickname + ":"
var address = request_headers.query.address;
return {
nickname: address
};
}
var addresstoadd = parseAddress()
if (session_data.getSessionData("address_book")) {
session_data.setSessionData("address_book", session_data.getSessionData("address_book") + addresstoadd);
session_data.saveSessionData();
} else {
session_data.setSessionData("address_book", addresstoadd);
session_data.saveSessionData();
}
headers = `200 OK
Content-type: text/html
wtv-expire: wtv-mail:/addresslist`;
} else {
var camefrom = request_headers.query.camefrom;
var CommonBLIMScripts = wtvshared.unpackCompressedB64('eNrFVttuGjEQfQaJfxjtS3ZbKFCpfQhJJIiEmiptI5V8gFkPYOG1kS9QVOXf6/Ui4l1uq0hRH9eeOXPOmVnbNzpVbGWAEzG3ZI630XeyJsVidNdqzqxIDZMC5mi+2YyInyTDGDPC+JBShVonrebfhkJjlYARZ9knF/l8NHDQeAkA9SnANgjc5KsHyPoE8mtGucQPt4dijupB/1qSbRwCxgUk00PO1hgnkAxazTCZ6bFiKOh5sUw/iEemTRyNH6M2lPVWAUdcpkusjTi6jDjkXG7qIw5PIHa7sJKcpdtrYDMwCwSrUQGhVAOBmfehDRsEYo3MiGEp4XwLJK8ORFCwYppr80h5+gqVdgSJ8V/atQYMyzDgPsUCdrJg+slHH4rw7B2JiTxj8ZoowD+YWoPeDbiFyBMLkK8i+FhKdJ/RVTKIyvnPhYocYSeoJoYbzImTJ62JQypt6H/o93q95GjIrlobPu+Dyq2gEoQ0UHDaLFA4mztTS+mWiXmnAxlZOm+t2tvNNOSmexe4cyywm9a1W2Em1zhWMntHz8/49eXALief5BocNS4JjZM87OvesNeJqjSsnr6jv0RQParA3kuFp7WFHT/DzYNcHPfRBWpHjen3D6sfDnM9by4RqPa8vjdvUVEdsP+t4Qy3ev0dXjrfKdNvE/2uQ+1OqFSKNQp3nqR4DdoQZdw14ReV9s0MRPzOt++DvRMa5ApFKazMJRnAPiy/191bRT8RgTz2tBpVVlPlDkmwK38BOaDgNQCrPC+kuJCb/e4OtMTrSMFW86ZbPJPu/gEVxhrd');
headers = `200 OK`
switch (camefrom) {
case "messenger":
data = `${CommonBLIMScripts}
<HTML>
<HEAD>
<TITLE>Addresses</TITLE>
<sendpanel action="wtv-mail:/sendmail"
message="Write a new message"
label="Write">
<savepanel
action="wtv-mail:/listmail?mailbox_name=mbox"
message="View your saved messages"
label="View saved messages">
</HEAD>
<SIDEBAR width="109" HEIGHT=420 ALIGN=LEFT>
<TABLE CELLSPACING=0 CELLPADDING=0 BGCOLOR=333B5A>
<TR><TD COLSPAN=3 WIDTH=120 ABSHEIGHT=4>
<TD ROWSPAN=100 WIDTH=10 HEIGHT=420 VALIGN=TOP ALIGN=LEFT BGCOLOR=191919><IMG SRC="ROMCache/Shadow.gif" WIDTH=6 HEIGHT=420>
<TR><TD ABSWIDTH=6>
<TD ABSWIDTH=109 ABSHEIGHT=76>
<TABLE HREF="wtv-home:/home" ABSHEIGHT=76 CELLSPACING=0 CELLPADDING=0 WIDTH=100%>
<TR><TD ABSWIDTH=6>
<IMG SRC="ROMCache/spacer.gif" WIDTH=1>
<TD ALIGN=CENTER><IMG SRC="ROMCache/WebTVLogoJewel.gif" WIDTH=87 HEIGHT=67>
</TABLE>
<TD ABSWIDTH=5>
<TR><TD COLSPAN=3 ABSHEIGHT=2 VALIGN=MIDDLE ALIGN=CENTER BGCOLOR=202434><IMG SRC="ROMCache/spacer.gif" WIDTH=1 HEIGHT=1>
<TR><TD COLSPAN=3 ABSHEIGHT=1 VALIGN=TOP ALIGN=LEFT><IMG SRC="ROMCache/spacer.gif" WIDTH=1 HEIGHT=1>
<TR><TD COLSPAN=3 ABSHEIGHT=2 VALIGN=TOP ALIGN=LEFT BGCOLOR=515B84><IMG SRC="ROMCache/spacer.gif" WIDTH=1 HEIGHT=1>
<TR><TD ABSWIDTH=6 >
<TD ABSWIDTH=109 ABSHEIGHT=26>
<TABLE HREF="wtv-mail:/listmail" CELLSPACING=0 CELLPADDING=0>
<TR><TD ABSWIDTH=5>
<TD ABSWIDTH=109 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="ROMCache/spacer.gif" WIDTH=1 HEIGHT=1>
<TR><TD COLSPAN=3 ABSHEIGHT=1 VALIGN=TOP ALIGN=LEFT><IMG SRC="ROMCache/spacer.gif" WIDTH=1 HEIGHT=1>
<TR><TD COLSPAN=3 ABSHEIGHT=2 VALIGN=TOP ALIGN=LEFT BGCOLOR=515B84><IMG SRC="ROMCache/spacer.gif" WIDTH=1 HEIGHT=1>
<TR><TD ABSWIDTH=6 >
<TD ABSWIDTH=109 ABSHEIGHT=26 >
<TABLE href="/addressbook?action=edit&new_address=true&selected=new" CELLSPACING=0 CELLPADDING=0>
<TR><TD ABSWIDTH=5>
<TD ABSWIDTH=130 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">Add</FONT></SHADOW>
</TABLE>
</TABLE>
<TD ABSWIDTH=5>
<TR><TD COLSPAN=3 ABSHEIGHT=2 VALIGN=MIDDLE ALIGN=CENTER BGCOLOR=202434><IMG SRC="ROMCache/spacer.gif" WIDTH=1 HEIGHT=1>
<TR><TD COLSPAN=3 ABSHEIGHT=1 VALIGN=TOP ALIGN=LEFT><IMG SRC="ROMCache/spacer.gif" WIDTH=1 HEIGHT=1>
<TR><TD COLSPAN=3 ABSHEIGHT=2 VALIGN=TOP ALIGN=LEFT BGCOLOR=515B84><IMG SRC="ROMCache/spacer.gif" WIDTH=1 HEIGHT=1>
<TR><TD ABSWIDTH=6 >
<TD ABSWIDTH=109 ABSHEIGHT=26 >
<TABLE href="JavaScript:alert('No idea what this goes to')" CELLSPACING=0 CELLPADDING=0>
<TR><TD ABSWIDTH=5>
<TD ABSWIDTH=130 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="ROMCache/spacer.gif" WIDTH=1 HEIGHT=1>
<TR><TD COLSPAN=3 ABSHEIGHT=1 VALIGN=TOP ALIGN=LEFT><IMG SRC="ROMCache/spacer.gif" WIDTH=1 HEIGHT=1>
<TR><TD COLSPAN=3 ABSHEIGHT=2 VALIGN=TOP ALIGN=LEFT BGCOLOR=515B84><IMG SRC="ROMCache/spacer.gif" WIDTH=1 HEIGHT=1>
<TR><TD COLSPAN=3 HEIGHT=205 VALIGN=BOTTOM ALIGN=RIGHT ><IMG SRC="ROMCache/BannerMail.gif" WIDTH=50 HEIGHT=96>
<TR><TD COLSPAN=3 ABSHEIGHT=36>
</TABLE>
</SIDEBAR>
<BODY BGCOLOR="191919" TEXT="42BD52" LINK="189CD6" VLINK="189CD6" FONTSIZE="SMALL" VSPACE=0>
<TABLE CELLSPACING=0 CELLPADDING=0>
<TR><TD COLSPAN=3 HEIGHT=12VALIGN=TOP ALIGN=LEFT>
<TR><TD COLSPAN=3 HEIGHT=35 VALIGN=TOP><FONT SIZE=+3 COLOR="E7CE4A"><B><SHADOW><BLACKFACE>Buddies for ${session_data.getSessionData("subscriber_username") || "You"}</BLACKFACE></SHADOW></B></FONT>
<TR><TD COLSPAN=3 HEIGHT=25 VALIGN=TOP>
<TABLE CELLSPACING=0 CELLPADDING=0>
<TD WIDTH=400>Your address is ${session_data.getSessionData("messenger_email") || "unlinked"}@${session_data.getSessionData("messenger_domain") || "escargot.chat"}
<TD ALIGN=RIGHT>
</TABLE>
</TABLE>
<TABLE CELLSPACING=0 CELLPADDING=0>
<TR><TD COLSPAN=3 HEIGHT=2 VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="2B2B2B"><IMG SRC="ROMCache/spacer.gif" WIDTH=1 HEIGHT=1>
<TR><TD COLSPAN=3 HEIGHT=1 VALIGN=TOP ALIGN=LEFT>
<TR><TD COLSPAN=3 HEIGHT=2 VALIGN=TOP ALIGN=LEFT BGCOLOR="0D0D0D"><IMG SRC="ROMCache/spacer.gif" WIDTH=1 HEIGHT=1>
<TR><TD ABSWIDTH=155 HEIGHT=26 VALIGN=MIDDLE ALIGN=LEFT><B>Name</B>
<TD ABSWIDTH=215 VALIGN=MIDDLE ALIGN=LEFT>&nbsp;<B>Options</B>
<TD ABSWIDTH=50 VALIGN=MIDDLE ALIGN=RIGHT>
<TR><TD COLSPAN=3 HEIGHT=2 VALIGN=MIDDLE ALIGN=CENTER BGCOLOR="2B2B2B"><IMG SRC="ROMCache/spacer.gif" WIDTH=1 HEIGHT=1>
<TR><TD COLSPAN=3 HEIGHT=1 VALIGN=TOP ALIGN=LEFT>
<TR><TD COLSPAN=3 HEIGHT=2 VALIGN=TOP ALIGN=LEFT BGCOLOR="0D0D0D"><IMG SRC="ROMCache/spacer.gif" WIDTH=1 HEIGHT=1>
<TR><TD COLSPAN=3 HEIGHT=6>
</TABLE>
<TABLE CELLSPACING=0 CELLPADDING=2>
<TR><TD>
<script language="Javascript">
var gTheList = "FL";
var gUserHasNoFriends = (Blim.listLength("FL") < 0);
var i;
var listLength = Blim.listLength("FL");
if (listLength == 0)
{ document.write('<table border=0 cellspacing=3 cellpadding=0 ><tr>');
document.write("<tr><td><font color=FFEFAD>You don't have any buddies yet. ");
document.write('<p>To add a buddy or send an instant message, ');
document.write('choose <b>Use MSN Messenger now</b>. ');
document.write('You can also add buddies in your Address book.');
}
else
{ document.write("<table border=0 cellspacing=3 cellpadding=0><tr>");
var isFirst = true;
for ( i=0 ; i < listLength; i++)
{ var ID = Blim.listItem("FL", i);
var humanName = Blim.getUmanName(ID);
document.write('<tr><td maxlines=1><b><a ');
if (isFirst)
{ document.write(" id=firstFriend selected ");
isFirst = false;
}
document.write("<TD ABSWIDTH=150 HEIGHT=20 MAXLINES=1>");
document.write("<FONT SIZE=4>");
document.write('<a href="javascript:void(StartConversation(');
document.write("'");
document.write(ID);
document.write("'");
document.write('))">');
document.write(escapeHTML(humanName));
document.write('</a><TD ABSWIDTH=250 MAXLINES=1>');
document.write("<FONT SIZE=4>");
document.write('<a href="javascript:void(defriendThisPerson(');
document.write("'");
document.write(ID);
document.write("'");
document.write('))">');
document.write('Remove');
document.write('</a>&nbsp;&nbsp;');
if (isBlocked(ID)) {
document.write('<a href="javascript:void(unblockThisPerson(');
document.write("'");
document.write(ID);
document.write("'");
document.write('))">');
document.write('Unblock');
} else {
document.write('<a href="javascript:void(blockThisPerson(');
document.write("'");
document.write(ID);
document.write("'");
document.write('))">');
document.write('Block');
}
}
}
document.write("</font>");
document.write("</table>");
document.close();
</script>
<script language="Javascript">
</script>
</TABLE>
</BODY>
</HTML>`
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 613 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 484 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 405 B

View File

@@ -0,0 +1,21 @@
var minisrv_service_file = true;
var errpage = null;
var messageid = request_headers.query.message_id;
var attachment_id = request_headers.query.attachment_id;
if (!attachment_id && attachment_id != 0) errpage = wtvshared.doErrorPage(400, "Attachment ID required.");
else {
var message = session_data.mailstore.getMessageByID(messageid);
if (!message) errpage = wtvshared.doErrorPage(400, "Invalid Message ID");
else {
if (!message.attachments) message.attachments = []; // backwards compat
if (attachment_id > message.attachments.length) errpage = wtvshared.doErrorPage(400, "Invalid Attachment ID");
}
}
if (!errpage) {
headers = `200 OK
Content-Type: ${message.attachments[attachment_id]['Content-Type']}`;
data = new Buffer.from(message.attachments[attachment_id]['data'], 'base64');
}

View File

@@ -0,0 +1,36 @@
var minisrv_service_file = true;
var errpage = null;
var messageid = request_headers.query.message_id || null;
if (!messageid) {
// get user signature
data = session_data.getSessionData("subscriber_signature");
} else {
// get message signature
var message = session_data.mailstore.getMessageByID(messageid);
if (!message) errpage = wtvshared.doErrorPage(400, "Invalid Message ID");
data = message.signature;
}
if (request_headers.query.sanitize) {
if (!data) data = '';
var message_colors = session_data.mailstore.getSignatureColors(data)
if (data.indexOf("<html>") >= 0) {
data = wtvshared.sanitizeSignature(data).replace("<html>", `<html><body bgcolor=${message_colors.bgcolor} text=${message_colors.text} link=${message_colors.link} vlink=${message_colors.vlink} vspace=0 hspace=0>`);
} else {
data = `<body bgcolor=${message_colors.bgcolor} text=${message_colors.text} link=${message_colors.link} vlink=${message_colors.vlink} vspace=0 hspace=0>\n${wtvshared.sanitizeSignature(data)}`;
}
if (request_headers.query.showdemotext) {
data += `<br>
<hr>This is a preview of your signature. The text below the line will not appear in your outgoing messages.
It is provided to demonstrate what a message composed with this signature may look like.
<a href="client:donothing">This is what a link looks like</a>`;
}
}
if (!errpage) {
headers = `200 OK
wtv-trusted: false
Content-Type: text/html`
}

View File

@@ -0,0 +1,341 @@
var minisrv_service_file = true;
var mailstore_exists = false;
function mail_end_error(msg) {
var errpage = doErrorPage("400", msg);
headers = errpage[0];
data = errpage[1];
}
var intro_seen = session_data.mailstore.checkMailIntroSeen();
if (!intro_seen && !request_headers.query.intro_seen) {
// user is trying to bypass the intro screen
headers = "300 OK\nLocation: wtv-mail:/DiplomaMail";
} else {
if (!intro_seen && request_headers.query.intro_seen) {
// User has come from intro
session_data.mailstore.setMailIntroSeen(true);
}
// check if mailstore exists (returns null if guest)
mailstore_exists = session_data.mailstore.mailstoreExists();
// create mailstore if it doesnt exist (also returns null if guest)
if (!mailstore_exists) mailstore_exists = session_data.mailstore.createMailstore();
if (mailstore_exists) {
// mailstore exists and user is not guest
var default_limit = (minisrv_config.services[service_name].messages_per_page) ? minisrv_config.services[service_name].messages_per_page : 25; // user config or 25
var mailbox = (request_headers.query.mailbox) ? parseInt(request_headers.query.mailbox) : 0;
var limit = (request_headers.query.limit) ? parseInt(request_headers.query.limit) : default_limit;
var reverse_sort = (request_headers.query.reverse_sort) ? true : false;
var page = (request_headers.query.page) ? parseInt(request_headers.query.page) : 0;
// get mailbox name
var mailbox_name = session_data.mailstore.getMailboxById(parseInt(mailbox));
// if false or null, then mailbox is invalid
if (!mailbox_name) {
mail_end_error("Invalid Mailbox ID");
} else {
// mailboxid is ok
if (!session_data.mailstore.mailboxExists(mailbox)) {
// mailbox does not yet exist, create it
var mailbox_exists = session_data.mailstore.createMailbox(mailbox);
if (!mailbox_exists) {
// failed to create mailbox for some reason
mail_end_error();
} else {
if (mailbox === 0) {
// Just created Inbox for the first time, so create the welcome message
session_data.mailstore.createWelcomeMessage();
}
}
}
var message_list = session_data.mailstore.listMessages(mailbox, limit, reverse_sort, (page * limit))
var total_message_count = session_data.mailstore.countMessages(mailbox);
var total_unread_message_count = session_data.mailstore.countUnreadMessages(mailbox);
var message_list_string = null;
if (total_message_count == 0) {
message_list_string = "No new mail messages for ";
} else {
if (total_unread_message_count > 0) {
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 {
message_list_string = total_message_count + " mail message" + ((total_message_count != 1) ? 's' : '') + " for ";
}
}
var username = session_data.getSessionData("subscriber_username");
var notImplementedAlert = new clientShowAlert({
'image': minisrv_config.config.service_logo,
'message': "This feature is not available.",
'buttonlabel1': "Okay",
'buttonaction1': "client:donothing",
'noback': true,
}).getURL();
headers = `200 OK
Content-type: text/html`;
data = `<sendpanel action="wtv-mail:/sendmail"
message="Write a new e-mail message"
label="Write">
<savepanel
action="wtv-mail:/listmail?mailbox_name=mbox"
message="View your saved e-mail messages"
label="View saved e-mail messages">
<HTML>
<head>
<title>${(mailbox_name === "Inbox") ? ' Mail list for ' + username : mailbox_name}
</title>
</head>
<body bgcolor="#171726" text="#82A9D9" link="#BDA73A" vlink="#7A9FCC" fontsize="medium" vspace=0 hspace=0>
<sidebar width=109>
<table cellspacing=0 cellpadding=0>
<tr>
<td width=104 height=420 bgcolor=#262E3D valign=top>
<table cellspacing=0 cellpadding=0>
<tr>
<td height=7 colspan=3>
<spacer type=vertical size=7>
<tr>
<td width=7>
<spacer type=horizontal size=7>
<td width=87 href="wtv-home:/home">
<img src="${minisrv_config.config.service_logo}" width=87 height=67>
<td width=10>
<spacer type=horizontal size=10>
</table>
<spacer type=vertical size=6>
<table cellspacing=0 cellpadding=0 border=0>
<tr>
<td bgcolor=#4A525A height=2 width=104 colspan=3>
<tr>
<td width=10 height=26>
<td width=89 valign=middle>
<table cellspacing=0 cellpadding=0 href="wtv-mail:/sendmail"
>
<tr>
<td height=1>
<tr>
<td><shadow><font sizerange=medium color=#E6CD4A>Write</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 valign=middle>
<table cellspacing=0 cellpadding=0 href="${notImplementedAlert}"
>
<tr>
<td height=1>
<tr>
<td><shadow><font sizerange=medium color=#E6CD4A>Storage</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 valign=middle>
<table cellspacing=0 cellpadding=0 href="${notImplementedAlert}"
>
<tr>
<td height=1>
<tr>
<td><shadow><font sizerange=medium color=#E6CD4A>Addresses</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 valign=middle>
<table cellspacing=0 cellpadding=0 href="${notImplementedAlert}"
>
<tr>
<td height=1>
<tr>
<td><shadow><font sizerange=medium color=#E6CD4A>Clean up</font></shadow>
</table>
<td width=5>
<tr>
<td bgcolor=#4A525A height=2 width=104 colspan=3>
</table>
<table width=109 cellspacing=0 cellpadding=0>
<tr>
<p>&nbsp;<p>
<br><spacer type=vertical size=2>
<tr>
<td valign=bottom bgcolor=#262E3D>
<table cellspacing=9><tr><td>
<font size=-1 color=#E6CD4A>Quick Tip:</font>
<spacer type=vertical size=5>
<!-- <a href="wtv-guide:/help?topic=Mail&subtopic=KnownTip"> -->
<div>
<img height=10 width=10 src="wtv-mail:/content/images/sidebardot.gif">
<font size=-1 color=#E6CD4A>indicates messages from known senders</div></font></td></tr></table>
<!-- </a> -->
</table>
<td width=5 bgcolor=#5B6C81>
</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>
`;
var icon_image = null;
switch (mailbox_name) {
case "Inbox":
icon_image = session_data.mailstore.getMailboxIcon();
break;
case "Sent":
icon_image = "MailboxSent.gif";
break;
case "Trash":
icon_image = "MailboxDiscard.gif";
break;
default:
icon_image = "MailboxStorage.gif";
break;
}
data += `
<img src="wtv-mail:/content/images/${icon_image}" width=74 height=45 >
<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=269 maxlines=1>
<font sizerange=medium color=#D6D6D6><blackface> ${(mailbox_name === "Inbox") ? ' Mail list for ' + username : mailbox_name}
</blackface></font>
<td width=21>
<img src="wtv-mail:/content/images/widget.gif" width=16 height=16>
<td width=80 >
<spacer type=vertical size=1><br>
<a href="wtv-setup:/mail"><font sizerange=small color=#E6CD4A><b>Settings</b></font></a>
<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=13><br>`;
if (message_list) {
data += `
<font sizerange=medium> ${message_list_string}
<table cellspacing=0 cellpadding=0 border=0>
<TR><TD maxlines="1">
${username}@${minisrv_config.config.service_name}
</TD></TR>
</TABLE>
</font><br>
<spacer type=vertical size=6>
<hr width=422 align=left>
<spacer type=vertical size=5>
<table cellspacing=0 cellpadding=0>
<tr>
<td width=155>
<font sizerange=small color=#8897A6><b><spacer type=horizontal size=20>From</b></font>
<td width=230><font sizerange=small color=#8897A6><b>Subject</b></font>
<td width=47><font sizerange=small color=#8897A6><b>Date</b></font>
</table>
<spacer type=vertical size=1>
<hr width=422 align=left>
`;
Object.keys(message_list).forEach(function (k) {
var message = message_list[k];
if (typeof message.subject == "object" && message.subject) message.subject = wtvshared.decodeBufferText(message.subject);
var message_font_open = "<font color=#7A9FCC>";
var message_font_close = "</font>";
if (message.unread) {
message_font_open = `<b><font color=#99E6FF>`;
message_font_close = "</font></b>"
}
data += `<spacer type=vertical size=5>
<table cellspacing=0 cellpadding=0 border=0>
<tr>
<td href="readmail?message_id=${message.id}#next" id="id${message.id}" selected>
<table cellspacing=0 cellpadding=0>
<tr>
<td abswidth=20 align=center valign=middle>${(message.known_sender) ? '<img height=10 width=10 src="wtv-mail:/content/images/dot.gif">' : ''}
<td abswidth=130 maxlines=1>
${message_font_open}
${(message.from_name) ? message.from_name : message.from_addr}
${message_font_close}
<td abswidth=5>
<td abswidth=225 maxlines=1>
${message_font_open}
${(message.subject) ? wtvshared.htmlEntitize(message.subject) : "(No Subject)"}
${message_font_close}
<td abswidth=5>
<td abswidth=47 maxlines=1>
${message_font_open}
`;
var message_date = new Date(message.date * 1000);
data += (message_date.getMonth() + 1) + "/" + message_date.getDate() + "\n";
data += `
${message_font_close}
</table>
<tr>
<td height=5>`;
});
} else {
data += `
<font sizerange=medium> No ${(mailbox_name == "Inbox") ? `new e-mail messages for<table cellspacing=0 cellpadding=0 border=0>
<TR><TD maxlines="1">
${username}@${minisrv_config.config.service_name}
</TD></TR>
</TABLE>` : 'e-mail messages in mailbox ' + mailbox_name}
</font><br>
`;
}
data += `
<spacer type=vertical size=6>
</table>
</body>
</HTML>
`;
}
} else {
mail_end_error("Access Denied");
}
}

View File

@@ -0,0 +1,320 @@
var minisrv_service_file = true;
var mailstore_exists = false;
function mail_end_error(msg) {
var errpage = doErrorPage("400", msg);
headers = errpage[0];
data = errpage[1];
}
var intro_seen = session_data.mailstore.checkMailIntroSeen();
if (!intro_seen && !request_headers.query.intro_seen) {
// user is trying to bypass the intro screen
headers = "300 OK\nLocation: wtv-mail:/DiplomaMail";
} else {
if (!request_headers.query.message_id) {
mail_end_error("Message ID Required");
} else {
var messageid = request_headers.query.message_id;
var message = session_data.mailstore.getMessageByID(messageid);
if (!message) {
mail_end_error("Invalid Message ID");
} else {
session_data.mailstore.setMessageReadStatus(messageid);
var notImplementedAlert = new clientShowAlert({
'image': minisrv_config.config.service_logo,
'message': "This feature is not available.",
'buttonlabel1': "Okay",
'buttonaction1': "client:donothing",
'noback': true,
}).getURL();
if (request_headers.query.message_delete) {
session_data.mailstore.deleteMessage(messageid);
headers = `300 OK
wtv-expire: wtv-mail:/listmail
Location: wtv-mail:/listmail`;
} else {
headers = `200 OK
Content-type: text/html`;
var message_colors = session_data.mailstore.getSignatureColors(message.signature);
if (typeof message.subject == "object" && message.subject) message.subject = wtvshared.decodeBufferText(message.subject);
data = `<wtvnoscript>
<sendpanel
action = "wtv-mail:/sendmail?message_forward_id=14&mailbox_name=inbox"
message = "Forward this message to someone else."
label = "Forward">
<savepanel
action = "client:showsplash?image=wtv-mail:/ROMCache/OpenMailbox3.gif&message=Saving%20to%20storage&showpage=true&action=wtv-mail:/readmail%3Fmailbox_name%3Dinbox%26message_move%3Dmbox%26message_id%3D14%26selected%3Dsave"
message = "Save this message with your stored mail."
label = "Save"
xnocancel>
<HTML>
<head>
<title>
${(message.subject) ? wtvshared.htmlEntitize(message.subject) : '(No subject)'}
</title>
</head>
<body
bgcolor="${message_colors.bgcolor}"
text="${message_colors.text}"
link="${message_colors.link}" vlink="${message_colors.vlink}" vspace=0 hspace=0>
<sidebar width=109>
<table cellspacing=0 cellpadding=0>
<tr>
<td width=104 height=420 bgcolor=#262E3D valign=top>
<table cellspacing=0 cellpadding=0>
<tr>
<td height=7 colspan=3>
<spacer type=vertical size=7>
<tr>
<td width=7>
<spacer type=horizontal size=7>
<td width=87 href="wtv-home:/home">
<img src="${minisrv_config.config.service_logo}" width=87 height=67>
<td width=10>
<spacer type=horizontal size=10>
</table>
<spacer type=vertical size=6>
<table cellspacing=0 cellpadding=0 border=0>
<tr>
<td bgcolor=#4A525A height=2 width=104 colspan=3>
<tr>
<td width=10 height=26>
<td width=89 valign=middle>
<table cellspacing=0 cellpadding=0 href="wtv-mail:/listmail?mailbox=0#id${messageid}"
>
<tr>
<td height=1>
<tr>
<td><shadow><font sizerange=medium color=#E6CD4A>Mail list</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 valign=middle>
<table cellspacing=0 cellpadding=0>
<tr>
<td height=1>
<tr>
<td><shadow><font sizerange=medium color=#596C75 href="${notImplementedAlert}">Previous</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 valign=middle>
<table cellspacing=0 cellpadding=0 id=next href="${notImplementedAlert}" >
<tr>
<td height=1>
<tr>
<td><shadow><font sizerange=medium color=#E6CD4A>Next</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 valign=middle>
<table cellspacing=0 cellpadding=0 href="client:showsplash?image=wtv-mail:/content/images/OpenMailbox3.gif&message=Discarding%20Message&showpage=true&action=wtv-mail%3A%2Freadmail%3Fmessage_delete%3Dtrue%26message_id%3D${messageid}%26mailbox_name%3DInbox%26selected%3Ddelete"
xnocancel
id=delete
>
<tr>
<td height=1>
<tr>
<td><shadow><font sizerange=medium color=#E6CD4A>Discard</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 valign=middle>
<table cellspacing=0 cellpadding=0 href="client:showsplash?image=wtv-mail:/content/images/OpenMailbox3.gif&message=Saving%20Message&showpage=true&action=wtv-mail:/readmail%3Fmessage_move%3DSaved%26mailbox_name%3DInbox%26message_id%3D${messageid}%26selected%3Dsave"
xnocancel
id=save
>
<tr>
<td height=1>
<tr>
<td><shadow><font sizerange=medium color=#E6CD4A>Save</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 valign=middle>
<table cellspacing=0 cellpadding=0 href="wtv-mail:/sendmail?message_reply_id=${messageid}&mailbox_name=Inbox&selected=body&reply_all=false"
xnocancel
id=save
>
<tr>
<td height=1>
<tr>
<td><shadow><font sizerange=medium color=#E6CD4A>Reply</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 valign=middle>
<table cellspacing=0 cellpadding=0 href="wtv-mail:/sendmail?message_forward_id=${messageid}&mailbox_name=Inbox"
xnocancel
id=save
>
<tr>
<td height=1>
<tr>
<td><shadow><font sizerange=medium color=#E6CD4A>Forward</font></shadow>
</table>
<td width=5>
<tr>
<td bgcolor=#4A525A height=2 width=104 colspan=3>
</table>
<td width=5 bgcolor=#5B6C81>
</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=${message_colors.bgcolor} colspan=2>
<img src="wtv-mail:/content/images/CornerTop.gif" width=8 height=8>
<tr>
<td bgcolor=${message_colors.bgcolor} width=451 valign=top>
<table cellspacing=0 cellpadding=0 width=451>
<tr>
<td bgcolor=${message_colors.bgcolor} width=13>
<spacer type=horizontal size=13>
<td height=9>
</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>
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>
<tr>
<td width=13 rowspan=2>
<td height=15>
<spacer type=vertical size=15>
<td width=13 rowspan=2>
<tr>
<td abswidth=425>
<table cellspacing=0 cellpadding=0 border=0>
<tr>
<td valign=top>
From:
<td width=10>
<td>`;
if (message.from_name != message.from_addr) {
data += `${wtvshared.htmlEntitize(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">(${wtvshared.htmlEntitize(message.from_name)})</a>`;
} else {
data += `${wtvshared.htmlEntitize(message.from_addr)}`;
}
data += `<tr>
<td valign=top>
Date:
<td>
<td>
${strftime("%a, %b %e, %Y, %I:%M %P", new Date(message.date * 1000))} (UTC)
<tr>
<td valign=top>
To:
<td>
<td>
${wtvshared.htmlEntitize(message.to_addr)} ${(message.to_name) ? '(' + wtvshared.htmlEntitize(message.to_name) + ')' : ''}
<tr>
<td nowrap valign=top>
Subject: <td>
<td>`;
data += `
${(message.subject) ? wtvshared.htmlEntitize(message.subject) : '(No subject)'}
<tr>
<td height=10>
<spacer type=vertical size=10>
</table>
<input type=hidden name=message_safe value=true>
<table cellspacing=0 cellpadding=0 border=0>
<tr>
<td width=425>
<p>`;
if (typeof message.body === "object" && message.body) {
message.body = wtvshared.decodeBufferText(message.body);
}
if (message.body) message.body = message.body.replace(/\n/g, "<br><br>");
data += `${(message.allow_html) ? message.body : wtvshared.htmlEntitize(message.body, true)}
<br>
<br>`;
if (message.signature) {
data += wtvshared.sanitizeSignature(message.signature);
}
data += `<p>
`;
console.log(message.allow_html)
if (Array.isArray(message.attachments)) {
message.attachments.forEach((v, k) => {
if (v) {
console.log("*****************", v['Content-Type']);
switch (v['Content-Type']) {
case "image/jpeg":
data += `<img border=2 src="wtv-mail:/get-attachment?message_id=${messageid}&attachment_id=${k}&wtv-title=Video%20Snapshot" width="380" height="290"><br><br>`;
break;
case "audio/wav":
data += `<table href="wtv-mail:/get-attachment?message_id=${messageid}&attachment_id=${k}&wtv-title=Voice%20Mail" width=386 cellspacing=0 cellpadding=0>
<td align=left valign=middle>
<img src="ROMCache/FileSound.gif" align=absmiddle>&nbsp;&nbsp;Recording
<td align=right valign=middle>
</table><br><br>
`;
break;
}
}
});
}
if (message.url) {
data += `Included Page: <a href="${(message.url)}">${wtvshared.htmlEntitize(message.url_title).replace(/&apos;/gi, "'")}</a>`;
}
data += `<p>
<p>
</table>
</table>
</body>
</HTML>
`;
}
}
}
}

View File

@@ -0,0 +1,785 @@
var minisrv_service_file = true;
var message_snapshot_data = null;
var message_voicemail_data = null;
var intro_seen = session_data.mailstore.checkMailIntroSeen();
if (!intro_seen && !request_headers.query.intro_seen) {
// user is trying to bypass the intro screen
headers = "300 OK\nLocation: wtv-mail:/DiplomaMail?came-from=" + encodeURIComponent(request_headers.request_url);
} else if (request_headers.query.clear == "true") {
} else if (request_headers.query.clear == "true") {
if (request_headers.Referer)
gourl = request_headers.Referer.replace(/[\?\&]clear\=true/, '');
else
gourl = "wtv-mail:/sendmail"
if (request_headers.query.saveoff) delete request_headers.query.saveoff;
session_data.deleteSessionData("usenet_draft");
session_data.deleteSessionData("usenet_draft_attachments");
session_data.deleteSessionData("mail_draft");
session_data.deleteSessionData("mail_draft_attachments");
if (request_headers.query.message_to) delete request_headers.query.message_to;
if (request_headers.query.message_subject) delete request_headers.query.message_subject;
if (request_headers.query.message_body) delete request_headers.query.message_body;
if (request_headers.query.message_url) delete request_headers.query.message_url;
if (request_headers.query.message_title) delete request_headers.query.message_title;
if (request_headers.query.message_reply_all_cc) delete request_headers.query.message_reply_all_cc;
if (request_headers.query['wtv-saved-message-id']) delete request_headers.query['wtv-saved-message-id'];
headers = `300 OK
wtv-expire-all: wtv-mail:/listmail
wtv-expire-all: wtv-mail:/sendmail
Location: ${gourl}`;
} else {
var doClientError = function (msg) {
var clientErrorMsg = new clientShowAlert({
'image': minisrv_config.config.service_logo,
'message': msg,
'buttonlabel1': "Okay",
'buttonaction1': "client:donothing",
'noback': true,
}).getURL();
return "200 OK\nwtv-visit: " + clientErrorMsg;
}
var newsgroup = null;
if (wtvshared.parseBool(request_headers.query.discuss)) {
newsgroup = request_headers.query.group || request_headers.query.message_to || null;
}
var gourl = "wtv-mail:/sendmail";
var msg_subject, to_addr, to_name;
if (newsgroup !== null) {
var to_addr = newsgroup;
var pageTitle = "Post to " + newsgroup;
var article = request_headers.query.article || null;
var gourl = gourl + "?group=" + newsgroup;
} else {
var to_addr = request_headers.query.message_to || null;
var pageTitle = "Write an e-mail message";
if (request_headers.query.message_reply_id) {
reply_message = session_data.mailstore.getMessageByID(request_headers.query.message_reply_id);
if (reply_message) {
msg_subject = "Re: " + reply_message.subject;
to_addr = reply_message.from_addr;
to_name = reply_message.from_name;
}
}
}
var msg_subject = msg_subject || request_headers.query.message_subject || null;
var msg_body = request_headers.query.message_body || null;
var to_name = to_name || request_headers.query.whatever_webtv_sends_this_as || null;
var msg_url = request_headers.query.message_url || null;
var msg_url_title = request_headers.query.message_title || null;
var no_signature = false;
mail_draft_data = {};
mail_draft_attachments = {};
if (!wtvshared.parseBool(request_headers.query.discuss)) {
mail_draft_data = session_data.getSessionData("mail_draft");
mail_draft_attachments = session_data.getSessionData("mail_draft_attachments") || {};
if (mail_draft_data && !wtvshared.parseBool(request_headers.query.discuss)) {
session_data.deleteSessionData("mail_draft");
if (mail_draft_data.to_addr) to_addr = request_headers.query.message_to || mail_draft_data.to_addr;
if (mail_draft_data.msg_subject) msg_subject = request_headers.query.message_subject || mail_draft_data.msg_subject;
if (mail_draft_data.msg_body) msg_body = request_headers.query.message_body || mail_draft_data.msg_body;
if (mail_draft_data.no_signature) no_signature = mail_draft_data.no_signature;
if (mail_draft_data.msg_url) msg_url = request_headers.query.message_url || mail_draft_data.msg_url;
if (mail_draft_data.msg_url_title) msg_url_title = request_headers.query.message_title || mail_draft_data.msg_url_title;
}
} else {
mail_draft_data = session_data.getSessionData("usenet_draft");
mail_draft_attachments = session_data.getSessionData("usenet_draft_attachments") || {};
if (mail_draft_data && !wtvshared.parseBool(request_headers.query.discuss)) {
session_data.deleteSessionData("usenet_draft");
if (mail_draft_data.to_addr) to_addr = request_headers.query.message_to || mail_draft_data.to_addr;
if (mail_draft_data.msg_subject) msg_subject = request_headers.query.message_subject || mail_draft_data.msg_subject;
if (mail_draft_data.msg_body) msg_body = request_headers.query.message_body || mail_draft_data.msg_body;
if (mail_draft_data.no_signature) no_signature = mail_draft_data.no_signature;
if (mail_draft_data.article) article = article || mail_draft_data.article;
}
}
if (request_headers.query.togglesign == "true") no_signature = false;
if (request_headers.query.togglesign == "false") no_signature = true;
if (mail_draft_attachments) {
if (mail_draft_attachments.message_snapshot_data) message_snapshot_data = mail_draft_attachments.message_snapshot_data;
else if (request_headers.query.message_snapshot_data) message_snapshot_data = request_headers.query.message_snapshot_data;
if (mail_draft_attachments.message_voicemail_data) message_voicemail_data = mail_draft_attachments.message_voicemail_data;
else if (request_headers.query.message_voicemail_data) message_voicemail_data = request_headers.query.message_voicemail_data;
}
if (message_snapshot_data && request_headers.query.get_snap) {
headers = `200 OK
Content-Type: image/jpeg`;
data = message_snapshot_data;
} else if (message_voicemail_data && request_headers.query.get_gab) {
headers = `200 OK
Content-Type: audio/wav`;
data = message_voicemail_data;
} else {
var username = session_data.getSessionData("subscriber_username");
var userdisplayname = wtvshared.htmlEntitize(session_data.getSessionData("subscriber_name"));
var address = username + "@" + minisrv_config.config.service_name //minisrv_config.config.domain_name
var notImplementedAlert = new clientShowAlert({
'image': minisrv_config.config.service_logo,
'message': "This feature is not available.",
'buttonlabel1': "Okay",
'buttonaction1': "client:donothing",
'noback': true,
}).getURL();
if ((typeof request_headers.query.sendoff !== 'undefined' && request_headers.query.sendoff != false) || request_headers.query.saveoff || request_headers.query.get_snap || request_headers.query.get_gab) {
var from_addr = address;
var signature = session_data.getSessionData("subscriber_signature") || null;
if (typeof request_headers.query.sendoff !== 'undefined' && request_headers.query.sendoff != false) {
var attachments = [];
if (message_snapshot_data) {
var attachment = {
'Content-Type': 'image/jpeg',
'filename': 'snapshot.jpg'
}
if (typeof message_snapshot_data == "object") {
attachment.data = new Buffer.from(message_snapshot_data).toString('base64');
attachment.is_base64 = true;
} else
attachment.data = message_snapshot_data;
attachments.push(attachment);
}
if (message_voicemail_data) {
var attachment = {
'Content-Type': 'audio/wav',
'filename': 'voicemail.wav'
}
if (typeof message_voicemail_data == "object") {
attachment.data = new Buffer.from(message_voicemail_data).toString('base64');
attachment.is_base64 = true;
} else
attachment.data = message_voicemail_data;
attachments.push(attachment);
}
if (newsgroup !== null) {
var request_is_async = true;
var local_service_name = request_headers.query['discuss-prefix'] || "wtv-news"
const wtvnews = new WTVNews(minisrv_config, local_service_name);
var service_config = minisrv_config.services[local_service_name];
if (wtvnewsserver) {
var tls_options = {
ca: this.wtvshared.getServiceDep('wtv-news/localserver_ca.pem'),
key: this.wtvshared.getServiceDep('wtv-news/localserver_key.pem'),
cert: this.wtvshared.getServiceDep('wtv-news/localserver_cert.pem'),
checkServerIdentity: () => { return null; }
}
if (wtvnewsserver.username)
wtvnews.initializeUsenet("127.0.0.1", service_config.local_nntp_port, tls_options, wtvnewsserver.username, wtvnewsserver.password);
else
wtvnews.initializeUsenet("127.0.0.1", service_config.local_nntp_port, tls_options);
} else {
if (service_config.upstream_auth)
wtvnews.initializeUsenet(service_config.upstream_address, service_config.upstream_port, service_config.upstream_tls || null, service_config.upstream_auth.username || null, service_config.upstream_auth.password || null);
else
wtvnews.initializeUsenet(service_config.upstream_address, service_configupstream_port, service_config.upstream_tls || null);
}
from_addr = userdisplayname + " <" + from_addr + ">";
news_headers = null;
if (signature && signature != "" && !no_signature) {
var signature_tuple = null;
if (signature.indexOf('<html>') >= 0) {
attachments.push({
"Content-Type": 'text/html',
"data": signature,
"use_base64": false,
"filename": "wtv_signature.html"
});
} else {
if (msg_body) msg_body += "\n" + signature;
else msg_body = signature;
}
}
if (attachments.length > 0) {
// usenet attachments
var tuples = [{
"mime": 'text/plain',
"content": msg_body || '',
"use_base64": false
}];
if (signature_tuple) tuples.push(signature_tuple);
attachments.forEach((attachment) => {
var tuple = {};
tuple.mime = attachment['Content-Type'];
tuple.content = attachment.data;
tuple.use_base64 = (typeof attachment.use_base64 === 'boolean') ? attachment.use_base64 : true;
tuple.is_base64 = (typeof attachment.is_base64 === 'boolean') ? attachment.is_base64 : false;
tuple.filename = attachment.filename || null;
tuples.push(tuple);
});
var multipart_data = wtvmime.generateMultipartMIME(tuples);
news_headers = {
"Content-Type": multipart_data.content_type,
"MIME-Version": multipart_data.mime_version,
"User-Agent": minisrv_version_string + " for WebTV",
"Content-Language": "en-US"
}
msg_body = multipart_data.content.toString();
}
wtvnews.postToGroup(newsgroup, from_addr, msg_subject, msg_body, article, news_headers).then(() => {
session_data.deleteSessionData("usenet_draft");
session_data.deleteSessionData("usenet_draft_attachments");
headers = `300 OK
wtv-expire-all: wtv-news:/news?group=${newsgroup}
wtv-expire-all wtv-mail:/sendmail
Location: wtv-news:/news?group=${newsgroup}`;
sendToClient(socket, headers, '');
}).catch((e) => {
var err = this.wtvshared.doErrorPage(500, null, e.toString())
sendToClient(socket, err[0], err[1]);
});
} else {
var messagereturn = session_data.mailstore.sendMessageToAddr(from_addr, to_addr, msg_body, msg_subject, userdisplayname, to_name, signature, attachments, msg_url, msg_url_title);
if (messagereturn !== true) {
var errpage = wtvshared.doErrorPage(400, messagereturn);
headers = errpage[0];
data = errpage[1];
} else {
session_data.deleteSessionData("mail_draft");
session_data.deleteSessionData("mail_draft_attachments");
headers = `300 OK
wtv-expire-all: wtv-mail:/listmail
wtv-expire-all: wtv-mail:/sendmail
Location: wtv-mail:/listmail`;
}
}
} else if (request_headers.query.saveoff) {
var mail_draft_data = {
to_addr: to_addr,
msg_subject: msg_subject,
msg_body: msg_body,
no_signature: no_signature,
msg_url: msg_url,
msg_url_title: msg_url_title,
}
if (newsgroup) mail_draft_data.article = article;
session_data.setSessionData((newsgroup) ? "usenet_draft" : "mail_draft", mail_draft_data);
headers = `200 OK
Content-type: text/html
wtv-expire-all: wtv-mail:/sendmail`;
}
} else {
headers = `200 OK
Content-type: text/html`;
var mail_draft_data = session_data.getSessionData((newsgroup) ? "usenet_draft_attachments" : "mail_draft_attachments") || {};
if (request_headers.query.snapping == "false") {
headers += "\nwtv-expire-all: cache:snapshot.jpg";
if (mail_draft_data.message_snapshot_data) mail_draft_data.message_snapshot_data = null;
session_data.setSessionData((newsgroup) ? "usenet_draft_attachments" : "mail_draft_attachments", mail_draft_data);
}
if (request_headers.query.gabbing == "false") {
headers += "\nwtv-expire-all: cache:voicemail.wav";
if (mail_draft_data.message_voicemail_data) mail_draft_data.message_voicemail_data = null;
session_data.setSessionData((newsgroup) ? "usenet_draft_attachments" : "mail_draft_attachments", mail_draft_data);
}
if (request_headers.query.message_snapshot_data) {
mail_draft_data.message_snapshot_data = request_headers.query.message_snapshot_data
session_data.setSessionData((newsgroup) ? "usenet_draft_attachments" : "mail_draft_attachments", mail_draft_data);
}
if (request_headers.query.message_voicemail_data) {
mail_draft_data.message_voicemail_data = request_headers.query.message_voicemail_data
session_data.setSessionData((newsgroup) ? "usenet_draft_attachments" : "mail_draft_attachments", mail_draft_data);
}
var message_colors = null;
if (no_signature) message_colors = session_data.mailstore.getSignatureColors(null, true);
else message_colors = session_data.mailstore.getSignatureColors(session_data.getSessionData("subscriber_signature"), true);
data = `<HTML>
<head>
<display poweroffalert >
<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.">
<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=";
} 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;
myURL = "client:submitform?name=sendform&submitvalue=false" + "&submitname=" + victim;
if (victim == "gabbing") { document.forms.sendform.elements.message_voicemail_data.disabled = true;
}
if (victim == "snapping") { document.forms.sendform.elements.message_snapshot_data.disabled = true;
}
location = myURL;
location.reload(); }
function Signing(desiredState) { var myURL;
myURL="client:submitform?name=sendform&submitvalue="+desiredState+"&submitname=togglesign";
location = myURL;
location.reload();
}
function DoneSnapping() { location = "client:submitform?name=sendform&submitname=snapping&submitvalue=true";
location.reload(); }
function DoneGabbing() { var myURL;
myURL = "client:submitform?name=sendform&submitname=gabbing&submitvalue=cache%3Avoicemail.wav";
location = "client:submitform?name=sendform&submitname=gabbing&submitvalue=true";
location.reload(); }
function clearDraft() {
location = "client:submitform?name=sendform&submitname=clear&submitvalue=true";
location.reload();
}
</script>
<title>
${pageTitle}
</title>
</head>
<body bgcolor="#171726" text="${message_colors.text}" link="${message_colors.link}" vlink="${message_colors.vlink}" vspace=0 hspace=0>
<form action="wtv-mail:/sendmail#focus" method="post" name=sendform >
<input type=hidden name="wtv-saved-message-id" value="writemessage-outbox">
<input type=hidden name="message_reply_all_cc" value="">
${(request_headers.query.article) ? `<input type="hidden" name="article" value="${request_headers.query.article}">` : ''}
<input type=hidden name="saveoff" value="true" autosubmit="onleave">
<input type=hidden name="discuss" value="${wtvshared.parseBool(request_headers.query.discuss)}">
<sidebar width=109>
<table cellspacing=0 cellpadding=0>
<tr>
<td width=104 height=420 bgcolor=#262E3D valign=top>
<table cellspacing=0 cellpadding=0>
<tr>
<td height=7 colspan=3>
<spacer type=vertical size=7>
<tr>
<td width=7>
<spacer type=horizontal size=7>
<td width=87 href="wtv-home:/home">
<img src="${minisrv_config.config.service_logo}" width=87 height=67>
<td width=10>
<spacer type=horizontal size=10>
</table>
<spacer type=vertical size=6>
<table cellspacing=0 cellpadding=0 border=0>
<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="`
if (newsgroup) {
data += "wtv-news:/news?group=" + newsgroup;
} else {
data += "wtv-mail:/listmail";
}
data += `"><tr>
<td height=1>
<tr>`;
if (newsgroup) {
data += `<td><shadow><font sizerange=medium color=#E6CD4A>Group list</font></shadow>`;
} else {
data += `<td><shadow><font sizerange=medium color=#E6CD4A>Mail list</font></shadow>`;
}
data += `</table>`;
if (!newsgroup) {
data += `
<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>`;
}
data += `
<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=javascript:clearDraft()" 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>
<td width=5 bgcolor=#5B6C81>
</table>
</sidebar>
<table cellspacing=0 cellpadding=0 border=0>
<tr>
<td width=451 colspan=2 align=center bgcolor=#5B6C81>
<spacer type=vertical size=4>
<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/${session_data.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>
${pageTitle}
</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="${message_colors.bgcolor}">
<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=${message_colors.text}>From:&nbsp;</font>
<td width=305 valign=top>
<font color=${message_colors.text}><table cellspacing=0 cellpadding=0 border=0>
<TR><TD maxlines="1">
${address}
</TD></TR>
</TABLE></font>
<font color=${message_colors.text}>(${userdisplayname})</font>
<tr>
<td height=13 valign=middle colspan=2>
<img src="wtv-mail:/content/images/sendmail_panel_dots.gif" width=385 height=2>
<tr>
<td width=80 valign=top align=right>`;
if (!request_headers.query.discuss) {
data += '<a href="client:openaddresspanel">To:</a>';
} else {
data += 'To:';
}
data += `&nbsp;
<td width=305 valign=top>
<textarea
bgcolor="${message_colors.bgcolor}"
cursor="${message_colors.cursor}"
nosoftbreaks
borderimage="file://ROM/Borders/textfield.alt1.bif"
nohardbreaks
selected
font=proportional
text=${message_colors.text}
name="message_to"
border=0
width=305 rows=1
growable
autoactivate
addresses
autoascii
nohighlight`;
if (newsgroup) { data += "\nreadonly" }
data += `
>${(to_addr) ? to_addr : ''}</textarea>
<tr>
<td height=13 valign=middle colspan=2>
<img src="wtv-mail:/content/images/sendmail_panel_dots.gif" width=385 height=2>
<tr>
<td abswidth=83 valign=top align=right>
<font color=${message_colors.text}>Subject:&nbsp;</font>
<td width=305 valign=top>
<textarea
bgcolor="${message_colors.bgcolor}"
cursor="${message_colors.cursor}"
nosoftbreaks
borderimage="file://ROM/Borders/textfield.alt1.bif"
nohardbreaks
text=${message_colors.text}
name="message_subject" font=proportional
border=0
width=305 rows=1
growable
autoactivate
maxlength=70
nohighlight
autohiragana
>${(msg_subject) ? msg_subject : ''}</textarea>
<tr>
<td height=13 valign=middle colspan=2>
<img src="wtv-mail:/content/images/sendmail_panel_dots.gif" width=385 height=2>
<tr>
<td width=305 colspan=2>
<textarea nosoftbreaks
bgcolor="${message_colors.bgcolor}"
text="${message_colors.text}"
cursor="${message_colors.cursor}"
name="message_body" font=proportional
border=0
rows=4
width=386
nohighlight
autoactivate
autohiragana
growable
nextdown="Send">${(msg_body) ? msg_body : ''}</textarea>
</table>
<body bgcolor=${message_colors.bgcolor}
text=${message_colors.text}
link=${message_colors.link}
vlink=${message_colors.vlink}
vspace=0
hspace=0>`;
if (session_data.getSessionData("subscriber_signature") && session_data.getSessionData("subscriber_signature") != "" && !no_signature) {
data += wtvshared.sanitizeSignature(session_data.getSessionData("subscriber_signature"));
}
if (msg_url) {
data += `<input type="hidden" name="message_url" value="${msg_url}">
<input type="hidden" name="message_title" value="${msg_url_title}">
Included Page: <a href="${msg_url}">${wtvshared.htmlEntitize(msg_url_title).replace(/&apos;/gi, "'")}</a>`;
}
data += `
<td abswidth=13>
<td abswidth=2 bgcolor=#000000>
<tr>
<td abswidth=2 bgcolor=#495360>
<td absheight=13 colspan=3>
<td abswidth=2 bgcolor=#000000>
<tr>
<td absheight=2 colspan=5 bgcolor=#000000>
</table>
<tr>
<td width=13 bgcolor=#171726>
<td width=438 bgcolor=#171726>
<spacer type=vertical size=5><br>
<table cellspacing=0 cellpadding=0 border=0>
<tr>
<td width=305 valign=top>`;
if (!session_data.getSessionData("subscriber_signature") || session_data.getSessionData("subscriber_signature") == "") {
data += `<input type = hidden name = "togglesign" value = "false"> <td abswidth=13 > `;
} else if (no_signature) {
data += `<a href="javascript:Signing('true')">
<img src="wtv-mail:/content/images/RemoveButton.gif" align=absmiddle height=25 width=25>&nbsp;Add signature&nbsp;</a>
<br>`;
} else {
data += `<a href="javascript:Signing('false')">
<img src="wtv-mail:/content/images/RemoveButton.gif" align=absmiddle height=25 width=25>&nbsp;Remove signature&nbsp;</a>
<br>`;
}
data += `
<td align=right valign=top width=110> <FONT COLOR="#E7CE4A"><SHADOW>
<INPUT TYPE=SUBMIT BORDERIMAGE="file://ROM/Borders/ButtonBorder2.bif" action="javascript:Submit()"
value="Send"
name="Send"
id="Send"
xnocancel
width=103
USESTYLE NOARGS>
</SHADOW></FONT>
</table>
<spacer type=vertical size=5>
`;
if ((request_headers.query.snapping && request_headers.query.snapping !== 'false') || mail_draft_attachments.message_snapshot_data) {
data += `<tr>
<td absheight="10">
<img src="ROMCache/Spacer.gif" width="1" height="10">
</td></tr></tbody></table>
<table cellspacing="0" cellpadding="0" bgcolor="${message_colors.bgcolor}" background="">
<tbody><tr>
<td rowspan="100" abswidth="10" bgcolor="191919">
<img src="ROMCache/Spacer.gif" width="10" height="1">
</td><td colspan="9" abswidth="422" valign="bottom">
<img src="ROMCache/PaperTopFlat.gif" noprint="" width="422" height="6">
</td></tr><tr>
<td rowspan="100" abswidth="2" absheight="0" bgcolor="313131">
<img src="ROMCache/Spacer.gif" width="1" height="1">
</td><td rowspan="100" abswidth="14" absheight="0">
<img src="ROMCache/Spacer.gif" width="1" height="1">
</td><td colspan="2" abswidth="386">
</td><td rowspan="100" abswidth="14" absheight="0">
<img src="ROMCache/Spacer.gif" width="1" height="1">
</td><td rowspan="100" abswidth="3" absheight="0" bgcolor="0b0b0b">
<img src="ROMCache/Spacer.gif" width="1" height="1">
</td><td rowspan="100" abswidth="1" absheight="0" bgcolor="0f0f0f">
<img src="ROMCache/Spacer.gif" width="1" height="1">
</td><td rowspan="100" abswidth="1" absheight="0" bgcolor="131313">
<img src="ROMCache/Spacer.gif" width="1" height="1">
</td><td rowspan="100" abswidth="1" absheight="0" bgcolor="171717">
<img src="ROMCache/Spacer.gif" width="1" height="1">
</td></tr><tr>
<td colspan="2" absheight="15">`;
if (!mail_draft_attachments.message_snapshot_data) {
data += `<input type="file" device="video" name="message_snapshot_data" src="cache:snapshot.jpg" invisible="" width="75%" height="75%">
<input type="hidden" name="message_snapshot_url" value="cache:snapshot.jpg">`;
}
data += `
</td></tr><tr>
<td colspan="2" align="center">
<img src="${(mail_draft_attachments.message_snapshot_data) ? 'wtv-mail:/sendmail?get_snap=true' : (request_headers.query.message_snapshot_url) ? request_headers.query.message_snapshot_url : 'cache:snapshot.jpg'}" width="380" height="290">
</td></tr><tr>
<td colspan="2" abswidth="386" absheight="10">
</td></tr><tr>
<td colspan="2">
<table width="386" cellspacing="0" cellpadding="0">
<tbody><tr><td valign="middle">
</td><td valign="middle" align="right">
<a href="javascript:ErasingMedia('snapping')">
&nbsp;Detach&nbsp;<img src="ROMCache/RemoveButton.gif" width="25" height="25" align="absmiddle"></a>
</td></tr></tbody></table>
</td></tr><tr>
<td colspan="2" absheight="8">
<img src="ROMCache/Spacer.gif" width="1" height="8">
</td></tr></tbody></table>
<table cellspacing="0" cellpadding="0">
<tbody><tr>
<td rowspan="100" abswidth="10">
<img src="ROMCache/Spacer.gif" width="10" height="2">
</td><td abswidth="422">
<img src="ROMCache/PaperBase.gif" noprint="" width="422" height="6">
</td></tr><tr>
<td absheight="6">
<img src="ROMCache/Spacer.gif" width="1" height="6">
</td></tr>`;
}
if ((request_headers.query.gabbing && request_headers.query.gabbing !== 'false') || mail_draft_attachments.message_voicemail_data) {
data += `<tr>
<td absheight="10">
<img src="ROMCache/Spacer.gif" width="1" height="10">
</td></tr></tbody></table>
<table cellspacing="0" cellpadding="0" bgcolor="${message_colors.bgcolor}" background="">
<tbody><tr>
<td rowspan="100" abswidth="10" bgcolor="191919">
<img src="ROMCache/Spacer.gif" width="10" height="1">
</td><td colspan="9" abswidth="422" valign="bottom">
<img src="ROMCache/PaperTopFlat.gif" noprint="" width="422" height="6">
</td></tr><tr>
<td rowspan="100" abswidth="2" absheight="0" bgcolor="313131">
<img src="ROMCache/Spacer.gif" width="1" height="1">
</td><td rowspan="100" abswidth="14" absheight="0">
<img src="ROMCache/Spacer.gif" width="1" height="1">
</td><td colspan="2" abswidth="386">
</td><td rowspan="100" abswidth="14" absheight="0">
<img src="ROMCache/Spacer.gif" width="1" height="1">
</td><td rowspan="100" abswidth="3" absheight="0" bgcolor="0b0b0b">
<img src="ROMCache/Spacer.gif" width="1" height="1">
</td><td rowspan="100" abswidth="1" absheight="0" bgcolor="0f0f0f">
<img src="ROMCache/Spacer.gif" width="1" height="1">
</td><td rowspan="100" abswidth="1" absheight="0" bgcolor="131313">
<img src="ROMCache/Spacer.gif" width="1" height="1">
</td><td rowspan="100" abswidth="1" absheight="0" bgcolor="171717">
<img src="ROMCache/Spacer.gif" width="1" height="1">
</td></tr><tr>
<td colspan="2" absheight="15">
<input type=file device=audio name=message_voicemail_data
src="cache:voicemail.wav" rate=8000 invisible>
${(!mail_draft_attachments.message_voicemail_data) ? '' : '<input type=hidden name=message_voicemail_url value="cache:voicemail.wav">'}
</td></tr><tr>
<td colspan="2" align="center">
<table width=386 cellspacing=0 cellpadding=0>
<td align=left valign=middle>
<a href="${(mail_draft_attachments.message_voicemail_data) ? 'wtv-mail:/sendmail?get_gab=true&wtv-title=Voice%20Mail' : 'cache:voicemail.wav'}" id=focus><img src="ROMCache/FileSound.gif" align=absmiddle></a>&nbsp;&nbsp;Recording
<td align=right valign=middle>
<a href="javascript:ErasingMedia('gabbing')">
&nbsp;Detach&nbsp;<img src="ROMCache/RemoveButton.gif" align=absmiddle height=25 width=25></a>
</table><tr>
<td colspan="2" absheight="8">
<img src="ROMCache/Spacer.gif" width="1" height="8">
</td></tr></tbody></table>
<table cellspacing="0" cellpadding="0">
<tbody><tr>
<td rowspan="100" abswidth="10">
<img src="ROMCache/Spacer.gif" width="10" height="2">
</td><td abswidth="422">
<img src="ROMCache/PaperBase.gif" noprint="" width="422" height="6">
</td></tr><tr>
<td absheight="6">
<img src="ROMCache/Spacer.gif" width="1" height="6">
</td></tr>`;
}
data += `
</form>
</tbody>
</table>
</body>
</HTML>
`;
}
}
}

View File

@@ -0,0 +1,22 @@
var minisrv_service_file = true;
headers = `200 OK
Content-type: text/plain
minisrv-no-mail-count: true`
var fail = '0';
var ok = '1';
// TODO: logic to check if account exists
// All this does is some sanity checks for now
// but does not verify the account exists
if (request_headers.query.address) {
var address_split = request_headers.query.address.split("@");
var domain = address_split[1];
if (domain != "escargot.chat" && domain != "escargot.live") data = fail
else data = ok;
} else {
data = fail;
}