Changeset 606


Ignore:
Timestamp:
Oct 14, 2007 7:57:05 PM (12 years ago)
Author:
jpfasano
Message:

Modified to use gmail smtp server

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/testScripts/nightlyBuild.py

    r605 r606  
    3030#----------------------------------------------------------------------
    3131# Values for sending mail:
    32 #  SMTP_SERVER_NAME: name of smtp server
    33 #  SMTP_USER_NAME: name of authorized user on server
     32#  SMTP_SERVER_NAME: name of smtp server. For gmail server
     33#                 this is smtp.gmail.com
     34#  SMTP_SERVER_PORT: port number of the smtp server. This is typically 25,
     35#                 but for gmail server it is 587.
     36#  SMTP_SSL_SERVER: 0 or 1. If 1 then SMTP uses SSL (sometimes called startltls).
     37#                 For gmail this is 1.
     38#  SMTP_USER_NAME: name of authorized user on server. If using gmail server
     39#                 this is gmail_userid@gmail.com which is coded as
     40#                 'gmail_userid _AT_ gmail _DOT_ com. 
    3441#  SMTP_PASSWORD_FILENAME: name of file containing smtp user's password
    3542#  SENDER_EMAIL_ADDR: email sent by this script will be from this address
     
    4249#----------------------------------------------------------------------
    4350SMTP_SERVER_NAME = 'outgoing.verizon.net'
     51SMTP_SERVER_PORT = 25
     52SMTP_SSL_SERVER = 0
    4453SMTP_USER_NAME = 'jpfasano'
     54
     55#SMTP_SERVER_NAME = 'smtp.gmail.com'
     56#SMTP_SERVER_PORT = 587
     57#SMTP_SSL_SERVER = 1
     58#SMTP_USER_NAME = 'jpfasano _AT_ gmail _DOT_ com'
    4559SMTP_PASSWORD_FILENAME = '/home/jp/bin/smtpPwFile'
     60
    4661SENDER_EMAIL_ADDR='jpfasano _AT_ verizon _DOT_ net'
     62#SENDER_EMAIL_ADDR='jpfasano _AT_ gmail _DOT_ com'
    4763MY_EMAIL_ADDR='jpfasano _AT_ us _DOT_ ibm _DOT_ com'
    4864SEND_MAIL_TO_PROJECT_MANAGER=0
     
    5470#----------------------------------------------------------------------
    5571PROJECTS = ['CoinUtils','DyLP','Clp','SYMPHONY','Vol','Osi','Cgl','Cbc','Ipopt','OS','CppAD']
     72PROJECTS = ['CppAD']
    5673
    5774#----------------------------------------------------------------------
     
    127144  if PROJECT_EMAIL_ADDRS.has_key(project) and SEND_MAIL_TO_PROJECT_MANAGER:
    128145    toAddrs.append(unscrambleEmailAddress(PROJECT_EMAIL_ADDRS[project]))
    129   session = smtplib.SMTP(SMTP_SERVER_NAME)
    130   session.login(SMTP_USER_NAME,smtppass)
     146  session = smtplib.SMTP(SMTP_SERVER_NAME,SMTP_SERVER_PORT)
     147  #session.set_debuglevel(1)
     148  if SMTP_SSL_SERVER==1 :
     149    session.ehlo('x')
     150    session.starttls()
     151    session.ehlo('x')
     152 
     153  session.login(unscrambleEmailAddress(SMTP_USER_NAME),smtppass)
     154
    131155  subject = project + " build problem when running '" + cmd +"'"
    132156  msgWHeader = ("From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n"
     
    135159  msgWHeader += "'" + cmd + "' messages are:\n"
    136160  msgWHeader += cmdMsgs
    137   #session.set_debuglevel(1)
     161
    138162  rc = session.sendmail(sender,toAddrs,msgWHeader)
    139163  if rc!={} :
Note: See TracChangeset for help on using the changeset viewer.