Fixing Mail::ClamAV to work with >= clamav-0.98.4

The latest version of clamav relies on OpenSSL, but libclamav doesn’t automatically intialize that connection. This patch we threw together for Mail-ClamAV-0.29 fixes the problem by calling cl_initialize_crypto() first.

*** ClamAV.pm.orig      2014-10-28 16:27:30.000000000 -0500
--- ClamAV.pm   2014-10-28 16:26:48.000000000 -0500
***************
*** 205,210 ****
--- 205,215 ----
      if (stat(path, &st) != 0)
          croak("%s does not exist: %s\n", path, strerror(errno));
  
+     if ((status = cl_initialize_crypto()) != CL_SUCCESS) { 
+        error(status);
+        return &PL_sv_undef; 
+     } 
+ 
      if ((status = cl_init(CL_INIT_DEFAULT)) != CL_SUCCESS) {
          error(status);
          return &PL_sv_undef;

 

Leave a Reply

Your email address will not be published. Required fields are marked *