- <?php
- /* *
- * Configuration
- */
- $DEBUG_MODE = 0;
- $SMTP_USERNAME = "";
- $SMTP_PASSWORD = "";
- $SMTP_HOST = "";
- $SMTP_PORT = "";
- $SESSION_LIFETIME = 1800; // 30 minutes
- $MAIN_DOMAIN = '';
- $LOGIN_PASSWORD = '';
- $REDITECT_HTTPS = True;
- $PROTECT_PAGE = True;
- /* *
- * Setup
- */
- $OldRandom;
- /* *
- * HTTPS redirection
- */
- if ($REDITECT_HTTPS == True) {
- $_SERVER['HTTPS'] == 1) ||
- $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'))
- {
- $redirect = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
- }
- }
- /* *
- * Protect page
- */
- if ($PROTECT_PAGE == True) {
- $InputPassword = $_POST['pass'];
- if(!($InputPassword == $LOGIN_PASSWORD)) {
- echo '<html><body><center><form method="POST" action="'.$_SERVER['REQUEST_URI'].'">
- Password protected page:<br/><input type="password" name="pass"></input><br/>
- <input type="submit" name="submit" value="PROCEED"></input>
- </form></center></body></html>';
- }
- }
- /* *
- * Add basic functionality
- */
- }
- echo '<script>
- function destroySession() {
- var xhttp = new XMLHttpRequest();
- xhttp.onreadystatechange = function() {
- if (this.readyState == 4 && this.status == 200) {
- document.getElementById("emails").innerHTML = this.responseText;
- }
- };
- xhttp.open("GET", "index.php?destroy", true);
- xhttp.send();
- }
- </script>';
- echo '<button onClick="location.reload();">REFRESH</button><br/>';
- echo '<button onClick="window.location.href = window.location.protocol "//" + window.location.host + window.location.pathname;">REFRESH PAGE</button><br/>';
- echo '<button onClick="destroySession();">DESTROY SESSION</button><br/>';
- /* *
- * Session
- */
- echo '<div id="emails">';
- $OldRandom = $_SESSION['mailbox'];
- }
- $_SESSION['lifetime'] = $TimeNow + $SESSION_LIFETIME; // Session lifetime 30 minutes
- else $Random = $_SESSION['mailbox']; // Temporary mailbox keeping
- echo 'Send messages to: ',$Random,'@',$MAIN_DOMAIN,"<br><br>";
- /* Mailbox cleanup. Delete all messages before today, and all dead session messages */
- $search_string = 'BEFORE "' . $Today . '"';
- if($Matches) {
- foreach($Matches as $message) {
- }
- }
- $search_string = 'TO "' . $OldRandom . '"';
- if($Matches) {
- foreach($Matches as $message) {
- }
- }
- /* Fetch our email sent to random address in SESSION */
- $search_string = 'UNSEEN TO "' . $Random . '"';
- if($Matches) {
- foreach($Matches as $message) {
- }
- } else {
- echo 'No new messages';
- }
- echo '</div>';
- ?>
Последни пейстове
Необработен текст