Search

PrismAV

PrismAV for iMS
Pricing
Sample Code

sample code

DATA/VSCAN Template Code

The virus scanning engine is called immediately prior to the DATA template. All decision making based on the results brought back from the virus scanner can be coded in the DATA template, or the new VSCAN (optional) template.

Example 1
Scan Only

If a virus is detected, take the following actions:

  • delete this file from the system
  • notify the recipient that their email was deleted due to a virus
<cfif av_scanned is "yes" and av_ok is "yes">
   <cfif av_virus is "yes" or av_restricted is "yes">
      <cfif av_virus is "yes">
        <cfset vtext="virus">
      <cfelse>
        <cfset vtext="restricted file">
      </cfif>
  <!--- delete mail file --->
  <cffile action="delete" file="#emailfile#">
  <!--- notify intended recipients --->
  <cfx_imsmail smtpfrom="null@mydomain.com"
    smtpto="#form.rcptlist#" header_to="customer"
    header_from="""admin"" <null@domain.com>"
    header_subject="#vtext# alert"
    body="#smtpfrom# attempted to send you a #vtext#.

    Details: #av_virusname#">
  </cfif>
</cfif>
Example 2
Scan And Repair

The PrismAV engine will attempt to repair infected files and, if that is not possible, it will replace them with a text file describing the problem with the original attachment.

If a virus is detected, take the following actions:

  • notify the recipient that their email was modified due to a virus.
  • If the email contains a restricted type, delete it
<cfif av_altered is "yes" or av_repaired is "yes">
  <cfif av_altered is "yes">
    <cfset vtext="deleted">
    <inlog text="Virus scanner has altered the email">
  <cfelse>
    <cfset vtext="repaired">
    <inlog text="Virus scanner has repaired the email">
  </cfif>
   <!--- notify intended recipients --->
   <cfoutput>
  <insetmsgheader text="An attached virus has been #vtext#.
  Details: #av_virusname#">
   <insethtmlheader text="<font color=red>An attached virus has been #vtext#.</font><p>Details: #av_virusname#<p>">
   </cfoutput>
   </cfif>   
<!--- handle restricted files here --->
</cfif>

Test Virus Code (EICAR)

In order to fully test PrismAV for iMS, you need to present it with a virus. This may pose a problem, as you do not want to introduce a live virus to your system without some guarantee that the virus scanner will actually detect it. The best initial test is to use an industry-standard test file which is non-viral, but which the anti-virus software will react to as if it were a virus. A group of anti-virus researchers developed such a file, the eicar test virus file. You can download this file from www.eicar.org/anti_virus_test_file.htm.

Copyright © 1998-2010 - CoolFusion.com. All rights reserved