diff --git a/syncmail b/syncmail index fbb040be..4ee3a729 100755 --- a/syncmail +++ b/syncmail @@ -244,16 +244,15 @@ def blast_mail(subject, people, entries, contextlines, fromhost, replyto, charse conn = smtplib.SMTP() conn.connect(MAILHOST, MAILPORT) user = os.getenv("SUDO_USER", pwd.getpwuid(os.getuid())[0]) - name = string.split(pwd.getpwuid(os.getuid())[4], ',')[0] - + # Modif pour avoir le bon from (=> signature automatique) if user=="root" : for proc in os.popen("ps --no-headers -o user -t $(ps --no-headers -o tty %s)" % os.getpid() ).readlines() : userp=string.strip(proc) if userp=="root" : break else : user=userp - name = string.split(pwd.getpwnam(user)[4], ',')[0] + name = string.split(pwd.getpwnam(user)[4], ',')[0] domain = fromhost or getfqdn() host = string.split(domain,'.')[0] address = '%s@crans.org' % user