[Tutor] error trap

kirk Bailey idiot1@netzero.net
Fri, 18 Jan 2002 03:03:32 -0500


ok, built a pretty blunt weapon to handle errors.

IN TLpost.py;
for to_addr in members :                # for each address in
'listnamemembers',
        # print "to_addr: ", to_addr
        # print "from_addr: ", from_addr
        # print "msg=" + CRLF, msg
        try:
                server.sendmail(from_addr, to_addr, msg)        # 400
send envlope and msg!
        except:
                print "Bad address='"+to_addr+"'"

# don't delete the above line!
server.quit()                           # then close the connection.

Testing with a known bad address in the list, it comes up with an
error print, and finishes the job.

Now, I could set this up as a send operation to the postmaster, or
delete the address from the file automatically, whatever. I tend to
favor human intervention when there is a problem, rather than trust to
a server to do important things such as erase member data. Comments?


-- 
 

 -Respectfully,
              -Kirk D Bailey 
               Consulting Loose Cannon

end



  www.howlermonkey.net                 highprimate@howlermonkey.net
  www.sacredelectron.org                         idiot1@netzero.net
  www.tinylist.org                              grumpy@tinylist.org
----------------------------------------------------
Sign Up for NetZero Platinum Today
Only $9.95 per month!
http://my.netzero.net/s/signup?r=platinum&refcd=PT97