# Closing popup on webserver

**URL:** <https://www.ruby-forum.com/t/closing-popup-on-webserver/171063>\
**Category:** Rails\
**Created:** [June 25, 2009, 11:02pm UTC](https://www.ruby-forum.com/t/closing-popup-on-webserver/171063 "2009-06-25T23:02:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sithadmin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@sithadmin](https://www.ruby-forum.com/u/sithadmin)\
**Post date:** [June 25, 2009, 11:02pm UTC](https://www.ruby-forum.com/t/closing-popup-on-webserver/171063/1 "2009-06-25T23:02:12Z")

</div>

Hello,  
I’ve got an interesting problem… I’m running RoR on Windows Server  
2003 (using Apache though, not IIS) and I have an app that does a test  
to see if the user provided MAPI credentials are valid in MS Exchange.  
If the credentials are good, it works fine. However, if I put false  
credentials, then a confirmation window pops up on the server. This  
makes my app hang and wait for the popup to close (which to the best of  
my knowledge must be done manually). Since the app will be accessed from  
computers other than the server, the user wouldn’t know that there is a  
popup making the app hang. I need to somehow find a workaround for  
this… if anyone can help, it would be greatly appreciated. Here is the  
relevant code:

begin

# CONNECT TO MAPI SESSION

session = WIN32OLE.new(‘Mapi.session’)  
session.logon("#{profile\_name}", “#{profile\_pass}”)  
rescue Exception  
@messege = “Could not connect to #{ip} with profile credentials!”  
pass\_mapi\_session = 0  
else  
pass\_mapi\_session = 1  
end

…and the popup that comes up on the server is:  
“The profile name is not valid. Enter a valid profile name.”  
[OK | Cancel]

and apparently I need to click Cancel twice in order for it to close…

Any and all help is appreciated!!

Thanks,

- Jeff M.

---

<div class="post-metadata">

**Author:** ![sithadmin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@sithadmin](https://www.ruby-forum.com/u/sithadmin)\
**Post date:** [June 27, 2009, 1:51am UTC](https://www.ruby-forum.com/t/closing-popup-on-webserver/171063/2 "2009-06-27T01:51:13Z")

</div>

Just FYI, I finally resolved this issue using an AutoIT script to  
capture and close the popup box.
