X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=plugins%2Fspamcop%2Ffunctions.php;h=f133484d9c3e13edf15d47472cc78c44d2bd5a37;hb=8eeb846943970372b10d7721dd234fb31e29a93c;hp=6eb9a6c2e80552a01f49998609e8b149dbe45b60;hpb=d4e46166df04792c6b939356ea5dfda8e47bba7b;p=squirrelmail.git diff --git a/plugins/spamcop/functions.php b/plugins/spamcop/functions.php index 6eb9a6c2..f133484d 100644 --- a/plugins/spamcop/functions.php +++ b/plugins/spamcop/functions.php @@ -3,7 +3,7 @@ /** * SpamCop plugin - functions * - * @copyright © 1999-2009 The SquirrelMail Project Team + * @copyright 1999-2012 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package plugins @@ -180,6 +180,8 @@ function spamcop_enable_disable($option,$disable_action,$enable_action) { */ function spamcop_getMessage_RFC822_Attachment($message, $composeMessage, $passed_id, $passed_ent_id='', $imapConnection) { + + global $username, $attachment_dir; if (!$passed_ent_id) { $body_a = sqimap_run_command($imapConnection, @@ -197,11 +199,14 @@ function spamcop_getMessage_RFC822_Attachment($message, $composeMessage, $passed $body = implode('', $body_a) . "\r\n"; $filename = sq_get_attach_tempfile(); - $fp = fopen($filename, 'wb'); + $hashed_attachment_dir = getHashedDir($username, $attachment_dir); + + $fp = fopen("$hashed_attachment_dir/$filename", 'wb'); fwrite ($fp, $body); fclose($fp); $composeMessage->initAttachment('message/rfc822','email.txt', $filename); } + return $composeMessage; }