X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap.git;a=blobdiff_plain;f=ud-useradd;fp=ud-useradd;h=ee04983e309419a37dc6ec5ab1374545d0ee609a;hp=c183dca36247f2e474d94c3a39d6393ab14e2065;hb=738c966170c4374b4dfdab6adafd1ec0c85f16bb;hpb=ead5fb9ed9b99aa3bcaf466d5507331c79e94d57 diff --git a/ud-useradd b/ud-useradd index c183dca..ee04983 100755 --- a/ud-useradd +++ b/ud-useradd @@ -326,7 +326,10 @@ if Update == 1 and ForceMail == 0: # Send the Welcome message print "Sending Welcome Email" -Reply = TemplateSubst(Subst,open(TemplatesDir + "/welcome-message-%d" % int(gidNumber), "r").read()) +templatepath = TemplatesDir + "/welcome-message-%d" % int(gidNumber) +if not os.path.exists(templatepath): + templatepath = TemplatesDir + "/welcome-message" +Reply = TemplateSubst(Subst,open(templatepath, "r").read()) Child = os.popen("/usr/sbin/sendmail -t","w"); #Child = os.popen("cat","w"); Child.write(Reply);