Original source

This commit is contained in:
v 2020-10-29 09:12:08 -04:00
commit 8b55a81830
11 changed files with 630 additions and 0 deletions

237
2prong.js Normal file
View File

@ -0,0 +1,237 @@
/*
2Prong.js
Copyright 2006 by Mark Percival - Percival Industries, LLC
*/
if (window.XMLHttpRequest){ // try to create XMLHttpRequest
XMLReq = new XMLHttpRequest();
XMLMail = new XMLHttpRequest();
}
if (window.ActiveXObject) { // if ActiveXObject use the Microsoft.XMLHTTP
XMLReq = new ActiveXObject("Microsoft.XMLHTTP");
XMLMail = new ActiveXObject("Microsoft.XMLHTTP");
}
window.onload=kickStart;
var genEmail = '';
var checkMailURL = 'checkemail.php?email=';
var getMailURL = 'email.php?id=';
var recievedMail = new Array;
var emailidArray = new Array;
var position = 0;
var emailCount = 0;
var interval;
//var domain = 'iheartspam.org';
var domain = 'reducespam.org';//update this
var XMLerror = 0;
function kickStart() {
setEmail();
startAutoCheck(true);
}
function setEmail(){
var regex = new RegExp(/\?email=(.+)/);
var match = regex.exec(location.href);
if(!match){
location.href = '?email='+randomEmail(10);
}
else genEmail = match[1].substr(0,15);
checkMailURL += genEmail;
setHTML('emailaddress', '<span class="clickToSelect">' + genEmail +'@'+ domain + '</span>' + "<div class='custom'><a href='javascript:customemail()'>Custom Address</a></div>");
copy(genEmail+"@"+domain);
//updated 150610
setHTML('emailaddressincontent', '<span class="clickToSelect">' + genEmail +'@'+ domain + '</span>');
applyClickToSelectEvent();
}
function startAutoCheck(toggle) {
if(toggle) {
throbber(true,'Checking Mail');
checkMail();
interval = setInterval("checkMail()", 7000);
}
else clearInterval(interval);
}
function checkMail(){
request(checkMailURL + '&c=' + Math.random(), checkMailProc);
}
function checkMailProc(){
if (XMLReq.readyState==4 && XMLReq.status == 200) {
if(XMLReq.responseText) emailidArray = XMLReq.responseText.split(",");
if (emailidArray.length > emailCount) {
getMail(emailidArray[emailidArray.length - 1]);
position = emailidArray.length;
if(emailidArray.length>1) multiMail();
}
emailCount = emailidArray.length;
if(error=1){ throbber(true,'Checking Mail'); error=0; }//reset throbber after error
}
else if (XMLReq.readyState==4 && XMLReq.status != 200) throbber(true,'Error connecting, retrying...');
}
function multiMail() {
var navoutput='';
if ((emailidArray.length >= position)&&(position!=1)) navoutput = "<a href='javascript:prevMail();'>Prev</a> ";
else navoutput += "Prev ";
navoutput += position +' of '+ emailidArray.length;
if (emailidArray.length > position)navoutput += " <a href='javascript:nextMail();'>Next</a>";
else navoutput += " Next";
setHTML('emailnav', navoutput);
}
function prevMail(){
getMail(emailidArray[position-2]);
position--;
multiMail();
}
function nextMail(){
getMail(emailidArray[position]);
position++;
multiMail();
}
function getMail(emailid){
requestMail('email.php?id='+emailid+'&email='+genEmail, getMailProc);
}
function getMailProc(){
if (XMLMail.readyState==4) {
XMLMail.responseText
setHTML('content',XMLMail.responseText);
startAutoCheck(false);
throbber(false, "<a href='javascript:startAutoCheck(true);'>Check for new mail</a>");
autolink('content');
document.title = "ReduceSpam.org - New Email";
}
}
function request(url, callfunc) {
if (XMLReq.readyState < 1 || XMLReq.readyState > 3) {
XMLReq.open("GET", url, true);
// Set the onreadystatechange function
XMLReq.onreadystatechange = callfunc;
// Send
XMLReq.send(null);
}
}
function requestMail(url, callfunc) {
XMLMail.open("GET", url, true);
// Set the onreadystatechange function
XMLMail.onreadystatechange = callfunc;
// Send
XMLMail.send(null);
}
function setHTML(div, data)
{
document.getElementById(div).innerHTML = data;
}
function throbber(toggle, msg) {
if(toggle) setHTML('status',msg+" <img src='throbber.gif' title='Throbber' />");
if(toggle) document.title = "Reduce Spams";
else setHTML('status',msg);
}
function randomEmail(length)
{
chars = "abcdefghijklmnopqrstuvwxyz1234567890";
var email = "";
for(x=0;x<length;x++)
{
i = Math.floor(Math.random()*36);
email += chars.charAt(i);
}
return email;
}
function autolink(div)
{
var hlink = /\s(ht|f)tp:\/\/([^ \,\:\!\)\(\"\'\<\>\f\n\r\t\v])+/g;
document.getElementById(div).innerHTML =
document.getElementById(div).innerHTML.replace(hlink, function ($0){
var s = $0
if((s.charAt(s.length-1)=='.')||(s.charAt(s.length-1)==','))
s = s.substring(0,s.length-1);
return(s.link(s));
}
);
}
function customemail (submit) {
if(submit) document.customemail.submit();
else {setHTML('emailaddress',"\
<form name='customemail' action='' method='get'><input name='email' class='email' type='text' size='8' onKeyPress='return letternumber(event)' />@" + domain
+"<div class='custom'><a href='javascript:customemail(true)'>Submit</a></form>");
document.customemail.email.select(); //in case its non-IE and no flash, you can still ctrl-c
}
}
function letternumber(e)
{
var key;
var keychar;
if (window.event)
key = window.event.keyCode;
else if (e)
key = e.which;
else
return true;
keychar = String.fromCharCode(key);
keychar = keychar.toLowerCase();
// control keys
if ((key==null) || (key==0) || (key==8) ||
(key==9) || (key==13) || (key==27) )
return true;
// alphas and numbers
else if ((("abcdefghijklmnopqrstuvwxyz0123456789").indexOf(keychar) > -1))
return true;
else
return false;
}
function copy(text2copy) {
if (window.clipboardData) {
window.clipboardData.setData("Text",text2copy);
} else {
var flashcopier = 'flashcopier';
if(!document.getElementById(flashcopier)) {
var divholder = document.createElement('div');
divholder.id = flashcopier;
document.body.appendChild(divholder);
}
document.getElementById(flashcopier).innerHTML = '';
var divinfo = '<embed src="_clipboard.swf" FlashVars="clipboard='+escape(text2copy)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';
document.getElementById(flashcopier).innerHTML = divinfo;
}
}
function applyClickToSelectEvent(){
$('.clickToSelect').click(function (){
var range, selection;
if (window.getSelection && document.createRange) {
selection = window.getSelection();
range = document.createRange();
range.selectNodeContents($(this)[0]);
selection.removeAllRanges();
selection.addRange(range);
} else if (document.selection && document.body.createTextRange) {
range = document.body.createTextRange();
range.moveToElementText($(this)[0]);
range.select();
}
});
}

8
README.md Normal file
View File

@ -0,0 +1,8 @@
ReduceSpam.org
- modification required in order to run this code
1. update imap.php with your email server, email address and password
2. update 2prong.js with your domain name
3. that's all
- things to setup on your server
1. a catch-all email for your domain using IMAP

BIN
_clipboard.swf Normal file

Binary file not shown.

12
checkemail.php Normal file
View File

@ -0,0 +1,12 @@
<?php
//updated by reducespam.org to remove dependancy on mysql database to use imap directly instead
include 'imap.php';
$email = '';
if(isset($_GET['email'])){
$email = ($_GET['email']);
echo join(",",getEmailIDs($email));
}
?>

29
email.php Normal file
View File

@ -0,0 +1,29 @@
<?php
//updated by reducespam.org to remove dependancy on mysql database to use imap directly instead
include 'imap.php';
$id = 0;
if(isset($_GET['id'])){
$id = ($_GET['id']);
}
if(isset($_GET['email'])){
$email = strtolower(($_GET['email']));
}
$emailContent = getEmail($id);
if(strpos(strtolower($emailContent['to']),$email) !== false){
echo "<div class='to'> To: " . htmlspecialchars($emailContent['to']) . "</div>";
echo "<div class='from'>From: " . htmlspecialchars($emailContent['from']) . "</div>";
echo "<div class='subject'>Subject: " . htmlspecialchars($emailContent['subject']) . "</div>";
echo "<div class='time'>" . htmlspecialchars($emailContent['date']) . "</div>";
echo "<div class='msg'>" . nl2br($emailContent['body']) . "</div>";
}
else {
echo "<html><head></head><body style='text-align:center;'><img src='http://2prong.com/bush.jpg' /> <br /> That's not going to work</body></html>";
}
?>

139
furiousstyles.css Normal file
View File

@ -0,0 +1,139 @@
body {
margin:25px 0px;
padding:0px;
text-align:center; /* Hack for IE5/Win */
font-family: arial;
font-size: 90%;
}
a {
color: #FE8801;
text-decoration:none;
}
a:hover {
color: #3E98FE;
text-decoration:none;
}
a img{
border:none;
}
h2 {
color:#999;
margin: .1em .1em;
font-size:140%;
}
FORM.hidden {
position: absolute;
left:-100em;
}
input.email {
border-top:none;
border-left:none;
border-right:none;
border-bottom:1px solid #3E98FE;
text-align:right;
color:#3E98FE;
font-size:130%;
}
#container {
width:750px;
margin-left:auto;
margin-right:auto;
}
#header {
width:728px;
height:55px;
background:url(logob.jpg) no-repeat right;
margin: 1em auto 0 auto;
text-align:left;
}
#footer {
width:728px;
margin: 1em auto 0 auto;
font-size:70%;
}
#emailaddress {
display:inline;
float:right;
color:#3E98FE;
font-size:130%;
margin:0em 0em 0 0;
padding:0em;
}
#emailaddressincontent{
display:inline;
color:#3E98FE;
font-size:130%;
margin-left:0.5em;
}
.custom {
text-align:right;
color:#999;
font-size:80%;
}
#navbar {
margin:auto;
position:relative;
width:625px;
text-align:left;
padding: 5px 0px 5px 5px;
font-weight: bolder;
font-size:120%;
}
#emailnav{
float:left;
color:#999;
margin: 5px 5px 0 5px;
}
#contentbox {
margin:1em auto 0 auto;
width:750px;
border:1px solid #BFBFBF;
text-align:left;
}
#content {
padding: 2em 1em 1em 1em;
}
.ads {
padding: 1em 1em 1em 1em;
}
#status {
float:right;
color:#3E98FE;
margin: 5px 5px 0 0;
}
#status img {
}
.navitems {
font-family: arial;
font-weight: bolder;
}
.to, .from, .subject, .time {
color:#999;
font-size:85%;
}
.sponsor {
}

