MAPI logon Failure? Why now?

  • Hello,

    SQL 7 w/SP2; NT4; Outlook

    I have a job set to email results each day. It has been working fine until this weekend. We had a power disruption and the database servers were rebooted. Now my jobs which send email are failing. SQL Agent is running. And the domain account MAPI/exchange user is selected.

    When I do a xp_sendmail test from Query Analyzer, I receive the following:

    Server: Msg 17903, Level 18, State 1, Line 0

    MAPI login failure.

    When I view the job history I see the following:

    The job failed.  The Job was invoked by User xxx\Administrator.  The last step to run was step 1 (SEND_EMAIL).

    I can open the outlook client locally on the db server and send email with no problems. Anybody every come across this?

    Many thanks. Jeff

  • When you log on to the SQL Server manually, are you logging on with the SQL Server service account? If not try this and then try sending an email. Also get your Exchange admin to check the permissions on the mailbox that SQL is using.



    Shamless self promotion - read my blog http://sirsql.net

  • You definitely need to troubleshoot MAPI problems by being logged on using the SQL Server service account.  Anything else is normally a waste of time.

    As to the question 'Why now?', such is life.  The mail interface in SQL7 & SQL2000 is not the most reliable bit of software released by Microsoft, and questions about it are frequently seen in a number of forums.  Many shops, including mine, have experienced similar problems to you.  Mostly they are fixed simply by manually starting Outlook using the SQL Server service account.  The worst one we had needed a NT re-install !! before we could get mail working again.

    The good news is that Microsoft have released a fix for all this problems, but it is still in Beta, and codenamed Yukon.

    Original author: https://github.com/SQL-FineBuild/Common/wiki/ 1-click install and best practice configuration of SQL Server 2019, 2017 2016, 2014, 2012, 2008 R2, 2008 and 2005.

    When I give food to the poor they call me a saint. When I ask why they are poor they call me a communist - Archbishop Hélder Câmara

  • We've also had a lot of problems where mail would suddenly stop working.  Generally, we would use xp_stopmail and then xp_startmail.  Then magically (when talking about SQL mail that word comes into play a lot) things would work again for a period of time - 2 weeks, 6 months who can say. Couldn't hurt to try.

  • xp_Stopmail is fine to do on the command line, but beware of including it in an application.

    One of our developers thought it would be 'safer' to wrap a xp_sendmail within xp_startmail and xp_stopmail.  He had forgotten some things...

    1) Multiple instances of his application could run at the same time

    2) xp_startmail runs cleanly even if mail is already started

    3) xp_stopmail gives an error if mail is already stopped when it runs

    So the inevitable happened.  Two instances of the application ran at the same time, but the xp_stopmail statements were serialised.  The second one gave an error and killed the application instance.  Result - the application was changed to remove the xp_startmail and xp_stopmail.

     

    Original author: https://github.com/SQL-FineBuild/Common/wiki/ 1-click install and best practice configuration of SQL Server 2019, 2017 2016, 2014, 2012, 2008 R2, 2008 and 2005.

    When I give food to the poor they call me a saint. When I ask why they are poor they call me a communist - Archbishop Hélder Câmara

  • Thanks all for the advice/suggestions.

    I tried everything, but eventually got it resolved using a similar method as Rita's reply. Using Enterprise Manager (EM), I stopped and re-started SQL Mail. Everything is working now. This has worked/been tested twice now (we experienced another(!) power disruption last night). It would be nice to receive a fix for this in MSSQL 2000, rather than wait for Yukon. Summary:

    EM -> Support Services -> SQL Mail (right click stop/start).

    Many thanks. Jeff

  • Is this with sp3a?



    Shamless self promotion - read my blog http://sirsql.net

  • EM tool: MSSQL 2000 w/SP3

    Many thanks. Jeff

  • There was a patch between sp2 and sp3a that had a copy of the sqlmap70.dll in it. We had the same problem at my last place, when we replaced the sp3a version with this version the problem went away...I just can't find the version number here so that you could try to match them up.



    Shamless self promotion - read my blog http://sirsql.net

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply