On regarde en priorite dans $SUDO_USER pour determiner l'expediteur du mail.

darcs-hash:20070929111701-dc76e-3e753a724a6d88672b8bb88ca6492e8ad5fc4c1e.gz
This commit is contained in:
root 2007-09-29 13:17:01 +02:00
parent ecd24110ed
commit 3f4bc03346

View file

@ -243,7 +243,7 @@ def blast_mail(subject, people, entries, contextlines, fromhost, replyto, charse
# Create the smtp connection to the localhost
conn = smtplib.SMTP()
conn.connect(MAILHOST, MAILPORT)
user = pwd.getpwuid(os.getuid())[0]
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)