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