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