[Pythonmac-SIG] PythonCGISlave conflict with SMTPlib? (MacOS 9, Pers. Web Sharing)

Samuel Smith smith@oe.fau.edu
Mon, 21 Aug 2000 09:32:26 -0400


I have the same problem when the email server is the same as the web 
server but it works fine if I route  the email thru my isp's server 
and then back to the email server running on the same machine as my 
web server.

I use eims 3.0 and personal web sharing 1.5 ox9.04



>Dear Python Gurus -
>
>I've been lurking on the list for several months while learning python
>and building up some hobby-scale code.  I was very happy when the
>PythonCGIslave came out, and I've been successfully running CGI applets
>under MacOS 9 and Personal Web Sharing.  I want to say up front that
>working with Python has been a lot more fun than any other programming
>I've done (I'm a physicist by trade and do a fair amount of software
>work for my job), but I've run into a problem that has got me stumped.
>
>I had the idea that it would be nice to upgrade the exception
>handler in my CGI so that it would email me some kind of notification
>whenever a user ran into a bug in the CGI (in addition to logging any
>exceptions (bugs) to the errors file).  This would be nice because
>(a) I want to fix any bugs promptly, but (b) I don't want to have to
>check on the errors file all the time.  I'd used the smtplib calls
>frequently in some of my other code, but when I tried to use them
>from within the CGI applet, it caused the CGI to freeze up whenever
>it tries to send the email.  I had to go and force-quit the CGI.
>The CGI works just fine when I comment out the SMTP calls (which go
>to an smtp server on the same machine as the web server).
>I've tried putting the smtplib calling code in an exception handler
>inside my CGI, putting it in the body of the CGI, putting it
>in the exception handler inside PythonCGIslave, and (as a test)
>putting it in the main code of the PythonCGIslave cgihandler, and even
>putting it in the __init__ function of the PythonCGIslave class,
>but the CGI applet still crashes every time.
>
>Does anyone have any ideas how I can get past this problem?
>Is there something about the way the web server calls the cgi applet
>that prevents the SMTP lib calls from working?
>
>The only thing I can think of is to write a separate "monitor"
>applet that just watches the CGI's .errors file and emails me
>the contents whenever something is written to the file, but that
>is an ugly solution.  I'd really like to have the email call
>inside the CGI code, and if possible I'd like to solve the problem
>in a platform-independent way.
>
>Thanks in advance for everyone's wisdom.  I hope to be able to
>contribute back to the list as I get more up to speed, but for now
>it looks like I'm mainly a consumer of advice rather than a producer. :)
>
>-- Bob Heeter
>
>Bob Heeter
>Livermore, California
>
>_______________________________________________
>Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
>http://www.python.org/mailman/listinfo/pythonmac-sig

-- 
**********************************

Samuel M. Smith Ph.D.
Professor
Director Advanced Marine Systems Lab


**************(Dania SeaTech Building)***********************

Institute for Ocean and Systems Engineering
Florida Atlantic University
Rm. 225 B, SeaTech Bldg.
101 North Beach Road,  Dania, FL 33004

(voice) 954-924-7232
(secretary Paula) 954-924-7230
(fax) 954-924-7233
(mobile) 561-251-2114
(email) smith@oe.fau.edu
(web) http://www.oe.fau.edu