--- /dev/null
+The SMail project is a web hosted mail,
+like as the normal email, but with others
+transfer methods, we looking for the user
+privacy and security on the internet.
+
+Our team thanks to you a normal user,
+maybe a new hoster what be using SMail.
+
+Considers your privacy!
\ No newline at end of file
--- /dev/null
+# SMAIL
+
+The SMail project is a web hosted mail,
+like as the normal email, but with others
+transfer methods, we looking for the user
+privacy and security on the internet.
+
+Our team thanks to you a normal user,
+maybe a new hoster what be using SMail.
+
+Considers your privacy!
+
+# Licensed by GNU Public License Version 3
\ No newline at end of file
--- /dev/null
+0.4.5 Beta
\ No newline at end of file
return 0;
}
}
+
+function return_plant($info,$date,$channelname){
+ $date=str_replace('-','/',$date);
+ echo "
+ <html>
+ <head>
+ <link rel='stylesheet' type='text/css' href='../../../css/all.css'>
+ <link rel='stylesheet' type='text/css' href='../../../css/channel.css'>
+ </head>
+ <body>
+ <text>Channel: $channelname</text><br>
+ <text>$date</text><br>
+ <text>$info</text><br>
+ </body>
+ </html>";
+}
+function return_plant_group($info,$date,$channelname){
+ $date=str_replace('-','/',$date);
+ echo "
+ <html>
+ <head>
+ <link rel='stylesheet' type='text/css' href='../../../css/all.css'>
+ <link rel='stylesheet' type='text/css' href='../../../css/channel.css'>
+ </head>
+ <body>
+ <text>User: $channelname</text><br>
+ <text>$date</text><br>
+ <text>$info</text><br>
+ </body>
+ </html>";
+}
?>
<?php
-$db_name='';
-$db_user='';
-$db_password='';
-$db_link='';
+$db_name='mail';
+$db_user='dania';
+$db_password='balbinotA12.';
+$db_link='localhost';
?>
include 'api/functions.php';
session_issruning();
if (isLoged()==0){
- header('Location: login.html');
+ header('Location: login.php');
}
?><html>
<head>
<title>Login Smail</title>
<link type='text/css' rel='stylesheet' href='css/all.css'/>
+ <link type='text/css' rel='stylesheet' href='css/send.css'/>
<style type='text/css'>
input{
display: block;
<body>
<form action='mailbox/change_p.php' method='POST'>
<input type="text" name="old" id="old" placeholder="Old">
- <input type="text" name="new" id="new" placeholder="New">
- <input type="submit" value="Change">
+ <input type="text" name="new" id="new" placeholder="New" class="center">
+ <input type="submit" value="Change" class="submit">
</form>
</body>
-</html>
\ No newline at end of file
+</html>
background: #30303c;
}
input,textarea{
- font-family: Bahnschrift;
+ font-family: Verdana;
border: none;
}
h1{
- font-size: 60px;
+ font-size: 50px;
}
.mail,text,a{
font-size: 30px;
}
h1,text{
color: white;
- font-family: Bahnschrift;
+ font-family: Verdana;
}
text{
font-size: 25px;
}
a{
- font-family: Bahnschrift;
+ font-family: Verdana;
color: yellowgreen;
text-decoration: none;
}
color: greenyellow;
}
text,h1{
- font-family: Bahnschrift;
+ font-family: Verdana;
+}
+.tag{
+ color: white;
+ background: #30303c;
+ padding: 5%;
+ padding-top: 1%;
+ padding-bottom: 1%;
+}
+.sitemap{
+ padding: 5%;
+ padding-top: 1%;
+ padding-bottom: 1%;
+ color: white
}
\ No newline at end of file
-<!-- {instance:Smail,version:0.2} --->
+<!-- {version:<?php echo file_get_contents('VERSION');?>} --->
<?php include 'i18n.class.php'; $i18n = new i18n(); $i18n->init();?>
<html>
<head>
<title>SecureMail</title>
- <link rel='stylesheet' type='text/css' href='css/index.css'>
+ <link rel='stylesheet' type='text/css' href='css/index.css?v=1'>
<link type='text/css' rel='stylesheet' href='css/all.css?v=1'/>
</head>
<body style='margin: 0px;'>
<h1 style='margin: 0px;'><?php echo L::index_welcome;?></h1>
<hr>
</div>
- <div style='color: white; background: #30303c; padding: 1%;'>
- <h1 style='margin: 0px;'><?php echo L::index_register;?></h1>
- <hr>
- <text><?php echo L::index_register_c;?></text>
- </div>
- <div style='color: white; background: #30303c; padding: 1%;'>
+ <div class="sitemap"><a href='map.php'>SiteMap</a> - <a href='map.php'>Login</a> - <a href='map.php'>Register</a> - <a href="https://reisub.nsupdate.info/git/?p=smail.git/">Git</a> - <a href="https://reisub.nsupdate.info/bugs/">Bugs</a></div>
+ <div class="tag">
<h1 style='margin: 0px;'><?php echo L::index_about;?></h1>
<hr>
<text><?php echo L::index_about_c;?></text>
</div>
- <div style='color: white; background: #30303c; padding: 1%;'>
- <h1 style='margin: 0px;'><?php echo L::index_how;?></h1>
- <hr>
- <text><?php echo L::index_how_c;?></text>
- </div>
- <div style='color: white; background: #30303c; padding: 1%;'>
- <h1 style='margin: 0px;'><?php echo L::index_where;?></h1>
- <hr>
- <text><?php echo L::index_where_c;?></text>
- </div>
- <div style='color: white; background: #30303c; padding: 1%;'>
+ <div class="tag">
<h1 style='margin: 0px;'><?php echo L::index_license;?></h1>
<hr>
<text><?php echo L::index_license_c;?></text>
[index]
-welcome = "SecureMail"
+welcome = "Welcome to the first SMail instance"
register = 'How i can create my own account?'
about = "What is SMail?"
how = "How i can use it?"
[new]
already = "This user was already taken"
user = "User created, your new smail are "
-aroba = "User was not created because you put an @, you only need to put the user"
+invalidchar = "You have inputed an invalid char"
+aroba = "User was not created because you put invalid characters"
[reg]
submit = "Sign up"
[errors]
nonerror = "This SMail sended"
-iderror_not = "This SMail dont exists"
+iderror_not = "This SMail dont exists or if is a channel them not exists or not is yours"
sslerror = "A error as ocurred while sending message because the server was invalid or haves an bad ssl"
[index]
-welcome = "SecureMail"
+welcome = "Bienvenido a la primera instancia de SMail"
register = "¿Como me registro?"
about = "¿Que es SMail?"
how = "¿Como puedo usar SMail?"
[new]
already = "Este usuario ya esta tomado"
user= "Usuario creado, tu nuevo smail es "
-aroba = "Usuario no creado porque pusiste una @, solo necesitas poner el usuario"
+invalidchar = "Introduciste un caracter invalido"
+aroba = "Usuario no creado porque pusiste caracteres no permitidos"
[reg]
submit = "Registrar"
[errors]
nonerror = "SMail enviado"
-iderror_not = "SMail no enviado porque el id no existe"
+iderror_not = "SMail no enviado porque el id no existe, o si es un canal no es tuyo"
sslerror = "SMail no enviado porque el servidor receptor no existe o no tiene ssl"
}
}
elseif(isset($_GET['id'])){
- try{include preg_split('/@/',$_SESSION['m_user'])[0].'/mails/'.$_GET['id'];echo '<text>'.L::gmail_sender.': '.$sender.'</text><br>';echo '<text>'.L::gmail_content.': '.$html;echo '</text><br><a href="mailb.php">'.L::gmail_return.'</a><text> '.L::gmail_or.' </text><a href="move.php?&from=mails&to=readed&id='.$_GET['id'].'">'.L::gmail_read.'</a>';}catch (Exception $e){echo L::gmail_invalid_id;}
+ try{include preg_split('/@/',$_SESSION['m_user'])[0].'/mails/'.$_GET['id'];echo '<text>'.L::gmail_sender.': '.$sender.'</text><br>';echo '<text>'.L::gmail_content.': '.str_replace('\n','<br>',$html);echo '</text><br><a href="mailb.php">'.L::gmail_return.'</a><text> '.L::gmail_or.' </text><a href="move.php?&from=mails&to=readed&id='.$_GET['id'].'">'.L::gmail_read.'</a>';}catch (Exception $e){echo L::gmail_invalid_id;}
}
}
}
--- /dev/null
+<?php
+
+/**
+ * Is my Channel?
+ * Internal Module
+ * Version: 0.1
+ *
+ * Requisites:
+ * MYSQL TABLE CALLED
+ * mail_lists
+ *
+ * AND ALL THE
+ * CHANNELS MODULES
+*/
+
+/** Basic Start */
+include '../api/server_info.php';
+include '../api/functions.php';
+/** Finish */
+
+/** Create $conn var */
+$conn=mysqli_connect($db_link,$db_user,$db_password,$db_name);
+
+/** Verifyng the sended data */
+if (isset($_POST['mail']) and isset($_POST['channel']) and isset($_POST['hash'])){
+ /** Query */
+ $query=mysqli_query($conn,'SELECT * FROM mail_lists WHERE channel_name="'.$_POST['channel'].'" AND channel_admin="'.$_POST['mail'].'"');
+ /** Verifyng the query */
+ if (!(gettype($query)=='boolean')){
+ if (!(mysqli_num_rows($query)==0)){
+ /** Extracting the data */
+ $data=mysqli_fetch_array($query,MYSQLI_ASSOC);
+ if ($data['channel_name']==$_POST['channel']){
+ http_response_code(200);
+ echo '200';
+ }
+ else{
+ http_response_code(500);
+ }
+ }
+ else{
+ http_response_code(500);
+ }
+ }
+ else{
+ http_response_code(500);
+ }
+}
+else{
+ http_response_code(500);
+}
+
+/** ALL THE 500 RESPONSES ARE RECOGNIZED AT reicive.php */
+?>
\ No newline at end of file
<link type='text/css' rel='stylesheet' href='../css/mailbox.css?v=1'/>
</head>
<body>
- <h1>Mail Box <?php if(isset($_GET['box'])==true){echo $_GET['box'];}?></h1>
+ <h1><?php if (isset($_GET['channel'])){?>Mail Box - Special<?php } else{ ?>Mail Box<?php } ?> <?php if(isset($_GET['box'])==true){echo $_GET['box'];}?></h1>
<?php
if (isset($_GET['info'])){
echo str_replace('_',' ',$_GET['info']);
return ($files) ? $files : false;
}
if (isloged()==1){
- if (isset($_GET['box'])){
+ if (isset($_GET['channel'])){
+ if (is_dir($_GET['channel']) and strpos($_GET['channel'],'/')==false and strpos($_GET['channel'],'..')==false or strpos($_GET['channel'],'\\')==false){
+ $dirs=scan_dir(getcwd().'/'.$_GET['channel'].'/mails/');
+ if (($dirs==false)==false){
+ foreach ($dirs as $files){
+ include getcwd().'/'.$_GET['channel'].'/mails/'.$files;
+ echo '<span class="mail"><a href="'.$_GET['channel'].'/mails/'.$files.'">'.substr($content,0,20).'...</a> <text>'.str_replace('-','/',$date).'</text> </span><br>
+';
+ }
+ }
+ }
+ }
+ elseif (isset($_GET['box'])){
if (is_dir(preg_split('/@/',$_SESSION['m_user'])[0].'/'.$_GET['box']) and strpos($_GET['box'],'/')==false and strpos($_GET['box'],'..')==false or strpos($_GET['box'],'\\')==false){
$dirs=scan_dir(getcwd().'/'.preg_split('/@/',$_SESSION['m_user'])[0].'/'.$_GET['box']);
if (($dirs==false)==false){
session_issruning();
if (isloged()==1){
if (isset($_GET['id']) and isset($_GET['to']) and isset($_GET['from'])){
- if (is_dir($_SESSION['m_user'].'/'.$_GET['from'])){
- if (file_exists($_SESSION['m_user'].'/'.$_GET['from']).$_GET['id'] and strpos($_GET['to'],'..')==false and strpos($_GET['to'],'/')==false and strpos($_GET['to'],'\\')==false and strpos($_GET['from'],'..')==false and strpos($_GET['from'],'\\')==false and strpos($_GET['from'],'/')==false){
- rename($_SESSION['m_user'].'/'.$_GET['from'].'/'.$_GET['id'],$_SESSION['m_user'].'/'.$_GET['to'].'/'.$_GET['id']);
- echo 'Success';
+ if (is_dir(preg_split('/@/',$_SESSION['m_user'])[0].'/'.$_GET['from'])){
+ if (file_exists(preg_split('/@/',$_SESSION['m_user'])[0].'/'.$_GET['from']).$_GET['id'] and strpos($_GET['to'],'..')==false and strpos($_GET['to'],'/')==false and strpos($_GET['to'],'\\')==false and strpos($_GET['from'],'..')==false and strpos($_GET['from'],'\\')==false and strpos($_GET['from'],'/')==false){
+ try{rename(preg_split('/@/',$_SESSION['m_user'])[0].'/'.$_GET['from'].'/'.$_GET['id'],preg_split('/@/',$_SESSION['m_user'])[0].'/'.$_GET['to'].'/'.$_GET['id']);echo 'Success';}catch (Exception $error){echo 'ID not exists';}
+
}
else{
http_response_code(500);
}
else{
header('Location: ../login.php');
-}
\ No newline at end of file
+}
--- /dev/null
+<?php
+
+/**
+ * Create Channel Script
+ * Internal Module
+ * Version: 0.1
+ *
+ * Requisites:
+ * MYSQL TABLE CALLED
+ * mail_lists
+*/
+
+$about='
+The channels are mailing
+list, you can create one,
+you can join, see a exacly
+message etc...
+';
+
+include '../api/server_info.php';
+include '../api/functions.php';
+
+session_issruning();
+
+$conn=mysqli_connect($db_link,$db_user,$db_password,$db_name);
+$query=mysqli_query($conn,'CREATE TABLE mail_lists(channel_name VARCHAR(20), channel_admin VARCHAR(150), channel_users VARCHAR(10000))');
+
+if (isLoged()==1){
+ if (isset($_POST['newname'])){
+ $query=mysqli_query($conn,'SELECT channel_name FROM mail_lists WHERE channel_name="'.$_POST['newname'].'"');
+ if (mysqli_num_rows($query)==0){
+ echo 'Name Avaible';
+ if (isset($_POST['admin'])){
+ if (is_dir(preg_split('/@/',$_POST['admin'])[0])){
+ echo '<br>All Ok';
+ mysqli_query($conn,'INSERT INTO mail_lists(channel_name,channel_admin,channel_users) values("'.$_POST['newname'].'","'.$_POST['admin'].'","")');
+ echo '<br>Created';
+ mkdir($_POST['newname']);
+ mkdir($_POST['newname'].'/mails');
+ touch($_POST['newname'].'/index.php');
+ file_put_contents($_POST['newname'].'/index.php','<?php $type="CHANNEL"; ?>');
+ }
+ else{
+ header('Location: ../login.php');
+ }
+ }
+ }
+ else{
+ echo 'Name is already using';
+ }
+ }
+ else{
+ header('Location: ../new_channel.php?info=<text>Please_provide_a_name</text>');
+ }
+}
+else{
+ header('Location: ../login.php');
+}
+
+?>
--- /dev/null
+<?php
+
+/**
+ * Create Channel Script
+ * Internal Module
+ * Version: 0.1
+ *
+ * Requisites:
+ * MYSQL TABLE CALLED
+ * mail_lists
+*/
+
+$about='
+The groupd are mailing
+list, you can create one,
+you can join, see a exacly
+message etc...
+';
+
+include '../api/server_info.php';
+include '../api/functions.php';
+
+session_issruning();
+
+$conn=mysqli_connect($db_link,$db_user,$db_password,$db_name);
+$query=mysqli_query($conn,'CREATE TABLE mail_lists(channel_name VARCHAR(20), channel_admin VARCHAR(150), channel_users VARCHAR(10000))');
+
+if (isLoged()==1){
+ if (isset($_POST['newname'])){
+ $query=mysqli_query($conn,'SELECT channel_name FROM mail_lists WHERE channel_name="'.$_POST['newname'].'"');
+ if (mysqli_num_rows($query)==0){
+ echo 'Name Avaible';
+ if (isset($_POST['admin'])){
+ if (is_dir(preg_split('/@/',$_POST['admin'])[0])){
+ echo '<br>All Ok';
+ mysqli_query($conn,'INSERT INTO mail_lists(channel_name,channel_admin,channel_users) values("'.$_POST['newname'].'","'.$_POST['admin'].'","")');
+ echo '<br>Created';
+ mkdir($_POST['newname']);
+ mkdir($_POST['newname'].'/mails');
+ touch($_POST['newname'].'/index.php');
+ file_put_contents($_POST['newname'].'/index.php','<?php $type="GROUP"; ?>');
+ }
+ else{
+ header('Location: ../login.php');
+ }
+ }
+ }
+ else{
+ echo 'Name is already using';
+ }
+ }
+ else{
+ header('Location: ../new_channel.php?info=<text>Please_provide_a_name</text>');
+ }
+}
+else{
+ header('Location: ../login.php');
+}
+
+?>
include '../api/server_info.php';
-if (strpos('@',$_POST['mail'])){
- header('../new_user.php?info='.L::new_aroba);
+if (strpos($_POST['mail'],'@') or strpos($_POST['mail'],'.') or strpos($_POST['mail'],'/')){
+ header('Location: ../new_user.php?info='.L::new_aroba);
}
elseif (isset($_POST['mail']) and isset($_POST['password'])){
$conn=mysqli_connect($db_link,$db_user,$db_password,$db_name);
$selfUrl=$_SERVER['HTTP_HOST'].preg_replace('/mailbox\/new_user.php/','',$_SERVER['PHP_SELF']);
+ $query=mysqli_query($conn,'CREATE TABLE mail (mail_user VARCHAR(150),mail_password VARCHAR(300))');
$query=mysqli_query($conn,'SELECT mail_user FROM mail WHERE mail_user="'.$_POST['mail'].'@'.$selfUrl.'"');
print_r($query);
if (mysqli_connect_error()){
http_response_code(500);
header('Location: new_user.php?info=<text>DB_error</text>');
}
+ elseif (strpos('.',$_POST['mail']) AND strpos('$',$_POST['mail']) AND strpos('@',$_POST['mail'])){
+ header('Location: new_user.php?info=<text>'.L::new_invalidchar.'</text>');
+ }
elseif (mysqli_num_rows($query)==0){
mkdir($_POST['mail']);
mkdir($_POST['mail'].'/mails');
<?php
+ini_set('display_errors',0);
+ini_set('display_initial_errors',0);
+header('Content-type: application/xml');
function scan_dir($dir) {
$ignored = array('.', '..', '.htaccess','index.php','getmail.php');
$files = array();
return ($files) ? $files : false;
}
include '../api/functions.php';
+
session_issruning();
if (isloged()==1){
+ echo '<xml>';
if (isset($_GET['box'])){
- if (strpos($_GET['box'],'/') or strpos($_GET['box'],'..') or strpos($_GET['box'],'\\')){}
+ if (strpos($_GET['box'],'/')==True or strpos($_GET['box'],'.')==True or strpos($_GET['box'],'\\')==True){echo 'Dont make this hard';}
else{
if ($_GET['box']==''){$_GET['box']=='mails';}
- echo 'Raw Box of '.preg_split('/@/',$_SESSION['m_user'])[0].'\\'.$_GET['box'].'\\<br>';
foreach (scan_dir(getcwd().'\\'.preg_split('/@/',$_SESSION['m_user'])[0].'\\'.$_GET['box'].'\\') as $d){
include preg_split('/@/',$_SESSION['m_user'])[0].'\\'.$_GET['box'].'\\'.$d;
- try{echo '<a href="getmail.php?box='.$_GET['box'].'&id='.$d.'">'.$sender.'</a> '.$date.'<br>';}catch (Exception $e){echo '<a href="getmail.php?id='.$d.'">'.$sender.'</a> <br>';}
+ echo ' <id id="'.$d.'">';
+ echo ' <box>'.$_GET['box'].'</box>';
+ echo ' <date>'.$date.'</date>';
+ echo ' <sender>'.$sender.'</sender>';
+ echo ' </id>';
}
}
}
foreach (scan_dir(getcwd().'\\'.preg_split('/@/',$_SESSION['m_user'])[0]) as $d){
foreach (scan_dir(getcwd().'\\'.preg_split('/@/',$_SESSION['m_user'])[0].'\\'.$d.'\\') as $i){
include preg_split('/@/',$_SESSION['m_user'])[0].'\\'.$d.'\\'.$i;
- echo '<a href="getmail.php?id='.$i.'">'.$sender.'</a> '.$date.' '.$d.'<br> ';
+ echo ' <id id="'.$i.'">';
+ echo ' <box>'.$d.'</box>';
+ echo ' <date>'.$date.'</date>';
+ echo ' <sender>'.$sender.'</sender>';
+ echo ' </id>';
}
}
}
+ echo '</xml>';
}
else{
header('Location: ../login.php');
-}
-?>
\ No newline at end of file
+}
\ No newline at end of file
<?php
+/** CREATES THE STRING ID */
function string($length = 30) {
- return substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, $length);}
+ return substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, $length);
+}
+/** INTERNAL MODULE */
+
+/** INCLUDING THE USER INFO */
+require $_POST['to'].'/index.php';
-if (isset($_POST['mail']) and $_POST['to'] and isset($_POST['html']) and isset($_POST['hash'])){
+/** Verifing the posted data */
+if (isset($_POST['mail']) and $_POST['to'] and isset($_POST['html']) and isset($_POST['hash']) and $type=='GROUP'){
+ /** Creating an array for send the data to the supposed server */
+ $mail=['mail'=>$_POST['mail'], 'hash'=>$_POST['hash'],'channel'=>preg_split('/@/',$_POST['to'])[0]];
+ /** Configuring cURL with an array */
+ $other=array(
+ CURLOPT_URL => 'https://'.preg_split('/@/',$_POST['mail'])[1].'/mailbox/user.php',
+ CURLOPT_POST => true,
+ CURLOPT_POSTFIELDS => $mail,
+ CURLOPT_RETURNTRANSFER => true,
+ CURLOPT_SSL_VERIFYPEER => false
+ );
+ /** INIT CURL */
+ $curl=curl_init();
+ /** SETTING THE ARRAY */
+ curl_setopt_array($curl, ($other));
+ /** RUN */
+ $out=curl_exec($curl);
+ /** CHEKING RESPONSE */
+ if (curl_error($curl)){
+ http_response_code(400);
+ }
+ else{
+ /** GETTING CODE */
+ $info=curl_getinfo($curl,CURLINFO_HTTP_CODE);
+ if ($info==200){
+ if (file_exists($_POST['to'].'/index.php')){
+ /** SAVING FILE */
+ $date=date('d/m/Y H:i:s');
+ $content=$date=date('d/m/Y H:i:s');
+ file_put_contents(preg_split('/@/',$_POST['to'])[0].'/mails/'.(string()).'.php','<?php
+$date="'.$date.'";
+$chname="'.preg_split('/@/',$_POST['mail'])[0].'";
+$content="'.$_POST['html'].'";
+if (basename(__FILE__)==basename($_SERVER["SCRIPT_FILENAME"])){
+ include "../../../api/functions.php";
+ return_plant_group($content,$date,$chname);
+}
+?>');
+ http_response_code(200);
+ }
+ else{
+ http_response_code(404);
+ }
+ }
+ else{
+ echo $out;
+ http_response_code(500);
+ }
+ }
+ /** CLOSING */
+ curl_close($curl);
+}
+elseif (isset($_POST['mail']) and $_POST['to'] and isset($_POST['html']) and isset($_POST['hash']) and $type=='CHANNEL'){
+ /** Creating an array for send the data to the supposed server */
+ $mail=['mail'=>$_POST['mail'], 'hash'=>$_POST['hash'],'channel'=>preg_split('/@/',$_POST['to'])[0]];
+ /** Configuring cURL with an array */
+ $other=array(
+ CURLOPT_URL => 'https://'.preg_split('/@/',$_POST['mail'])[1].'/mailbox/ismch.php',
+ CURLOPT_POST => true,
+ CURLOPT_POSTFIELDS => $mail,
+ CURLOPT_RETURNTRANSFER => true,
+ CURLOPT_SSL_VERIFYPEER => false
+ );
+ /** INIT CURL */
+ $curl=curl_init();
+ /** SETTING THE ARRAY */
+ curl_setopt_array($curl, ($other));
+ /** RUN */
+ $out=curl_exec($curl);
+ /** CHEKING RESPONSE */
+ if (curl_error($curl)){
+ http_response_code(400);
+ }
+ else{
+ /** GETTING CODE */
+ $info=curl_getinfo($curl,CURLINFO_HTTP_CODE);
+ if ($info==200){
+ if (file_exists($_POST['to'].'/index.php')){
+ /** SAVING FILE */
+ $date=date('d/m/Y H:i:s');
+ $content=$date=date('d/m/Y H:i:s');
+ file_put_contents(preg_split('/@/',$_POST['to'])[0].'/mails/'.(string()).'.php','<?php
+$date="'.$date.'";
+$chname="'.preg_split('/@/',$_POST['mail'])[0].'";
+$content="'.$_POST['html'].'";
+if (basename(__FILE__)==basename($_SERVER["SCRIPT_FILENAME"])){
+ include "../../../api/functions.php";
+ return_plant($content,$date,$chname);
+}
+?>');
+ http_response_code(200);
+ }
+ else{
+ http_response_code(404);
+ }
+ }
+ else{
+ echo $out;
+ http_response_code(500);
+ }
+ }
+ /** CLOSING */
+ curl_close($curl);
+}
+elseif (isset($_POST['mail']) and $_POST['to'] and isset($_POST['html']) and isset($_POST['hash'])){
+ /** Creating an array for send the data to the supposed server */
$mail=['mail'=>$_POST['mail'], 'hash'=>$_POST['hash']];
+ /** Configuring cURL with an array */
$other=array(
CURLOPT_URL => 'https://'.preg_split('/@/',$_POST['mail'])[1].'/mailbox/user.php',
CURLOPT_POST => true,
- CURLOPT_SSLCERT => '',
CURLOPT_POSTFIELDS => $mail,
- CURLOPT_RETURNTRANSFER => true
+ CURLOPT_RETURNTRANSFER => true,
+ CURLOPT_SSL_VERIFYPEER => false
);
+ /** INIT CURL */
$curl=curl_init();
+ /** SETTING THE ARRAY */
curl_setopt_array($curl, ($other));
+ /** RUN */
$out=curl_exec($curl);
+ /** CHEKING RESPONSE */
if (curl_error($curl)){
http_response_code(400);
}
else{
+ /** GETTING CODE */
$info=curl_getinfo($curl,CURLINFO_HTTP_CODE);
echo $info;
if ($info==200){
if (file_exists($_POST['to'].'/index.php')){
+ /** SAVING FILE */
$date=date('d/m/Y H:i:s');
$content='<?php
-$html="'.'<!version=0.1>'.str_replace('"',"'",$_POST['html']).'";
+$html="'.str_replace('"',"'",$_POST['html']).'";
$sender="'.$_POST['mail'].'";
$date="'.$date.'";
?>';
http_response_code(500);
}
}
+ /** CLOSING */
curl_close($curl);
}
else{
<?php
+/** BASIC INIT */
include '../api/functions.php';
session_issruning();
$log=isloged();
if ($log==1 and isset($_GET['folder'])){
if ($_GET['folder']=='mails' or $_GET['folder']=='readed'){
+ /** Protected Folders */
echo 'You cannot delete the mailbox '.$_GET['folder'];
}
elseif (is_dir(preg_split('/@/',$_SESSION['m_user'])[0].'/'.$_GET['folder'])){
+ /** Recursive deletion to the folder */
$dir=preg_split('/@/',$_SESSION['m_user'])[0].'/'.$_GET['folder'];
$it = new RecursiveDirectoryIterator($dir, RecursiveDirectoryIterator::SKIP_DOTS);
$files = new RecursiveIteratorIterator($it,
echo 'Folder deleted';
}
else{
+ /** Informs to the user, what that folder not exists */
echo 'Folder not exists';
}
}
else{
if ($log==0){
+ /** If you not are login redirect or more knowledge with 301-302 HTTP ERROR*/
header('Location: ../login.php');
}
else{}
include '../api/functions.php';
if (isset($_POST['content']) and isset($_POST['mail_r'])){
session_issruning();
+ $_POST['content']=str_replace('\n','<br>',$_POST['content']);
if (isloged()==1){
$split=preg_split('/@/',$_POST['mail_r']);
$cnt=count($split);
CURLOPT_URL => 'https://'.$split[1].'mailbox/reicive.php',
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $mail,
- CURLOPT_RETURNTRANSFER => true
+ CURLOPT_RETURNTRANSFER => true,
+ CURLOPT_SSL_VERIFYPEER => false
);
echo 'Sending sm to the url '.$split[1];
echo '<br> and to the mail id '.$split[0];
CURLOPT_URL => 'https://'.$selfUrl.'mailbox/reicive.php',
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $mail,
- CURLOPT_RETURNTRANSFER => true
+ CURLOPT_RETURNTRANSFER => true,
+ CURLOPT_SSL_VERIFYPEER => false
);
echo 'Sending sm to the url '.$selfUrl;
echo '<br> and to the mail id '.$split[0];
$curl=curl_init();
curl_setopt_array($curl, ($other));
$out=curl_exec($curl);
- echo curl_error($curl);
+ echo $out;
if (curl_error($curl)){
header('Location: mailb.php?info=<text>'.L::errors_sslerror.'</text>');
}
header('Location: mailb.php?info=<text>'.L::errors_nonerror.'</text>');
}
else{
- header('Location: mailb.php?info=<text>'.L::errors_iderror_not.'</text>');
+ header('Location: mailb.php?info=<text>'.L::errors_iderror_not.'</text>'.$out);
}
}
}
http_response_code(200);
}
else{
- http_response_code(400);
+ $query=mysqli_query($conn,'SELECT channel_name FROM mail_lists WHERE channel_name="'.$_POST['mail'].'"');
+ if (gettype($query=='boolean')){
+ http_response_code(400);
+ }
+ else{
+ http_response_code(200);
+ }
}
}
else{
http_response_code(400);
}
-?>
\ No newline at end of file
+?>
--- /dev/null
+<xml>
+ <?php
+ header('Content-type: application/xml');
+ require '../api/functions.php';
+ session_issruning();
+ if (isloged()==1){
+ if (isset($_GET['box']) and strpos($_GET['box'],'..')==false and strpos($_GET['box'],'\\')==false and strpos($_GET['box'],'/')==false){
+ if (isset($_GET['delthem'])){
+ if (strpos($_GET['delthem'],'/') or strpos($_GET['delthem'],'..') or strpos($_GET['delthem'],'\\')){}
+ else{
+ try{unlink(preg_split('/@/',$_SESSION['m_user'])[0].'/'.$_GET['box'].'/'.$_GET['delthem']);echo ' <info>Deleted</info>';}catch(Exception $e){echo ' <info>ID Invalid</info>';}
+ }
+ }
+ elseif(isset($_GET['id'])){
+ try{include preg_split('/@/',$_SESSION['m_user'])[0].'/'.$_GET['box'].'/'.$_GET['id']; echo '<box>'.$_GET['box'].'</box>';echo ' <data>'.str_replace('<','<',$html).'</data>';echo ' <sender>'.$sender.'</sender>';echo ' <date>'.$date.'</date>';}catch (Exception $e){echo ' <info>ID Invalid</info>';}
+ }
+ }
+ else{
+ if (isset($_GET['delthem'])){
+ if (strpos($_GET['delthem'],'/') or strpos($_GET['delthem'],'..') or strpos($_GET['delthem'],'\\')){}
+ else{
+ try{unlink(preg_split('/@/',$_SESSION['m_user'])[0].'/mails/'.$_GET['delthem']);echo ' <info>Succes</info>';}catch(Exception $e){echo ' <info>ID Invalid</info>';}
+ }
+ }
+ elseif(isset($_GET['id'])){
+ try{include preg_split('/@/',$_SESSION['m_user'])[0].'/mails/'.$_GET['id'];echo ' <data>'.str_replace('<','<',$html).'</data>';echo ' <sender>'.$sender.'</sender>';echo ' <date>'.$date.'</date>';}catch (Exception $e){echo ' <info>ID Invalid</info>';}
+ }
+ }
+ }
+ else{
+ http_response_code(404);
+ }
+
+ ?>
+</xml>
--- /dev/null
+ <head>
+ <link rel='stylesheet' type='text/css' href='css/all.css'>
+ </head>
+ <body>
+ <?php
+ $xmlDoc=simplexml_load_file('sitemap.xml');
+ foreach ($xmlDoc as $node){
+ echo '<a href="'.$node->link.'">'.$node->name.'</a><br>';
+ }
+ ?>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+<?php
+include 'api/functions.php';
+session_issruning();
+if (isloged()==0){
+ header('Location: login.php');
+}
+
+?>
+<?php include 'i18n.class.php'; $i18n = new i18n(); $i18n->init();?>
+<html>
+ <head>
+ <link type='text/css' rel='stylesheet' href='css/all.css'/>
+ <link type='text/css' rel='stylesheet' href='css/send.css'/>
+ <style type='text/css'>
+ input{
+ display: block;
+ }
+ </style>
+ </head>
+ <body>
+ <form action='mailbox/new_channel.php' method='POST'>
+ <input type="text" name="newname" placeholder="Name">
+ <input type="hidden" name="admin" value="<?php echo $_SESSION['m_user'];?>">
+ <input class='submit' type="submit" value=<?php echo L::send_send;?>>
+ </form>
+ </body>
+</html>
--- /dev/null
+<?php
+include 'api/functions.php';
+session_issruning();
+if (isloged()==0){
+ header('Location: login.php');
+}
+
+?>
+<?php include 'i18n.class.php'; $i18n = new i18n(); $i18n->init();?>
+<html>
+ <head>
+ <link type='text/css' rel='stylesheet' href='css/all.css'/>
+ <link type='text/css' rel='stylesheet' href='css/send.css'/>
+ <style type='text/css'>
+ input{
+ display: block;
+ }
+ </style>
+ </head>
+ <body>
+ <form action='mailbox/new_group.php' method='POST'>
+ <input type="text" name="newname" placeholder="Name">
+ <input type="hidden" name="admin" value="<?php echo $_SESSION['m_user'];?>">
+ <input class='submit' type="submit" value=<?php echo L::send_send;?>>
+ </form>
+ </body>
+</html>
include 'api/functions.php';
session_issruning();
if (isloged()==0){
- header('Location: login.html');
+ header('Location: login.php');
}
?>
--- /dev/null
+<xml>
+ <page>
+ <name>Index</name>
+ <link>index.php</link>
+ </page>
+ <page>
+ <name>MailB Web SMail Manager</name>
+ <link>mailbox/mailb.php</link>
+ </page>
+ <page>
+ <name>Register User</name>
+ <link>new_user.php</link>
+ </page>
+ <page>
+ <name>Change Password</name>
+ <link>ch_p.php</link>
+ </page>
+ <page>
+ <name>Register Channel</name>
+ <link>new_channel.php</link>
+ </page>
+ <page>
+ <name>Register Group</name>
+ <link>new_group.php</link>
+ </page>
+ <page>
+ <name>Send Message</name>
+ <link>send_m.php</link>
+ </page>
+ <page>
+ <name>Login</name>
+ <link>login.php</link>
+ </page>
+ <page>
+ <name>User Exists Script</name>
+ <link>mailbox/user.php</link>
+ </page>
+ <page>
+ <name>Send Script</name>
+ <link>mailbox/send.php</link>
+ </page>
+ <page>
+ <name>Remove Mailbox Script</name>
+ <link>mailbox/remove_mf.php</link>
+ </page>
+ <page>
+ <name>XMLMail Script</name>
+ <link>mailbox/xmlmail.php</link>
+ </page>
+ <page>
+ <name>Reicive Script</name>
+ <link>mailbox/reicive.php</link>
+ </page>
+ <page>
+ <name>XML Raw Mails Script</name>
+ <link>mailbox/raw_mails.php</link>
+ </page>
+ <page>
+ <name>Move Script</name>
+ <link>mailbox/move.php</link>
+ </page>
+ <page>
+ <name>ISMYCHANNEL Script</name>
+ <link>mailbox/ismch.php</link>
+ </page>
+ <page>
+ <name>XMLGETMAIL Script</name>
+ <link>mailbox/getmail.php</link>
+ </page>
+ <page>
+ <name>Create Mailbox Folder Script</name>
+ <link>mailbox/create_mf.php</link>
+ </page>
+ <page>
+ <name>Change Password Script</name>
+ <link>mailbox/change_p.php</link>
+ </page>
+</xml>
\ No newline at end of file