diff --git a/gestion/gen_confs/adherents.py b/gestion/gen_confs/adherents.py index f279ae65..8b88b110 100644 --- a/gestion/gen_confs/adherents.py +++ b/gestion/gen_confs/adherents.py @@ -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()