[horde] clamav hook

Jan Schneider jan at horde.org
Thu Nov 29 11:13:59 UTC 2012


Zitat von Nicolás Valera <nvalera at gmail.com>:

> On 11/28/2012 06:30 PM, Michael M Slusarz wrote:
>> Quoting Nicolás Valera <nvalera at gmail.com>:
>>
>>> (mod_fastcgi.c.2701) FastCGI-stderr: PHP Parse error:  syntax error,
>>> unexpected T_STRING, expecting T_FUNCTION in
>>> /var/www/horde/imp/config/hooks.php
>>
>> Your local hook is not correct.  The PHP syntax is invalid.
>>
>> michael
>>
>> ___________________________________
>> Michael Slusarz [slusarz at horde.org]
>>
>
> Michael, thanks for the answer!
>
> Well, i did a fresh installation and i just uncomment the lines for  
> clam in the hooks.php and then the error I get is the following:
>
> 2012-11-29 07:28:15: (mod_fastcgi.c.2701) FastCGI-stderr: PHP Fatal  
> error:  Only variables can be passed by reference in  
> /var/www/imp/config/hooks.php on line 189
>
> uncommented lines are the following:
>
> -------------------------------------------------------------------------
>         $clamscan = '/usr/bin/clamscan';
>         exec($clamscan . ' --quiet ' . escapeshellarg($tempfile),  
> null, $return_var);

Try this line instead:

exec($clamscan . ' --quiet ' . escapeshellarg($tempfile), $output,  
$return_var);

>         switch ($return_var) {
>         case 1:
>             // Virus found.
>             throw IMP_Compose_Exception::createAndLog('INFO', 'Virus  
> found in uploaded attachment. Attachment will not be added to the  
> compose message.');
>
>         case 2:
>             // Error occurred.
>             Horde::log('Unknown error when scanning message for  
> virus.', 'INFO');
>             break;
>         }
>
>         return $type;
>     }
>
> -------------------------------------------------------------------------
> Regards!


-- 
Jan Schneider
The Horde Project
http://www.horde.org/



More information about the horde mailing list