diff -r 720455407d1c lib/galaxy/util/__init__.py --- a/lib/galaxy/util/__init__.py Thu Jun 23 11:03:45 2011 -0400 +++ b/lib/galaxy/util/__init__.py Mon Aug 15 14:44:33 2011 +0200 @@ -542,17 +542,26 @@ def nice_size(size): return '??? bytes' def send_mail( frm, to, subject, body, config ): """ Sends an email. """ msg = MIMEText( body ) msg[ 'To' ] = to - msg[ 'From' ] = frm + + log.warning( '1config-from: %s' % config.smtp_from ) + log.warning( '1FROM: %s' % frm ) + log.warning( 'body: %s' % body ) + if config.smtp_from is None: + msg[ 'From' ] = frm + smtp_frm = frm + else: + msg[ 'From' ] = config.smtp_from + smtp_frm = config.smtp_from msg[ 'Subject' ] = subject if config.smtp_server is None: log.error( "Mail is not configured for this Galaxy instance." ) log.info( msg ) return s = smtplib.SMTP() s.connect( config.smtp_server ) try: @@ -578,17 +587,17 @@ def send_mail( frm, to, subject, body, c s.close() raise except smtplib.SMTPError, e: log.error( "No suitable authentication method was found: %s" % e ) s.close() raise if isinstance( to, basestring ): to = [ to ] - s.sendmail( frm, to, msg.as_string() ) + s.sendmail( smtp_frm, to, msg.as_string() ) s.quit() galaxy_root_path = os.path.join(__path__[0], "..","..","..") # The dbnames list is used in edit attributes and the upload tool dbnames = read_dbnames( os.path.join( galaxy_root_path, "tool-data", "shared", "ucsc", "builds.txt" ) ) ucsc_build_sites = read_build_sites( os.path.join( galaxy_root_path, "tool-data", "shared", "ucsc", "ucsc_build_sites.txt" ) ) gbrowse_build_sites = read_build_sites( os.path.join( galaxy_root_path, "tool-data", "shared", "gbrowse", "gbrowse_build_sites.txt" ) ) genetrack_sites = read_build_sites( os.path.join( galaxy_root_path, "tool-data", "shared", "genetrack", "genetrack_sites.txt" ), check_builds=False )