X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=plugins%2Fspamcop%2Ffunctions.php;h=71a351f9fb19f3134ba660f41a8bb123af9c8f5f;hb=c997cbe6f5a46d432d7733acb207dfcdfd00e49e;hp=687a5b6d86503a1b013123f4462b6b48d1513a98;hpb=628bce99c404e37bbebc40555b591ed101400671;p=squirrelmail.git diff --git a/plugins/spamcop/functions.php b/plugins/spamcop/functions.php index 687a5b6d..71a351f9 100644 --- a/plugins/spamcop/functions.php +++ b/plugins/spamcop/functions.php @@ -3,7 +3,7 @@ /** * SpamCop plugin - functions * - * @copyright © 1999-2006 The SquirrelMail Project Team + * @copyright 1999-2021 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id$ * @package plugins @@ -66,7 +66,7 @@ function spamcop_show_link_function(&$links) { return; /* GLOBALS */ - sqgetGlobalVar('passed_id', $passed_id, SQ_FORM); + sqgetGlobalVar('passed_id', $passed_id, SQ_FORM, NULL, SQ_TYPE_BIGINT); sqgetGlobalVar('passed_ent_id',$passed_ent_id,SQ_FORM); sqgetGlobalVar('mailbox', $mailbox, SQ_FORM); if ( sqgetGlobalVar('startMessage', $startMessage, SQ_FORM) ) { @@ -134,12 +134,12 @@ function spamcop_options_function() { */ function spamcop_while_sending_function() { global $mailbox, $spamcop_delete, $spamcop_save, $spamcop_is_composing, $auto_expunge, - $username, $imapServerAddress, $imapPort; + $username, $imapServerAddress, $imapPort, $imap_stream_options; if (sqgetGlobalVar('spamcop_is_composing' , $spamcop_is_composing)) { // delete spam message if ($spamcop_delete) { - $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0); + $imapConnection = sqimap_login($username, false, $imapServerAddress, $imapPort, 0, $imap_stream_options); sqimap_mailbox_select($imapConnection, $mailbox); sqimap_msgs_list_delete($imapConnection, $mailbox, array($spamcop_is_composing)); if ($auto_expunge) @@ -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; }