McAfee virus and Outlook.

R

rajesh

McAfee virus scanner flags even rudimentary Outlook code as a virus and many Outlook based apps are being removed by customers at their sites.
I investigated and found the following in one application:

set Application = CreateObject("Outlook.Application") <- Worm
set Namespace = Application.GetNamespace("MAPI") <- flagged as worm because of call to GetNamespace

Namespace.Logon
Set oItem = Application.CreateItem(0) <- Flagged as worm because of call to CreateItem

I tried CallByName but that did not work. Also, I tried to use IDispatch but it is called a "protected" function and would not let me call from the VB IDE.

I have already spent 1 full day trying to find out who in McAfee is responsible and they were not responsive.

Did MS put in flags for virus checkers to use ? Is there a solution ?
 
K

Ken Slovak - [MVP - Outlook]

McAfee allows you to mark applications as trusted, then there's no problem.
Norton's script stopper on the other hand doesn't allow you to mark anything
as trusted so you're completely screwed with Norton unless they test and
mark the code as safe and include it in an update of signatures in
LiveUpdate. Don't hold your breath waiting for that though.

There are a number of things you can do to avoid many of the problems. In a
COM addin's On_Connection event or in Outlook VBA you derive all Outlook
objects from the intrinsic VBA Application object or On_Connection's passed
in Application object. You should never have to use NameSpace.Logon, BTW.
You can always use Items.Add instead of CreateItem. You can access NameSpace
if it remains a problem even with a trusted Application object by using
Application.Session.

In an Outlook COM addin's property page (OCX) you can use the Application
property of the PropertyPageSite object to avoid using CreateObject.




rajesh said:
McAfee virus scanner flags even rudimentary Outlook code as a virus and
many Outlook based apps are being removed by customers at their sites.
I investigated and found the following in one application:

set Application = CreateObject("Outlook.Application") <- Worm
set Namespace = Application.GetNamespace("MAPI") <- flagged as worm
because of call to GetNamespace
Namespace.Logon
Set oItem = Application.CreateItem(0) <- Flagged as worm because of call to CreateItem

I tried CallByName but that did not work. Also, I tried to use IDispatch
but it is called a "protected" function and would not let me call from the
VB IDE.
I have already spent 1 full day trying to find out who in McAfee is
responsible and they were not responsive.
 
K

Ken Slovak - [MVP - Outlook]

I don't use McAfee so I'm not positive, but I believe it has to be done on
the client so each user would have to "trust" that code after it was
installed.

What are the applications? If not COM addins or Outlook VBA code (running
in-process with Outlook) then using CreateObject would be needed (or
GetObject if Outlook was already running, but GetObject is also a problem).

I'm not sure what you mean by "dereference a VB object and vice versa" but
in VB to dereference an object you set it equal to Nothing.




rajesh said:
Ken,
Can an application be marked trusted before being deployed. Or is it
asking for too much ? I really don't want to go through 200 machines,
marking 5 apps trusted on each one of them.
Also, these applications are not addins. So the calls are probably required ?

Also, is there a way to dereference a VB object and vice versa so that
some calls can be made using a C/C++ DLL ?
 
R

rajesh

Hi Ken,
The minimal application I have is right out of Dmitry's Outlook Redemption example.
set Application = CreateObject("Outlook.Application")
set Namespace = Application.GetNamespace("MAPI")
Namespace.Logon

dim SafeItem, oItem
set SafeItem = CreateObject("Redemption.SafeMailItem") 'Create an instance of Redemption.SafeMailItem
set oItem = Application.CreateItem(0) 'Create a new message
SafeItem.Item = oItem 'set Item property XXX I need to get hold of oItem

' Now I need to wave my hands since the stuff below is just a simplification
' of what needs to be done.
SafeItem.Recipients.Add "(e-mail address removed)"
SafeItem.Recipients.ResolveAll
SafeItem.Subject = "Testing Redemption"
SafeItem.Send

How do I return a COM object to VB as an object ? Or is it just not the right way to do things ? I will be probably creating C++ implementations of each of the VB functions but I need to make sure that the COM object does not get yanked out.

Thanks
-- Rajesh
 
K

Ken Slovak - [MVP - Outlook]

I'm not sure what you are asking.

If you are running the application as a standalone application then you will
have to use CreateObject to get any COM object that has to be created.
Although you can use the Items.Add method to add an item to a folder to
avoid CreateItem there's no way around using CreateObject for the other
things. So if the user is going to run McAfee's script stopper they will
have to manually trust your application to prevent problems. As I mentioned
there's no way to trust applications for users who are using Norton's script
stopper so those users are going to be a major problem.




rajesh said:
Hi Ken,
The minimal application I have is right out of Dmitry's Outlook Redemption example.
set Application = CreateObject("Outlook.Application")
set Namespace = Application.GetNamespace("MAPI")
Namespace.Logon

dim SafeItem, oItem
set SafeItem = CreateObject("Redemption.SafeMailItem") 'Create an instance of Redemption.SafeMailItem
set oItem = Application.CreateItem(0) 'Create a new message
SafeItem.Item = oItem 'set Item property XXX I need to get hold of oItem

' Now I need to wave my hands since the stuff below is just a simplification
' of what needs to be done.
SafeItem.Recipients.Add "(e-mail address removed)"
SafeItem.Recipients.ResolveAll
SafeItem.Subject = "Testing Redemption"
SafeItem.Send

How do I return a COM object to VB as an object ? Or is it just not the
right way to do things ? I will be probably creating C++ implementations of
each of the VB functions but I need to make sure that the COM object does
not get yanked out.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top