63
imap.php Normal file
View File

@ -0,0 +1,63 @@
<?php
//update this
$hostname = '{mail.yourserver.org:143/notls}';
$username = 'catch-all@yourserver.org';
$password = 'yourpassword';
function getEmailIDs($email){
global $hostname, $username, $password;
$emailIDs = array();
$inbox = imap_open($hostname, $username, $password);
/* grab emails */
$emails = imap_search($inbox,'ALL');
/* if emails are returned, cycle through each... */
if($emails) {
/* put the newest emails on top */
rsort($emails);
/* for every email... */
foreach($emails as $email_number) {
/* get information specific to this email */
$overview = imap_fetch_overview($inbox,$email_number,0);
if(strpos(strtolower($overview[0]->to) , $email.'@reducespam.org') !== false ){
$emailIDs[] = $email_number;
}
}
}
/* close the connection */
imap_close($inbox);
return $emailIDs;
}
function getEmail($emailID){
global $hostname, $username, $password;
$inbox = imap_open($hostname, $username, $password);
/* get information specific to this email */
$overview = imap_fetch_overview($inbox,$emailID,0);
//refer to http://stackoverflow.com/questions/5177772/how-to-use-imap-in-php-to-fetch-mail-body-content
$message = imap_fetchbody($inbox,$emailID,1);
$emailContent = array(
'subject' => ($overview[0]->subject),
'to' => ($overview[0]->to),
'from' => ($overview[0]->from),
'date' => $overview[0]->date,
'body' => quoted_printable_decode($message)//refer to http://stackoverflow.com/questions/19092161/php-imap-get-body-and-make-plain-text
);
/* close the connection */
imap_close($inbox);
return $emailContent;
}
?>

