4 include_once ('../src/validate.php');
5 include_once ('../functions/imap.php');
7 displayPageHeader($color, $mailbox);
9 $imap_stream = sqimap_login($username, $key, $imapServerAddress,
11 sqimap_mailbox_select($imap_stream, $mailbox);
12 fputs($imap_stream, 'a010 FETCH ' . $passed_id . ' RFC822' . "\r\n");
13 $read = sqimap_read_data($imap_stream, 'a010', true, $response, $message);
16 if ($spamcop_method == 'quick_email' ||
17 $spamcop_method == 'thorough_email') {
18 // Use email-based reporting -- save as an attachment
19 if(!isset($composesession)) {
21 session_register('composesession');
23 if (!isset($session)) {
24 $session = "$composesession" +
1;
25 $composesession = $session;
28 if (!isset($attachments)) {
29 $attachments = array();
30 session_register('attachments');
33 foreach ($attachments as $info) {
34 if (file_exists($attachment_dir . $info['localfilename']))
35 unlink($attachment_dir . $info['localfilename']);
37 $attachments = array();
39 $file = GenerateRandomString(32, '', 7);
40 while (file_exists($attachment_dir . $file))
41 $file = GenerateRandomString(32, '', 7);
42 $newAttachment['localfilename'] = $file;
43 $newAttachment['remotefilename'] = 'email.txt';
44 $newAttachment['type'] = 'message/rfc822';
45 $newAttachment['session'] = $session;
46 $fp = fopen($attachment_dir . $file, 'w');
47 foreach ($read as $line) {
50 $attachments[] = $newAttachment;
52 $fn = getPref($data_dir, $username, 'full_name');
53 $em = getPref($data_dir, $username, 'email_address');
55 $HowItLooks = $fn . ' ';
57 $HowItLooks .= '<' . $em . '>';
62 <p
>Sending this spam report will give you back a reply with URLs that you
63 can click on to properly report this spam message to the proper authorities
.
64 This is a free service
. By pressing the
"Send Spam Report" button
, you
65 agree to follow SpamCop
's rules/terms of service/etc.</p>
67 <table align=center width="75%" border=0 cellpadding=0 cellspacing=0>
69 <td align=left valign=top>
70 <?PHP if (isset($js_web) && $js_web) {
71 ?><form method=post action="javascript:return false">
72 <input type=button value="Close Window"
73 onClick="window.close(); return true;">
76 ?><form method=post action="../../src/right_main.php">
77 <input type=hidden name="mailbox" value="<?PHP echo
78 htmlspecialchars($mailbox) ?>">
79 <input type=hidden name="startMessage" value="<?PHP echo
80 htmlspecialchars($startMessage) ?>">
81 <input type=submit value="Cancel / Done">
86 <td align=right valign=top>
87 <?PHP if ($spamcop_method == 'thorough_email
' ||
88 $spamcop_method == 'quick_email
') {
89 if ($spamcop_method == 'thorough_email
')
90 $report_email = 'submit
.' . $spamcop_id . '@spam
.spamcop
.net
';
92 $report_email = 'quick
.' . $spamcop_id . '@spam
.spamcop
.net
';
93 ?> <form method=post action="../../src/compose.php">
94 <input type=hidden name="mailbox" value="<?PHP echo
95 htmlspecialchars($mailbox) ?>">
96 <input type=hidden name="spamcop_is_composing" value="<?PHP echo
97 htmlspecialchars($passed_id) ?>">
98 <input type=hidden name="send_to" value="<?PHP echo $report_email ?>">
99 <input type=hidden name="send_to_cc" value="">
100 <input type=hidden name="send_to_bcc" value="">
101 <input type=hidden name="subject" value="reply anyway">
102 <input type=hidden name="identity" value="default">
103 <input type=hidden name="session" value="<?PHP echo $session?>">
104 <input type=submit name="send" value="Send Spam Report">
106 $Message = implode('', $read);
107 if (strlen($Message) > 50000) {
108 $Warning = "\n[truncated by SpamCop]\n";
109 $Message = substr($Message, 0, 50000 - strlen($Warning)) . $Warning;
111 if (isset($js_web) && $js_web) {
112 ?> <form method=post action="http://spamcop.net/sc" name="submitspam"
113 enctype="multipart/form-data"><?PHP
115 ?> <form method=post action="http://spamcop.net/sc" name="submitspam"
116 enctype="multipart/form-data" target="_blank"><?PHP
118 <input type=hidden name=action value=submit>
119 <input type=hidden name=oldverbose value=1>
120 <input type=hidden name=code value="<?PHP echo $spamcop_id ?>">
121 <input type=hidden name=spam value="<?PHP
122 echo htmlspecialchars($Message);
124 <input type=submit name="x1" value="Send Spam Report">