Permalink
Browse files

Forcibly add /usr/sbin to the PATH before running sendmail.

Should make it work better on platforms that follow FHS, like debian.
  • Loading branch information...
mhagander committed Sep 6, 2010
1 parent 6667771 commit b8d3a46dad3ce6f2234c6efd06a978ed0bb00dcc
Showing with 4 additions and 1 deletion.
  1. +4 −1 commitmsg.py
View
@@ -95,7 +95,10 @@ def flush_mail():
if debug == 1:
print msg
else:
- pipe = Popen("sendmail -t", shell=True, stdin=PIPE).stdin
+ env = os.environ
+ # Add /usr/bin to the path, needed on debian
+ env["PATH"] += ":/usr/sbin"
+ pipe = Popen("sendmail -t", shell=True, env=env, stdin=PIPE).stdin
pipe.write(msg.as_string())
pipe.close()

0 comments on commit b8d3a46

Please sign in to comment.