Solved

MAPI SignOn failure in Server 2003 for Small Business

Posted on 2007-11-26
21
974 Views
Last Modified: 2013-12-25
I have a well-used (prox 300 clients) VB6 app that receives and sends emails for many purposes.  For several years, it's successfully used the MAPI system for this purpose.  Suddenly, I have a client using Windows Server for Small Business 2003 (SP2), and on his there's a problem I've been unable to resolve.  

Specifically, the MAPISession.SignOn method immediately produces an error 32002 (unspecified failure has occurred).  He's using Outlook Express as the email client (yes, it's set as the Windows default email program, and yes, it works perfectly when accessed directly).  MSMapi32.OCX is correctly installed and registered in his Windows/System32 folder.  It's Ver 6.0.81.69, dated June 24, 1998, and yes, I've tried unregistering and re-registering it.  I've also tried all possible parameters on settings for the few properties that exist for the MAPISession control, and varying sequences of implementation.  All sorts of variations work just fine in every other machine I test, but not in this one.  

If you want a code sample, it can be as simple as:

         MAPISession1.SignOn

or as complex as:

        With MAPISession1
             .NewSession = True
            .UserName = "xxxxxx"
            .Password = "xxxxxx"
            .DownLoadMail = False
            .LogonUI = False
            .SignOn
        End With

Or, the code could be any of many other variations.  Regardless, as the SignOn method is invoked, the error triggers immediately.  A solution to this will be greatly appreciated.  
0
Comment
Question by:gladeross
  • 11
  • 7
  • 3
21 Comments
 
LVL 49

Expert Comment

by:DanRollins
ID: 20372557
I'm out of my field, but was asked to look in on this.  

We know that it is machine specific, so I suggest examining all of the software services running on the machine.  For instance, I can easily imagine some anti-virus tool having been set to "total paranoia" intercepting (and aborting) a non-user-originated mail session.
0
 

Author Comment

by:gladeross
ID: 20374088
Sorry, I should have mentioned that I already checked for that.  The machine has AVG installed, but the problem persists even when it's not running.  
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 20377271
You could re-verify that Mapi is configured with the right default email app.  In addition to checking the
   Tools>Internet Options>Progams
settings, try clicking a "mailto:" URL or entering
   mailto:
as the command in Start/Run (Start menu item)

BTW, you are not alone with this problem.  This google search turned up lots of people with a similar problem.  
    http://www.google.com/search?hl=en&q=MAPISession+SignOn+32002

One that specificially mentions SBS 2003 indicates that security restrictions might be a key issue.
0
 

Author Comment

by:gladeross
ID: 20378209
Dan, I like your suggestion.  I previously had double and triple verified that OE was set as the default email client, both by checking in the Internet Properties control, and by going directly to the underlying registry setting.  However, your suggestion offers operative proof of whether Windows truly recognizes the matter, and if it's prepared to behave accordingly.  I like that a lot.  I didn't know you could initiate an email in that manner.  Thanks for the knowledge.  My client is not presently accessible to try this test, but should be in the morning.  I'll let you know what we find.  
0
 
LVL 74

Expert Comment

by:Jeffrey Kane - TechSoEasy
ID: 20379513
have you ever installed this app on a server that has Exchange Server installed as well?  Because SBS has Exchange as part of it's components.

Jeff
TechSoEasy
0
 

Author Comment

by:gladeross
ID: 20384183
Responding to DanRollins:

We did the Start/Run/mailto:xxxx test.  Dang!  It worked perfectly (i.e., brought up a compose email window in OE).  Just to be sure no underlying circumstances had changed in the interim, we re-tested within my app, and the symptom there was unchanged.  

Responding to TechSoEasy:

No, this server does not have Exchange installed.  When you mention "SBS," I'm unaware of what the acronym refers to.  Is it (perhaps) Small Business Server?  
0
 
LVL 74

Expert Comment

by:Jeffrey Kane - TechSoEasy
ID: 20384720
Yes, SBS = Small Business Server.  

And if Exchange isn't installed, then either he has a very specialized product "Windows Server for Small Business Server (WSfSBS)" or he has an incomplete SBS installation.  My guess would be the latter, since WSfSBS is rarely used except for some specific applications.

So, if it's a regular SBS and Exchange isn't installed, you'll have problems with MAPI because Exchange is integral to SBS and MUST be installed for it to operate properly.  If it isn't going to be used, then Exchange can be disabled, but shouldn't be uninstalled.

Jeff
TechSoEasy
0
 

Author Comment

by:gladeross
ID: 20385377
Responding to TechSoEasy:

My apology.  I misinformed you.  In telling you that Exchange was not installed on this machine, I was going by what the client told me.  I just talked with his IT guy, however, and he told me Exchange is indeed installed, but disabled (and the operating system is, indeed, SBS).  

Any other ideas?  
0
 
LVL 74

Expert Comment

by:Jeffrey Kane - TechSoEasy
ID: 20386375
So... here's the dilema... I stated above that if Exchange wasn't going to be used, then it should be disabled.  However, that doesn't take into account your situation of trying to get MAPI to trigger.

So, what is the version showing for your MAPI32.dll?

And is that compatible with your MSMAPI32.OCX?

Jeff
TechSoEasy
0
 

Author Comment

by:gladeross
ID: 20403372
I'm sorry.  I was away from this for a little while.  Can you tell me where we'd find MAPI32.dll?  That one's not a file that I'm familiar with.  
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:gladeross
ID: 20408252
I found it.  It's in the c:\windows\system32 folder.  It's Ver 6.5.7226.0.  Does this help?  
0
 
LVL 74

Expert Comment

by:Jeffrey Kane - TechSoEasy
ID: 20408346
Sure it helps... because I bet if you compare that to any other server you've installed this code on it won't be the same version.  That's because 6.5.7226.0 is EXCHANGE SP1's MAPI.

Honestly, I'm not knowledgeable enough in this area to tell you how to fix it at this point... but I'm fairly certain that's where your problem is.  Even though you've designated OE as your default mail program, it's not going to be the same MAPI engine that you'd expect.

There's more info about all this here;  http://support.microsoft.com/kb/288836

Jeff
TechSoEasy

0
 

Author Comment

by:gladeross
ID: 20416321
Thank you the answer and link.  I did two things in response:

1.  I replaced Exchange's MAPI32.dll with one as found in one of my XP machines.  Didn't make a difference.  I then tried replacing other MAPI-related files on the subject machine with ones from one of my XPs, including MapiStub.dll, MapiSvc.dll, MsMapi32.dep, MsMapi32.oca and sfmapi.dll (shots in the dark, I know).  None of it made any difference.  

2.  Based on your link to the Microsoft article, I went from one article to another until I found this:

http://www.microsoft.com/downloads/details.aspx?FamilyID=E17E7F31-079A-43A9-BFF2-0A110307611E&displaylang=en

As you'll see, this article appears to be precisely on point (particularly because I verified that cdo.dll is not present on the subject machine).  However, the download that if offers suffers a problem from our perspective in that it won't work if Exchange has been installed (the documentation says so, and I proved it by trying).  The article references an alternate download, but that one won't work if Outlook has not been installed (it hasn't, and the client does not intend to do so), which puts us in a Catch 22.  

I've provided the client's IT guy with a reference to the article, and asked him to see if he can find a workaround (perhaps, for example, by uninstalling Exchange, running the download, then reinstalling again if needed).  I'll report back on what develops, but wanted to keep you informed in the interim.  
0
 
LVL 74

Expert Comment

by:Jeffrey Kane - TechSoEasy
ID: 20416808
You can't just replace the dlls without registering them.


If they aren't going to use Exchange anyhow... why don't you just install Outlook 2003 on the server and let its MAPI do the work.  Outlook licenses are included with SBS CALs so there's no problem with licensing.  There may already be an installation point copy of it on the server at C:\ClientApps\Outlook2003

Jeff
TechSoEasy
0
 

Author Comment

by:gladeross
ID: 20421265
I wondered if registering made any difference when replacing such files.  I thought not, reasoning that if the filename is the same, the old registration would not know the difference.  But, on the basis of your comment, I take it that registration must account (as well) for the particular version number involved.  Is that correct?  

In regard to installing Outlook, I'm hoping to hear back from the client's IT guy soon.  
0
 

Author Comment

by:gladeross
ID: 20424573
No luck with the IT guy's work.  He installed Outlook.  He uninstalled Exchange and ran the download from Microsoft, reinstalled Exchange, etc.  We're still struggling.  
0
 
LVL 74

Expert Comment

by:Jeffrey Kane - TechSoEasy
ID: 20431123
Have you seen this?
http://www.freevbcode.com/ShowCode.Asp?ID=109

Jeff
TechSoEasy
0
 

Author Comment

by:gladeross
ID: 20431838
It looks like a fascinating solution.  Basically, it offers a way to completey bypass MAPI.  On the one hand, I like the concept -- but, and on the other hand, if setup of all the email protocols, and so on (SMTP server, POP3 server) was not independently handled outside my app (by Outlook, Outlook Express, etc.) I'd have to handle it internally.  That's not attractive.  Thank you for the suggestion.  I'll hang onto it, but I don't believe I'm ready to go that direction just yet.  
0
 
LVL 74

Accepted Solution

by:
Jeffrey Kane - TechSoEasy earned 250 total points
ID: 20432922
I think you don't quite understand how email works... Outlook/OE do not handle your email for you, they aren't servers, they are clients.  They happen to have a MAPI engine that can interface with a server, but it's your code that's doing most of the work, and the .dll file it's calling up from Outlook/OE's installation that's processing it.  All this does is provide an alternate .dll (vbSendMail.dll) instead of mapi32.dll.

Jeff
TechSoEasy

0
 
LVL 49

Assisted Solution

by:DanRollins
DanRollins earned 250 total points
ID: 20435471
Actually, use of the MAPI functions allows the caller to employ the settings that the user has already made (i.e., the account settings in Outlook) which include the name of the SMTP server and any login credentials required.  Using vbSendmail (or other similar software) would require input of that information for each client, while sticking with MAPI allows the software to assume that the default account setings can be used.

-- Dan
0
 

Author Comment

by:gladeross
ID: 20537723
I appreciate all those who worked on this problem.  Ultimately, the client's IT guy opened a Microsoft service ticket.  I'm not sure if it was via that guidance or otherwise, but at any rate he eventually wiped the drive and reinstalled SBS 2003.  As part of the re-do, there was some issue (I'm getting this second-hand from the client, so the details are a bit vague and likley confused too) about space as allocated for updates (or something of the nature).  Apparently, the box had been purchased from Best Buy, and they'd allocated a very "tiny" space for the purpose.  As part of the reinstall, a more generous space was allocated.  Whether it was that, or just the reinstall by itself, is not clear, but (and regardless) the problem was solved.  

Thanks again.  
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This is about my first experience with programming Arduino.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now