<?php
/**
** spamcop.php -- SpamCop plugin
*
** Copyright (c) 1999-2020 The SquirrelMail Project Team
** Licensed under the GNU GPL. For full terms see the file COPYING.
*
** $Id: spamcop.php 14840 2020年01月07日 07:42:38Z pdontthink $
**/
/* SquirrelMail required files. */
require_once(SM_PATH . 'include/validate.php');
require_once(SM_PATH . 'functions/imap.php');
$passed_ent_id='', $imapConnection) {
$hashed_attachment_dir =
getHashedDir ($username, $attachment_dir);
if (!$passed_ent_id) {
'FETCH '.$passed_id.' RFC822',
TRUE, $response, $readmessage,
$uid_support);
} else {
'FETCH '.$passed_id.' BODY['.$passed_ent_id.']',
TRUE, $response, $readmessage, $uid_support);
$message = $message->parent;
}
if ($response == 'OK') {
$body =
implode ('', $body_a) .
"\r\n";
$full_localfilename = "$hashed_attachment_dir/$localfilename";
$fp =
fopen ( $full_localfilename, 'w');
$composeMessage->initAttachment('message/rfc822','email.txt', $localfilename);
}
return $composeMessage;
}
/* GLOBALS */
$startMessage = 1;
}
$passed_ent_id = 0;
}
$composesession = 0;
}
global $imap_stream_options; // in case not defined in config
/* END GLOBALS */
$imap_stream =
sqimap_login ($username, $key, $imapServerAddress,
$imapPort, 0, $imap_stream_options);
if ($spamcop_method == 'quick_email' ||
$spamcop_method == 'thorough_email') {
// Use email-based reporting -- save as an attachment
$session = "$composesession"+1;
$composesession = $session;
if (!isset($compose_messages)) {
$compose_messages = array();
}
if (!isset($compose_messages[$session]) || ($compose_messages[$session] == NULL)) {
$composeMessage->rfc822_header = $rfc822_header;
$composeMessage->reply_rfc822_header = '';
$compose_messages[$session] = $composeMessage;
} else {
$composeMessage=$compose_messages[$session];
}
$passed_ent_id, $imap_stream);
$compose_messages[$session] = $composeMessage;
$fn =
getPref ($data_dir, $username, 'full_name');
$em =
getPref ($data_dir, $username, 'email_address');
$HowItLooks = $fn . ' ';
if ($em != '')
$HowItLooks .= '<' . $em . '>';
}
echo "<p>";
echo
_ ("Sending this spam report will give you back a reply with URLs that you can click on to properly report this spam message to the proper authorities. This is a free service. By pressing the \"Send Spam Report\" button, you agree to follow SpamCop's rules/terms of service/etc.");
echo "</p>";
?>
<table align="center" width="75%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top">
<?php if (isset($js_web) && $js_web) {
echo "<form method=\"post\" action=\"javascript:return false\">\n";
echo
'<input type="button" value="' .
_ ("Close Window") .
"\" onClick=\"window.close(); return true;\" />\n";
} else {
?><form method="post" action="
<?php echo
sqm_baseuri (); ?>src/right_main.php">
<?php
echo
'<input type="submit" value="' .
_ ("Cancel / Done") .
"\" />\n";
}
?></form>
</td>
<td align="right" valign="top">
<?php if ($spamcop_method == 'thorough_email' ||
$spamcop_method == 'quick_email') {
if ($spamcop_method == 'thorough_email')
$report_email = 'submit.' . $spamcop_id . '@spam.spamcop.net';
else
$report_email = 'quick.' . $spamcop_id . '@spam.spamcop.net';
?> <form method="post" action="<?php echo $form_action?>">
<input type="hidden" name="subject" value="reply anyway" />
<input type="hidden" name="identity" value="0" />
<input type="hidden" name="session" value="<?php echo $session?>" />
<?php
echo
'<input type="submit" name="send" value="' .
_ ("Send Spam Report") .
"\" />\n";
} else {
$spam_message =
mime_fetch_body ($imap_stream, $passed_id, $passed_ent_id, 50000);
if (strlen ($spam_message) ==
50000) {
$Warning = "\n[truncated by SpamCop]\n";
$spam_message =
substr ($spam_message, 0, 50000 -
strlen ($Warning)) .
$Warning;
}
if (isset($js_web) && $js_web) {
?> <form method="post" action="http://members.spamcop.net/sc" name="submitspam"
enctype="multipart/form-data"><?php
} else {
?> <form method="post" action="http://members.spamcop.net/sc" name="submitspam"
enctype="multipart/form-data" target="_top"><?php
} ?>
<input type="hidden" name="action" value="submit" />
<input type="hidden" name="oldverbose" value="1" />
<?php
echo
'<input type="submit" name="x1" value="' .
_ ("Send Spam Report") .
"\" />";
}
?>
</form>
</td></tr>
</table>
</body></html>