def viewAcceptedAddresses(): fpr('Accepted Addresses') print for k in smtp['addrlist']['r_valid']: (e, m) = smtp['addrlist']['r_valid'][k] # unpack tuple fpr(" %-30s | %4s | %s " % (k, e, m)) print #fpr('Total number of addresses: %d' % len([smtp['addrlist']['rcpt_to']]+smtp['addrlist']['rcpts'])) fpr('Total number of addresses: %d' % len(smtp['addrlist']['rcpts'])) fpr('Total number of refused addresses: %d' % len(smtp['addrlist']['r_reject'].keys())) fpr.white('Total number of accepted addresses: %d' % len(smtp['addrlist']['r_valid'].keys()))
def infos(op): if op == 'help': fpr('Building a help and documentation is always the most time consuming task.' \ 'I have written a tool in such a way it should be a self explanatory in ' \ 'most cases. Although one of the goal of using this tool is to learn how ' \ 'an SMTP protocol and email authentication features works, I would like to ' \ 'include additional help for each of the submenu this tool shares.\n' \ 'Let\'s see how this will work.') print fpr('Feedback! I really appreciate all feedbacks, so please feel free to mail me!' ) if op == 'license': fpr(""" ######################################################################### # Copyright (C) %9s Bartosz Kozak # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation, either version 2 of the License, or # # (at your option) any later version. # # # # This program is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU General Public License for more details. # # # # You should have received a copy of the GNU General Public License # # along with this program. If not, see <http://www.gnu.org/licenses/>. # ######################################################################### """ % COPYDATE, adj='c') if op == 'about': fpr.white('minja version: %s written by %s %s' % (VERSION, AUTHOR, MAIL))
def smtp_dha(cpt=1, rate=None, rcpts=[], method='RCPT TO',relays={} ,name='DHA-T-Single',v=False): dhar = dict() from pprint import pprint from core.data import cfgs,smtp,fpr,tc,DEBUG from core.func import dbginfo from core.msg.viewers import viewSmtpConv from core.msg.threads import get_tid dbginfo('DEBUG','name=%s, cpt=%s, method=%s, rate=%s, rcpts=%s' % (name,cpt,method,rate,rcpts) ) #verbnose dhost=smtp['connect']['hosts'][0] try: import sys import smtplib # # log debuglevel output from smtplib # # redirect stderr from smtplib to string # # # # - from smtplib import stderr # if cfgs['conv_logs'] and cl: # ostderr = smtplib.stderr # smtplib.stderr = StderrLogger() # run smtp session if v: fpr.white('Establishing the session ..') s = smtplib.SMTP(dhost['host'],dhost['port']) # if cfgs['conv_logs'] and cl: # s.set_debuglevel('debug') # HELO - introduce yourself if v: fpr.cyan('>>> %s %s' % ('EHLO',dhost['helo'])) (c,m) = s.ehlo(dhost['helo']) #r = s.helo(smtp['connect']['hosts'][0]['helo']) if v: #print (c,m) if 200 <= c <= 299: fpr.green('<<< %s %s' %(c,m)) if s.does_esmtp: fpr.white('ESMTP supported and have extn:') #print s.does_esmtp #print s.esmtp_features for (scmd,sarg) in s.esmtp_features.items(): fpr.white(' * %s %s' % (scmd,sarg)) elif 500 <= c <= 599: fpr.err('<<< %s %s' %(c,m)) # STAARTTLS if 'starttls' in s.esmtp_features.keys(): if dhost['tls_mode'] == 'TLS': if v: fpr.white('TLS supported and requested') fpr.white('Establishing TLS session ..') fpr.cyan('>>> %s' % ('STARTTLS')) (c,m) = s.starttls() if 200 <= c <= 299: fpr.green('<<< %s %s' %(c,m)) # HELO - introducing yourself on encrypted session should be done as well if v: fpr.cyan('>>> %s %s' % ('EHLO',dhost['helo'])) (c,m) = s.ehlo(dhost['helo']) if v: #print (c,m) if 200 <= c <= 299: fpr.green('<<< %s %s' %(c,m)) if s.does_esmtp: fpr.white('ESMTP supported and have extn:') #print s.does_esmtp #print s.esmtp_features for (scmd,sarg) in s.esmtp_features.items(): fpr.white(' * %s %s' % (scmd,sarg)) elif 500 <= c <= 599: fpr.err('<<< %s %s' %(c,m)) elif 500 <= c <= 599: fpr.err('<<< %s %s' %(c,m)) else: if v: fpr.white('TLS supported but not requested') fpr.white('Unencrypted session established') # SMTP AUTH if 'auth' in s.esmtp_features.keys(): if dhost['smtp_auth_user'] != '': if v: fpr.cyan('>>> %s %s' % ('AUTH PLAIN','*********')) (c,m) = s.login(dhost['smtp_auth_user'],dhost['smtp_auth_pass']) if v: if 200 <= c <= 299: fpr.green('<<< %s %s' %(c,m)) elif 500 <= c <= 599: fpr.err('<<< %s %s' %(c,m)) elif dhost['smtp_auth_user'] != '': if v: fpr.white('Authentication SET but not available (AUTH not supported)') fpr.white('Trying without AUTH') if method.lower() == 'rcpt to': # MAIL FROM sender = smtp['addrlist']['mail_from'] #rcpt = smtp['addrlist']['rcpt_to'] if v: fpr.cyan('>>> %s %s' % ('MAIL FROM:',sender)) (c,m) = s.docmd('MAIL FROM:',sender) if v: if 200 <= c <= 299: fpr.green('<<< %s %s' %(c,m)) elif 500 <= c <= 599: fpr.err('<<< %s %s' %(c,m)) # number of recipients to test # rpt - rcpt/thread # cpt - command/thread if cpt == None: cpt = 1 rpt = len(rcpts) cpt = rpt if v: fpr.white('Enumerating recipients ..') fpr.white(' * %s recipients to test with this thread' % len(rcpts)) fpr.white(' * method in use: %s' % method.lower()) #print rcpts for r in rcpts: if method.lower() == 'rcpt to': if v: fpr.cyan('>>> %s: <%s>' % (method,r)) (c,m) = s.docmd('%s:' % method,'<%s>' % r) else: # treat results returned from vrfy and expn similar # expn should have a separate condition as it could return # a list of recipients in case of mailing list but # in modern networks you should be really lucky to find such an SMTP server # supporting - good luck with that # - it should be implemented just as proof of concept rather than for real use if v: fpr.cyan('>>> %s <%s>' % (method,r)) (c,m) = s.docmd('%s' % method,'<%s>' % r) if 200 <= c <= 299: if v: fpr.green('<<< %s %s' %(c,m)) dhar.setdefault(r, { 'valid': True, 'code': c, 'msg': m, 'method': method.lower(), 'host': dhost['host'], 'thread': name } ) elif 500 <= c <= 599: if v: fpr.err('<<< %s %s' %(c,m)) dhar.setdefault(r, { 'valid': False, 'code': c, 'msg': m, 'method': method.lower(), 'host': dhost['host'], 'thread': name } ) else: if v: fpr.err('<<< %s %s' %(c,m)) dhar.setdefault(r, { 'valid': False, 'code': c, 'msg': m, 'method': method.lower(), 'host': dhost['host'], 'thread': name } ) # query timeout - wait before next command #sleep(1) # pprint(dhar) # quit smtp session if v: fpr.cyan('>>> %s' % ('QUIT:')) (c,m) = s.quit() if v: if 200 <= c <= 299: fpr.green('<<< %s %s' %(c,m)) fpr.white('Session closed successfully') elif 500 <= c <= 599: fpr.err('<<< %s %s' %(c,m)) if v: print fpr('To check valid recipients back to the main submenu') #pprint(dhar) # the exception is triggered only when all recipoient failed :( except smtplib.SMTPRecipientsRefused, e: fpr.fail('Error: unable to sent message. All recipients refused.') smtp['replay']['threads']['fail'].append(name) #print 'exception smtplib.SMTPRecipientsRefused',a fpr.warn(str(e)) smtp['addrlist']['r_reject'].update(e.recipients)
def enumSMTPcmd(v=None,dhost=smtp['connect']['hosts'][0]): #TODO: if no EHLO , use HELO from pprint import pprint # secure extn - list of extn received after successfull STARTTLS commands scmds = { 'extn' : [], 'secure_extn': [], 'cmds': '', 'method': [], } #pprint(dhost) #pprint(scmds) print try: import sys import smtplib # run smtp session if v: fpr.white('Establishing the session with %s on port %s' % (dhost['host'],dhost['port'])) s = smtplib.SMTP(dhost['host'],dhost['port']) if v: fpr.cyan('>>> %s' % 'HELP') r = s.help() scmds['scmds'] = r if v: fpr.green('<<< %s' % r) # if cfgs['conv_logs'] and cl: # s.set_debuglevel('debug') # HELO - introduce yourself if v: fpr.cyan('>>> %s %s' % ('EHLO',dhost['helo'])) (c,m) = s.ehlo(dhost['helo']) #r = s.helo(smtp['connect']['hosts'][0]['helo']) #print (c,m) if 200 <= c <= 299: if v: fpr.green('<<< %s %s' %(c,m)) if s.does_esmtp: if v: fpr.white('ESMTP supported and have extn:') #print s.does_esmtp #print s.esmtp_features for (scmd,sarg) in s.esmtp_features.items(): if v: fpr.white(' * %s %s' % (scmd,sarg)) scmds['extn'].append((scmd,sarg)) elif 500 <= c <= 599: fpr.err('<<< %s %s' %(c,m)) # STAARTTLS if 'starttls' in s.esmtp_features.keys(): if dhost['tls_mode'] == 'TLS': if v: fpr.white('TLS supported and requested') fpr.white('Establishing TLS session ..') fpr.cyan('>>> %s' % ('STARTTLS')) (c,m) = s.starttls() if 200 <= c <= 299: fpr.green('<<< %s %s' %(c,m)) # HELO - introducing yourself on encrypted session should be done as well if v: fpr.cyan('>>> %s %s' % ('EHLO',dhost['helo'])) (c,m) = s.ehlo(dhost['helo']) if v: #print (c,m) if 200 <= c <= 299: fpr.green('<<< %s %s' %(c,m)) if s.does_esmtp: fpr.white('ESMTP supported and have extn:') #print s.does_esmtp #print s.esmtp_features for (scmd,sarg) in s.esmtp_features.items(): fpr.white(' * %s %s' % (scmd,sarg)) scmds['secure_extn'].append((scmd,sarg)) elif 500 <= c <= 599: fpr.err('<<< %s %s' %(c,m)) elif 500 <= c <= 599: fpr.err('<<< %s %s' %(c,m)) else: if v: fpr.white('TLS supported but not requested') fpr.white('Unencrypted session established') # # SMTP AUTH # if 'auth' in s.esmtp_features.keys(): # if smtp['connect']['hosts'][0]['smtp_auth_user'] != '': # if v: # fpr.cyan('>>> %s %s' % ('AUTH PLAIN','*********')) # (c,m) = s.login(smtp['connect']['hosts'][0]['smtp_auth_user'],smtp['connect']['hosts'][0]['smtp_auth_pass']) # if v: # if 200 <= c <= 299: # fpr.green('<<< %s %s' %(c,m)) # elif 500 <= c <= 599: # fpr.err('<<< %s %s' %(c,m)) # else: # if smtp['connect']['hosts'][0]['smtp_auth_user'] != '': # if v: # fpr.white('Authentication SET but not available (AUTH not supported)') # fpr.white('Trying without AUTH') # else: # if v: # fpr.white('Authentication not available (AUTH not supported)') # fpr.white('Trying without AUTH') #print rcpts r = 'postmaster' for sm in ['EXPN','VRFY']: if v: fpr.cyan('>>> %s <%s>' % (sm,r)) (c,m) = s.docmd('%s' % sm,'<%s>' % r) if 200 <= c <= 299: if v: fpr.green('<<< %s %s' %(c,m)) scmds['method'].append(sm) elif 500 <= c <= 599: if v: fpr.err('<<< %s %s' %(c,m)) else: if v: fpr.err('<<< %s %s' %(c,m)) if 'rcpt' in scmds['scmds'].lower(): scmds['method'].append('RCPT') # pprint(dhar) # quit smtp session if v: fpr.cyan('>>> %s' % ('QUIT:')) (c,m) = s.quit() if v: if 200 <= c <= 299: fpr.green('<<< %s %s' %(c,m)) fpr.white('Session closed successfully') elif 500 <= c <= 599: fpr.err('<<< %s %s' %(c,m)) #pprint(scmds) return scmds # the exception is triggered only when all recipoient failed :( except smtplib.SMTPRecipientsRefused, e: fpr.fail('Error: unable to sent message. All recipients refused.') fpr.warn(str(e))
def chThrDep(t=None, rpm=None, mpt=None): #VERIFY: In Python 2.x : int/int --> int and int/float --> float In Python 3.x : int/int can result in a float from core.data import smtp, fpr, tc, tr from core.func import waitin r = get_rcpts('NoR') #Warunki Konieczne - Essential Conditions # to met WK1, WK2, WK3 if not t: t = smtp['replay']['threads'].get('not', None) elif t and not (1 <= int(t) <= r): if r > 1: t = r if r == 1: #special case pass if t: smtp['replay']['threads']['not'] = int(t) if not rpm: rpm = smtp['replay']['threads'].get('rpm', None) elif rpm and not (1 <= int(rpm) <= r): rpm = int(r) if rpm: fpr.ok('Saving RpM as %s' % rpm) smtp['replay']['threads']['rpm'] = int(rpm) if not mpt: mpt = smtp['replay']['threads'].get('mpt', None) elif mpt and not (1 <= int(mpt) <= r): mpt = int(r) if mpt: fpr.ok('Saving MpT as %s' % mpt) smtp['replay']['threads']['mpt'] = int(mpt) if r: # specific feature: the result depends from number of recipients # -------------------------------------------------------------------- # if t and not rpm and not mpt: fpr.warn('%s : %s : %s - %s' % (t, rpm, mpt, r)) # allow to set t if no rpm or mpt values and number of rcpt > 1 # but t must be <= r, so if t greater then r => it will be equal to r if r > 1: smtp['replay']['threads']['not'] = int(t) fpr.ok('Saving NoT as %s' % t) return t # special case when r == 1 , not related to our Equation # for r = 1 allow to set T > 1 but do not allow than set rpm or mpt # in this special case the sam message is flooding a sepcific rcpt # with this smae message in multiple threads/connection ! if r == 1: #pass smtp['replay']['threads']['not'] = int(t) fpr.ok('Saving NoT as %s' % t) return t # set initial elif rpm and not t and not mpt: fpr.warn('%s : %s : %s - %s' % (t, rpm, mpt, r)) if r > 1: smtp['replay']['threads']['rpm'] = int(rpm) #return rpm #return True if r == 1: fpr.warn('It doesn\'t make sense to define RpM when NoR = 1') return False # elif mpt and not t and not rpm: fpr.warn('%s : %s : %s - %s' % (t, rpm, mpt, r)) if r > 1: smtp['replay']['threads']['mpt'] = int(mpt) #return mpt #return True if r == 1: fpr.warn('It doesn\'t make sense to define MpT when NoR = 1') return False else: fpr.err('Recipients not defined. Build a list of recipients first.') fpr.err('Flush the values if the recipient list has been modified.') return # Some maths :) # # rpm - recipient per message # r - number of recipients (all) # m - number of messages (all) # # rpm = r / m ==> m = r / rpm # mpt - messages per thread # t - number of threads # m - number of messages (all) # # mpt = m / t ==> m = mpt * t # r / rpm = mpt * t # # ==> t = r / (rpm * mpt) # # ==> rpm = r / (mpt * t) # # ==> mpt = r / (rpm * t) fpr.info('_' * (tc - 4)) print fpr.warn('Your limits:') fpr.warn('t = %s : rpm = %s : mpt = %s - r = %s' % (smtp['replay']['threads'].get( 'not', None), smtp['replay']['threads'].get('rpm', None), smtp['replay']['threads'].get('mpt', None), r)) print fpr.err('Maximum possible limits to met Essential Conditions:') fpr.err('t = %s : rpm = %s : mpt = %s - r = %s' % (t, rpm, mpt, r)) fpr.info('_' * (tc - 4)) print def chEque(): print if r: # compare float # https://ubuntuforums.org/showthread.php?t=840665 def float_eq(a, b, epsilon=0.00000001): fpr.cyan('<float_eq> %s' % abs(a - b)) if abs(a - b) < epsilon: return True return False m1 = float(r) / rpm m2 = mpt * float(t) fpr.cyan('r/rpm = %s, mpt * t = %s' % (m1, m2)) if float_eq(m1, m2): fpr.green('Equetion is met') waitin() return True else: fpr.err('Equetion is false') waitin() return False def setReals(t, rpm, mpt): if t and rpm and mpt: smtp['replay']['threads']['reals'].setdefault('not', t) smtp['replay']['threads']['reals'].setdefault('rpm', rpm) smtp['replay']['threads']['reals'].setdefault('mpt', mpt) smtp['replay']['threads']['reals']['not'] = t smtp['replay']['threads']['reals']['rpm'] = rpm smtp['replay']['threads']['reals']['mpt'] = mpt fpr.ok('Reals were set!') if r: # count the mpt - based on rpm and t # -------------------------------------------------------------------- # if t and rpm and not mpt: fpr.green('%s : %s : %s - %s' % (t, rpm, mpt, r)) # m = r / rpm # mpt = m / t # I - validate MPT - MPT <= R mpt = float(r) / (rpm * t) fpr.green('counting mpt = %s' % mpt) chEque() # round up - if there is a remainder if (r % (rpm * t) > 0): mpt = r / (rpm * t) + (r % (rpm * t) > 0) fpr.green('rounding up mpt = %s' % mpt) # find the lowest T for rounded MpT to met RpM t_new = float(r) / (rpm * mpt) #+ (r % (rpm * mpt) > 0) fpr.green('counting new t = %s' % t_new) if (r % (rpm * mpt) > 0): # if remainder t_new = r / (rpm * mpt) + (r % (rpm * mpt) > 0) fpr.green('rounding up new t = %s' % t_new) fpr.err( 'realistic returns would be: *t = %s, rpm = %s, mpt = %s for r = %s' % (int(t_new), rpm, int(mpt), r)) setReals(int(t_new), rpm, int(mpt)) else: fpr.err( 'realistic returns would be: t = %s, rpm = %s, mpt = %s for r = %s' % (t, rpm, int(mpt), r)) setReals(t, rpm, int(mpt)) # count the rpm - for mpt and t # -------------------------------------------------------------------- # elif t and mpt and not rpm: fpr.blue('%s : %s : %s - %s' % (t, rpm, mpt, r)) # m = mpt * t # m = r / rpm # TODO # WK: validate RPM , RPM <= R rpm = float(r) / (mpt * t) fpr.blue('counting: rpm = %s' % rpm) chEque() # if there is a remainder if (r % (mpt * t) > 0): rpm = r / (mpt * t) + (r % (mpt * t) > 0) fpr.blue('rounding up rpm = %s' % rpm) # find the lowest T for rounded MpT to met RpM t_new = float(r) / (rpm * mpt) #+ (r % (rpm * mpt) > 0) fpr.green('counting new t = %s' % t_new) if (r % (rpm * mpt) > 0): # if remainder t_new = r / (rpm * mpt) + (r % (rpm * mpt) > 0) fpr.green('rounding up new t = %s' % t_new) fpr.err( 'realistic returns would be: *t = %s, rpm = %s, mpt = %s for r = %s' % (int(t_new), int(rpm), mpt, r)) setReals(int(t_new), int(rpm), mpt) else: fpr.err( 'realistic returns would be: t = %s, rpm = %s, mpt = %s for r = %s' % (t, int(rpm), mpt, r)) setReals(t, int(rpm), mpt) # count the mpt ( use t = 1 ) # -------------------------------------------------------------------- # elif rpm and not t and not mpt: t = 1 fpr.purple('assuming t eq 1 for equation') fpr.purple('%s : %s : %s - %s' % (t, rpm, mpt, r)) mpt = float(r) / rpm fpr.purple('counting: mpt = %s' % mpt) chEque() #if there is a remainder if (r % rpm > 0): mpt = r / rpm + (r % rpm > 0) fpr.purple('rounding up mpt = %s' % mpt) # find the lowest T for rounded MpT to met RpM t_new = float(r) / (rpm * mpt) #+ (r % (rpm * mpt) > 0) fpr.green('counting new t = %s' % t_new) if (r % (rpm * mpt) > 0): # if remainder t_new = r / (rpm * mpt) + (r % (rpm * mpt) > 0) fpr.green('rounding up new t = %s' % t_new) fpr.err( 'realistic returns would be: *t = %s, rpm = %s, mpt = %s for r = %s' % (int(t_new), rpm, mpt, r)) setReals(int(t_new), rpm, mpt) else: fpr.err( 'realistic returns would be: t = %s, rpm = %s, mpt = %s for r = %s' % (t, rpm, int(mpt), r)) setReals(t, rpm, int(mpt)) # count the rpm ( use t = 1 ) # -------------------------------------------------------------------- # elif mpt and not t and not rpm: t = 1 fpr.purple('assuming t eq 1 for equation') fpr.purple('%s : %s : %s - %s' % (t, rpm, mpt, r)) rpm = float(r) / mpt fpr.purple('counting: rpm = %s' % rpm) t = 1 chEque() #if there is a remainder if (r % mpt > 0): rpm = r / mpt + (r % mpt > 0) fpr.purple('rounding up rpm = %s' % rpm) # find the lowest T for rounded MpT to met RpM t_new = float(r) / (rpm * mpt) #+ (r % (rpm * mpt) > 0) fpr.green('counting new t = %s' % t_new) if (r % (rpm * mpt) > 0): # if remainder t_new = r / (rpm * mpt) + (r % (rpm * mpt) > 0) fpr.green('rounding up new t = %s' % t_new) fpr.err( 'realistic returns would be: *t = %s, rpm = %s, mpt = %s for r = %s' % (int(t_new), int(rpm), mpt, r)) setReals(int(t_new), int(rpm), mpt) else: fpr.err( 'realistic returns would be: t = %s, rpm = %s, mpt = %s for r = %s' % (t, int(rpm), mpt, r)) setReals(t, int(rpm), mpt) # count t - for rpm and mpt # -------------------------------------------------------------------- # elif mpt and rpm and not t: fpr.white('%s : %s : %s - %s' % (t, rpm, mpt, r)) print type(mpt) # add 1 to round up a result # (r % (rpm * mpt) > 0) it will return True which is 1 # if there is a remainder and 0 if not t = float(r) / (rpm * mpt) #+ (r % (rpm * mpt) > 0) fpr.white('counted: t = %s' % t) chEque() # round up if (r % (rpm * mpt) > 0): t = r / (rpm * mpt) + (r % (rpm * mpt) > 0) fpr.white('rounding up t = %s' % t) # validate WK # t = <1,r> # if t < 1 if (float(r) / (rpm * mpt)) < 1: fpr.info('Now to met equetion for t=1 it is not possible for %s (R) recipients '\ 'to send %s (MpT) messeges in one thread with %s (RpM) recipient in message' % (r,mpt,rpm)) print fpr.info('New RpM value can be counted based on existing MpT or new MpT ' \ 'value can be counted based on existing RpM' ) print fpr.info('For simplicity it is assumed that RpM limits is more important so MpT ' \ 'is going to be recounted to met an equation') print mpt_new = float(r) / rpm fpr.white('New MpT to met equetion is %s' % mpt_new) mpt = mpt_new chEque() # now just round up mpt_new = r / rpm + (r % rpm > 0) fpr.white('rounding up new mpt = %s' % mpt_new) fpr.err( 'realistic returns would be: t = %s, rpm = %s, *mpt = %s for r = %s' % (int(t), rpm, int(mpt_new), r)) setReals(int(t), rpm, int(mpt_new)) else: # so if t > 1 and it was counted fpr.err( 'realistic returns would be: t = %s, rpm = %s, mpt = %s for r = %s' % (int(t), rpm, int(mpt), r)) setReals(int(t), rpm, int(mpt)) # only true if r / rpm = mpt * t # -------------------------------------------------------------------- # elif t and rpm and mpt: fpr.cyan('%s : %s : %s - %s' % (t, rpm, mpt, r)) if not chEque(): fpr.info('_' * (tc - 4)) print fpr.warn('It is not recommended trying to set NoT with RpM and MpT. ' \ 'Suggested action would be to flush these values.' ) fpr.info('_' * (tc - 4)) print waitin() return False else: fpr.err( 'realistic returns would be: t = %s, rpm = %s, mpt = %s for r = %s' % (t, rpm, mpt, r)) setReals(t_new, rpm, mpt) # for test waitin()