From 7851f4c0fa885c3b31a5dae0fadb449b38ee8c22 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sun, 24 May 2015 16:05:17 +0200 Subject: [PATCH] +smtp_login -erreur pour autre que GMAIL [stable~40] --- enigmail/.config | 7 ++++--- enigmail/bucket-file | 3 ++- enigmail/enigmail.sh | 1 + enigmail/source/enigmail.py | 18 ++++++++++-------- enigmail/source/enigmail.pyc | Bin 0 -> 5191 bytes 5 files changed, 17 insertions(+), 12 deletions(-) create mode 100644 enigmail/source/enigmail.pyc diff --git a/enigmail/.config b/enigmail/.config index b03fbdc..d69867e 100644 --- a/enigmail/.config +++ b/enigmail/.config @@ -1,3 +1,4 @@ -smtp_server = smtp.gmail.com -smtp_port = 587 -mail_address = test@mail.com +smtp_server = smtp1.iut-tlse3.fr +smtp_port = 465 +smtp_login = mrd1609a +mail_address = mrd1609a diff --git a/enigmail/bucket-file b/enigmail/bucket-file index 8b13789..e214881 100644 --- a/enigmail/bucket-file +++ b/enigmail/bucket-file @@ -1 +1,2 @@ - +coucou test :p +P \ No newline at end of file diff --git a/enigmail/enigmail.sh b/enigmail/enigmail.sh index 49b83f6..bb5f0f1 100644 --- a/enigmail/enigmail.sh +++ b/enigmail/enigmail.sh @@ -9,6 +9,7 @@ then # si 1 paramètre 'init') # initialise le contenu du fichier de config echo "smtp_server = smtp.gmail.com" > "$path/.config" echo "smtp_port = 587" >> "$path/.config" + echo "smtp_login = equal_mailadress_or_different_login" >> "$path/.config" echo "mail_address = test@mail.com" >> "$path/.config" ;; 'config') nano "$path/.config";; # ouvre en modification le fichier de config diff --git a/enigmail/source/enigmail.py b/enigmail/source/enigmail.py index e84f077..5a15621 100644 --- a/enigmail/source/enigmail.py +++ b/enigmail/source/enigmail.py @@ -20,7 +20,7 @@ def getConf(pPath): confVal = i[i.index('=')+1:].replace(' ', '').replace('\n', ''); conf[confKey] = confVal; - if( len(conf) == 3 ): # si le fichier de config est bien récupéré et qu'il est complet + if( len(conf) == 4 ): # si le fichier de config est bien récupéré et qu'il est complet return conf; else: return False; @@ -29,6 +29,7 @@ def getConf(pPath): # cette fonction envoie un mail def sendMail(pConf, pPass, pTo, pSubject, pMessage): + srv = smtplib.SMTP(pConf['smtp_server'], int(pConf['smtp_port']) ); try: pMsg = MIMEMultipart(); pMsg['From'] = pConf['mail_address']; @@ -37,19 +38,20 @@ def sendMail(pConf, pPass, pTo, pSubject, pMessage): pMsg.attach( MIMEText(pMessage.encode('utf-8')) ); - srv = smtplib.SMTP(pConf['smtp_server'], pConf['smtp_port']); srv.ehlo(); - srv.starttls(); - srv.ehlo(); - srv.login(pConf['mail_address'], pPass); + if( srv.has_extn('STARTTLS') ): + srv.starttls(); + srv.ehlo(); + + srv.login(pConf['smtp_login'], pPass); srv.sendmail( pConf['mail_address'], pTo, pMsg.as_string() ); - srv.quit(); - + print "> Mail envoye !"; except smtplib.SMTPAuthenticationError: print "> Mauvais login ou mot de passe\n\(enigmail config) pour changer votre adresse"; - + finally: + srv.quit(); diff --git a/enigmail/source/enigmail.pyc b/enigmail/source/enigmail.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c8efda9656ea4f383d9e24528b4656774f6a8606 GIT binary patch literal 5191 zcmcIo-E!PW749C{6VJrs{3kmh!Lxx{hAP%BsMKbc^)5+l#|ep@tj57hz@!wZJtJEq z$x@FQZ#g$)d4Rp)ihTvDxS@Cr?sy9>cmVjm)8ny|0&cKvseO*R)j!|)&X4TKg;x7M!#wv9n2fY?m)SHTW zt<`~6+giO*>UBkAJXcD`&^{{+GVpQ3tLgxkrw%67!tO_E!{U9J6|n78RPiUO9a~i$VBcxiu=Ta_EZX_Gx%s&; zOSj^#aUq%>|es`<0P_M~HL5&IFzP0F>nMcGs=^HF_l_Q&!sf~1X6N}BR6 zr1@UfH}iwi6!Z57*x+D(<95y@BkOU0}mWKnigCDPb#VjOOq#)>Z`x0 z{XZ)pLaM-c;uB4n5hPduODMsbG^+T+0{+0}zy-wF#-lT2jk`4Lz6~84q$J*gp5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