[gen_conf] Envois du mail de bienvenue, vérification de la création du home
La portion de code qui l'effectué auparavant ne fonctionait qu'avec des adresses crans sans le @crans.org cf http://git.crans.org/usr-scripts/7eb1a80889ceaa et suivant.
This commit is contained in:
parent
03f9be4008
commit
9300e296e3
1 changed files with 3 additions and 4 deletions
|
@ -167,11 +167,10 @@ class mail_bienvenue:
|
|||
try:
|
||||
From = "respbats@crans.org"
|
||||
To = mail
|
||||
if '@' not in To:
|
||||
if not os.path.exists("/home/" + To):
|
||||
if '@crans.org' in To:
|
||||
if not os.path.exists("/home/" + To.replace('@crans.org','')):
|
||||
print ERREUR
|
||||
continue
|
||||
else:
|
||||
To += '@crans.org'
|
||||
conn=smtplib.SMTP('localhost')
|
||||
conn.sendmail(From, To, mail_module.generate('bienvenue', { 'From': From, 'To': To, 'lang_info': 'English version below' }).as_string())
|
||||
conn.quit()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue