-
Notifications
You must be signed in to change notification settings - Fork 11
/
index.php
84 lines (75 loc) · 2.94 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?
include "config.php";
include "functions.php";
header("Content-Type: text/html; charset=utf-8");
header("Cache-Control: no-cache");
header("Pragma: no-cache");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT\n");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
$search = "";
$output = "";
$searchtxt = "";
$validemail = false;
if (isset ($_GET['search']))
{
$searchtxt = $_GET['search'];
$search = $searchtxt . "@" . $maildomain;
}
if (strlen ($searchtxt) > 0)
{
$validemail = checkMail($searchtxt);
if ($validemail == true)
{
mb_internal_encoding("UTF-8");
$inbox = imap_open($hostname,$username,$password)
or die('Cannot connect to Gmail: ' . imap_last_error());
// $emails = imap_search($inbox,'ALL');
$emails = imap_search($inbox,'TO "' . $search . '"');
if($emails) {
rsort($emails);
foreach($emails as $email_number) {
$overview = imap_fetch_overview($inbox,$email_number,0);
$mailurl = '.php?search=' . $searchtxt . '&nr=' . $email_number;
$iframe = '<iframe width="100%" height="150" scrolling="yes" marginheight="0" ' .
'marginwidth="0" frameborder="0" name="/mail' . $email_number . '" ' .
'src="mail' . $mailurl . '"></iframe>';
$output.= '<div id="email' . $email_number . '" class="email">';
$output.= '<table cellpadding=3 cellspacing=1 border=0 bgcolor=#EEEEEE width=95%>';
$output.= '<tr><td colspan="2" bgcolor="#FFFFFF"><b><a href="/details' . $mailurl .'">';
$output.= mb_decode_mimeheader(str_replace('_', ' ', $overview[0]->subject));
$output.= '</a></b></td>';
$output.= '<td rowspan="2" width="40" align="center" valign="center" bgcolor="#FFFFFF">';
$output.= '<a href="delete.php?nr=' . $email_number . '" class="jqModal">';
$output.= '<img src="/images/delete.png" border="0"></a></td>';
$output.= '</tr><tr><td bgcolor="#FFFFFF">'.$overview[0]->from;
$output.= '</td><td bgcolor="#FFFFFF">'.$overview[0]->date . '</td></tr>';
$output.= '<tr><td colspan="3">' . $iframe . '</td></tr>';
$output.= '</table></div>';
}
} else {
$output = "<p class='msg'>Keine E-Mails für <b>" . $search . "</b> im " .
" Posteingang gefunden<br>" .
" Evtl. sind Ihre E-Mails noch nicht im Posteingang angekommen. " .
" Bitte versuchen Sie es in wenigen Minuten noch einmal.";
}
imap_close($inbox);
} else {
// TODO Error
$output = "<h2 class='error'>Fehler: Ungültige E-Mail Adresse</h2>";
}
} else {
$mails = getRandomEMails($randommailanz);
$output = "<h2>Zufällig generierte E-Mail-Adressen</h2><div id='randomlinks'>";
foreach ($mails as $mail)
{
$link = "<a href='/?search=" . $mail['name'] . "'>" . $mail['adress'] . "</a>";
$output .= "<div class='random'>" . $link . "</div>";
}
$output .= "<div style='clear:both;'></div></div>";
}
$title = "Wegwerf E-Mail";
$pagetitle = "Wegwerf E-Mail Adresse";
include "text.php";
include "form.php";
include "template.php";
?>