/**
* SpamCop plugin - functions
*
- * @copyright 1999-2009 The SquirrelMail Project Team
+ * @copyright 1999-2020 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @package plugins
*/
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)
*/
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,
$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;
}