Commit fc58eaff authored by Daniel Stan's avatar Daniel Stan

reinscription: utilise get_mail de lc_ldap

parent a8e73483
......@@ -26,18 +26,14 @@ for adh in conn.search(ldap_filter):
# Déjà payé pour l'année en cours
if adh.paiement_ok():
continue
if 'canonicalAlias' in adh.attrs.keys():
mailaddrs.add(str(adh['canonicalAlias'][0]))
elif 'mail' in adh.attrs.keys():
mailaddrs.add(str(adh['mail'][0]))
else:
raise ValueError("%r has nor mail nor canonicalAlias, only %s" % (adh, adh.attrs.keys()))
print "Va envoyer le message à %s personnes."
addr = adh.get_mail()
if addr:
mailaddrs.add(addr)
print "Va envoyer le message à %s personnes." % len(mailaddrs)
if not SEND:
print "(Simulation only) Mettre la variable SEND à True effectuer l'envoi" % len(mailaddrs)
print "(Simulation only) Mettre la variable SEND à True effectuer l'envoi"
print "Appuyer sur une touche pour continuer."
raw_input()
echecs=[]
conn_smtp=smtplib.SMTP('smtp.adm.crans.org')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment