From 757a97ec31c7f5583fc7a3d9c9f866b9f76ff777 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 29 Sep 2007 13:21:43 +0200 Subject: [PATCH] C'est mieux comme ca. darcs-hash:20070929112143-dc76e-2e3d4a438eebd96a9a886244fd356c07a2d1f923.gz --- syncmail | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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