diff --git a/gestion/gen_confs/adherents.py b/gestion/gen_confs/adherents.py index 952b91d0..ff050f3f 100644 --- a/gestion/gen_confs/adherents.py +++ b/gestion/gen_confs/adherents.py @@ -164,7 +164,11 @@ class mail_bienvenue: try: From = "respbats@crans.org" To = mail - if To.find('@') == -1: To += '@crans.org' + if '@' not in To: + if not os.path.exists("/home/" + To): + continue + else: + To += '@crans.org' conn=smtplib.SMTP('localhost') conn.sendmail(From, To, config.txt_mail_bienvenue.encode('utf-8') % { 'From': From, 'To': To }) conn.quit()