142
index.html Normal file
View File

@ -0,0 +1,142 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>ReduceSpam.org - Disposable Email Service</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="An open source approach to safer registration" />
<meta name="title" content="Disposable Email System" />
<!-- no cache headers -->
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
<meta http-equiv="Cache-Control" content="no-cache" />
<!-- end no cache headers -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Language" content="en-us" />
<meta name="DrivingA1994NissanMaximaMakesYouCool?" content="true" />
<meta name="robots" content="all" />
<meta name="Copyright" content="Copyright (c) 2007 - 2015 ChokLeong.com" />
<!-- -->
<meta http-equiv="imagetoolbar" content="no" />
<meta name="MSSmartTagsPreventParsing" content="true" />
<style type="text/css" media="screen"> @import url(furiousstyles.css); </style>
<script type="text/javascript" language="javascript" src="2prong.js"></script>
<!-- share this -->
<script type="text/javascript">var switchTo5x=true;</script>
<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
<script type="text/javascript">stLight.options({publisher: "3c8eeb67-61af-4916-9f60-d20e4c0edf71", doNotHash: false, doNotCopy: false, hashAddressBar: false});</script>
<!-- end share this -->
<!-- click to select -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<!-- end click to select -->
</head>
<body>
<div id="container">
<div id="header">
<div id="emailaddress"></div>
<a href="http://reducespam.org" title="ReduceSpam.org"><img src="logoa.jpg" title="ReduceSpam.org" /></a>
</div>
<div id="navbar">
</div>
<div id="contentbox">
<div class="ads">
<center>
<script type="text/javascript"><!--
google_ad_client = "pub-9985990683594436";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel = "";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "3D81EE";
google_color_text = "000000";
google_color_url = "008000";
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</center>
</div>
<div id="test"></div>
<div id="emailnav"></div>
<div id="status"></div>
<div id="content">
<h2>What is ReduceSpam.org?</h2>
<p>
ReduceSpam.org is the no-click disposable email system. It provides you, at no cost, a temporary email address for signing up/registering on certain websites that require verification without being bombarded by their spams. ReduceSpam.org, as its name indicates, helps to reduce spam emails in your life.
</p>
<h2>How it works?</h2>
<p>It is as simple as 1-2-3.</p>
<p><b>Step 1</b>: Copy (Ctrl-C) this email address: <span id="emailaddressincontent"></span></p>
<p><b>Step 2</b>: Paste (Ctrl-V) it in any form that requires email verification.</p>
<p><b>Step 3</b>: Wait for email to pop up here at reducespam.org</p>
<p>
You can keep and reuse the email address for as long as long you wish (for example you can bookmark the current URL). However, the messages are kept for a maximum of 2 days. After that they are being destroyed.
</p>
</div><!-- content -->
<div class="ads">
<center>
<script type="text/javascript"><!--
google_ad_client = "pub-9985990683594436";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel = "";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "3D81EE";
google_color_text = "000000";
google_color_url = "008000";
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</center>
</div>
</div><!-- contentbox -->
<div class="ads">
<center>
<!-- share this -->
Like it? Share it:
<span class='st_sharethis' displayText='ShareThis'></span>
<span class='st_facebook' displayText='Facebook'></span>
<span class='st_twitter' displayText='Tweet'></span>
<span class='st_googleplus' displayText='Google +'></span>
<span class='st_linkedin' displayText='LinkedIn'></span>
<span class='st_pinterest' displayText='Pinterest'></span>
<span class='st_email' displayText='Email'></span>
<!-- end share this -->
</center>
</div>
<div id="footer">&copy 2007 - 2015 <a href='http://reducespam.org'>ReduceSpam.org</a> reuses the source code developped by Mark since 2006 from 2Prong.com (which is no longer active right now)</div>
</div><!-- container -->
<div id="flashcopier"></div>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-40208590-2', 'reducespam.org');
ga('send', 'pageview');
</script>
</body>
</html>

BIN
logoa.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
logob.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 434 B

BIN
throbber.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB