{"id":150,"date":"2014-10-28T21:45:25","date_gmt":"2014-10-28T21:45:25","guid":{"rendered":"https:\/\/www.hort.net\/techblog\/?p=150"},"modified":"2015-02-03T22:54:50","modified_gmt":"2015-02-03T22:54:50","slug":"fixing-mailclamav-to-work-with-clamav-0-98-4","status":"publish","type":"post","link":"https:\/\/www.hort.net\/techblog\/2014\/10\/28\/fixing-mailclamav-to-work-with-clamav-0-98-4\/","title":{"rendered":"Fixing Mail::ClamAV to work with >= clamav-0.98.4"},"content":{"rendered":"<div class=\"share_buttons_simple_use_buttons\" style=\"padding: 10px 0; display: inline-block\"><div class=\"tweet_button\" style=\"float: left; vertical-align: top\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"https:\/\/www.hort.net\/techblog\/2014\/10\/28\/fixing-mailclamav-to-work-with-clamav-0-98-4\/\" data-text=\"Fixing Mail::ClamAV to work with >= clamav-0.98.4\" data-count=\"none\">Tweet<\/a><script type=\"text\/javascript\" src=\"https:\/\/platform.twitter.com\/widgets.js\"><\/script><\/div><div class=\"facebook_like_button\" style=\"float: left; vertical-align: top; margin-left: 10px; max-width: 255px\"><iframe src=\"https:\/\/www.facebook.com\/plugins\/like.php?href=https%3A%2F%2Fwww.hort.net%2Ftechblog%2F2014%2F10%2F28%2Ffixing-mailclamav-to-work-with-clamav-0-98-4%2F&amp;layout=button_count&amp;show_faces=false&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=25\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:450px; height:25px;\" allowTransparency=\"true\"><\/iframe><\/div><\/div><p>The latest version of clamav relies on OpenSSL, but libclamav doesn&#8217;t automatically intialize that connection.  This patch we threw together for Mail-ClamAV-0.29 fixes the problem by calling cl_initialize_crypto() first.  <\/p>\n<div class=\"horttech-code\"><pre class=\"preserve-code-formatting\">\n*** ClamAV.pm.orig&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2014-10-28 16:27:30.000000000 -0500\n--- ClamAV.pm&nbsp;&nbsp; 2014-10-28 16:26:48.000000000 -0500\n***************\n*** 205,210 ****\n--- 205,215 ----\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (stat(path, &amp;st) != 0)\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;croak(&quot;%s does not exist: %s\\n&quot;, path, strerror(errno));\n&nbsp;&nbsp;\n+&nbsp;&nbsp;&nbsp;&nbsp; if ((status = cl_initialize_crypto()) != CL_SUCCESS) { \n+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;error(status);\n+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return &amp;PL_sv_undef; \n+&nbsp;&nbsp;&nbsp;&nbsp; } \n+ \n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ((status = cl_init(CL_INIT_DEFAULT)) != CL_SUCCESS) {\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;error(status);\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return &amp;PL_sv_undef;\n<\/pre><\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"share_buttons_simple_use_buttons\" style=\"padding: 10px 0; display: inline-block\"><div class=\"tweet_button\" style=\"float: left; vertical-align: top\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"https:\/\/www.hort.net\/techblog\/2014\/10\/28\/fixing-mailclamav-to-work-with-clamav-0-98-4\/\" data-text=\"Fixing Mail::ClamAV to work with >= clamav-0.98.4\" data-count=\"none\">Tweet<\/a><script type=\"text\/javascript\" src=\"https:\/\/platform.twitter.com\/widgets.js\"><\/script><\/div><div class=\"facebook_like_button\" style=\"float: left; vertical-align: top; margin-left: 10px; max-width: 255px\"><iframe src=\"https:\/\/www.facebook.com\/plugins\/like.php?href=https%3A%2F%2Fwww.hort.net%2Ftechblog%2F2014%2F10%2F28%2Ffixing-mailclamav-to-work-with-clamav-0-98-4%2F&amp;layout=button_count&amp;show_faces=false&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=25\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:450px; height:25px;\" allowTransparency=\"true\"><\/iframe><\/div><\/div><p>TweetThe latest version of clamav relies on OpenSSL, but libclamav doesn&#8217;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&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2014-10-28 16:27:30.000000000 -0500 &#8212; ClamAV.pm&nbsp;&nbsp; 2014-10-28 16:26:48.000000000 -0500 *************** *** 205,210 **** &#8212; 205,215 &#8212;- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (stat(path, &amp;st) != 0) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;croak(&quot;%s does not exist: %s\\n&quot;, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[9,10,8],"class_list":["post-150","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-clamav","tag-mailclamav","tag-perl"],"_links":{"self":[{"href":"https:\/\/www.hort.net\/techblog\/wp-json\/wp\/v2\/posts\/150","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hort.net\/techblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hort.net\/techblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hort.net\/techblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hort.net\/techblog\/wp-json\/wp\/v2\/comments?post=150"}],"version-history":[{"count":4,"href":"https:\/\/www.hort.net\/techblog\/wp-json\/wp\/v2\/posts\/150\/revisions"}],"predecessor-version":[{"id":208,"href":"https:\/\/www.hort.net\/techblog\/wp-json\/wp\/v2\/posts\/150\/revisions\/208"}],"wp:attachment":[{"href":"https:\/\/www.hort.net\/techblog\/wp-json\/wp\/v2\/media?parent=150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hort.net\/techblog\/wp-json\/wp\/v2\/categories?post=150"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hort.net\/techblog\/wp-json\/wp\/v2\/tags?post=150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}