diff --git a/syncmail b/syncmail index 9a3306a2..2f462507 100755 --- a/syncmail +++ b/syncmail @@ -231,14 +231,18 @@ def blast_mail(subject, people, filestodiff, contextlines, fromhost): conn = smtplib.SMTP() conn.connect(MAILHOST, MAILPORT) user = pwd.getpwuid(os.getuid())[0] - domain = fromhost or getfqdn() + + if user=="root" : + # Obtention du real user => signature automatique des commits + for proc in os.popen("ps a -o user,command,tty | grep $(ps h -o tty %s)" % os.getpid() ).readlines() : + userp=string.split(proc,' ')[0] + if userp=="root" : break + else : user=user + + domain = fromhost or getfqdn() #Modif cosmétique pour afficher un sujet explicite : host = string.split(domain,'.') author = '%s@%s' % (user, domain) - #realuser=string.split(os.popen('/usr/bin/who -m').readlines()[0])[0] - #who=os.popen('/usr/bin/who -m') - #user=toto.readlines() - #print user s = StringIO() sys.stdout = s try: