From fbb0df9f5436e956c43ace372f625f08628c000f Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Tue, 21 Jul 2009 10:12:37 -0400 Subject: [PATCH] Disable email attachment posting when $config['attachments']['uploads'] = false http://laconi.ca/trac/ticket/1721 --- scripts/maildaemon.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/maildaemon.php b/scripts/maildaemon.php index 3f5402becb..a4003b6b26 100755 --- a/scripts/maildaemon.php +++ b/scripts/maildaemon.php @@ -318,9 +318,12 @@ class MailerDaemon && $parsed->ctype_secondary=='plain') { $msg = $parsed->body; }else if(!empty($parsed->body)){ - $attachment = tmpfile(); - fwrite($attachment, $parsed->body); - $attachments[] = $attachment; + if(common_config('attachments', 'uploads')){ + //only save attachments if uploads are enabled + $attachment = tmpfile(); + fwrite($attachment, $parsed->body); + $attachments[] = $attachment; + } } }