Hello Umberto,
It's clear that the problem is not with Ansible xD.
You can try to configure thunderbird with your parameter and check where
the configuration fails. (You can try changing the mail server to
SMTP.mail.yahoo.com ... )

I'm out of ideas, sorry Umberto!

El dv., 19 oct. 2018 17.56, Umberto Manferdini <umberto.manferd...@gmail.com>
va escriure:

> Hi Oriol
> that helped a bit!
> but also with python not working 100%
>
> tried this
>
> >>> server = smtplib.SMTP_SSL('smtp.mail.yahoo.it', 465)
> >>> server.connect('smtp.mail.yahoo.it', 465)
> (220, 'smtp.mail.yahoo.com ESMTP ready')
> >>> server.login("***","***")
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/usr/lib/python2.7/smtplib.py", line 622, in login
>     raise SMTPAuthenticationError(code, resp)
>
> connect is way faster now and works at first attempt
>
> anyhow i get auth error. curious thing is that i try to login with those
> credentials via browser and they work so i cannot understand why there is
> an AUTH error
>
> Umberto
>
> Il giorno venerdì 19 ottobre 2018 17:20:34 UTC+2, Oriol Tauleria ha
> scritto:
>>
>> Hello Umberto,
>> Even in python?
>> (You need to change the smtplib.SMTP to SMTP_SSL with the new port?)
>> Thanks!
>>
>> El dv., 19 oct. 2018 17.09, Umberto Manferdini <umberto.m...@gmail.com>
>> va escriure:
>>
>>> Hi Oriol,
>>> thanks for the tip
>>> unfortunately it does not work
>>> 465 gives me the same error
>>> 587 times out when trying to connect
>>> Umberto
>>>
>>> Il giorno venerdì 19 ottobre 2018 17:02:01 UTC+2, Oriol Tauleria ha
>>> scritto:
>>>>
>>>> Hello Umberto,
>>>> Try changing the port to 465 or 587 and enabling
>>>> secure: try
>>>>
>>>>
>>>> More info: https://help.yahoo.com/kb/SLN4724.html
>>>> And: https://docs.ansible.com/ansible/2.7/modules/mail_module.html
>>>>
>>>> El dv., 19 oct. 2018 16.55, Umberto Manferdini <umberto.m...@gmail.com>
>>>> va escriure:
>>>>
>>>>> Hello,
>>>>>
>>>>> Trying to use the mail module to send emails as last task of my
>>>>> playbook
>>>>>
>>>>>
>>>>>
>>>>> It fails saying
>>>>>
>>>>>
>>>>> fatal: [r1 -> localhost]: FAILED! => {"changed": false, "msg":
>>>>> "Authentication to smtp.mail.yahoo.com:25 failed, please check your
>>>>> username and/or password", "rc": 1}
>>>>>
>>>>> even if i'm totally sure credentials are right
>>>>>
>>>>>
>>>>>
>>>>> As I imagine, underneath, it relies on on the smtplib python module ,
>>>>> I tried to do it manually
>>>>>
>>>>>
>>>>>
>>>>> I get this
>>>>>
>>>>>
>>>>>
>>>>> >>> server = smtplib.SMTP('smtp.mail.yahoo.com', 25)
>>>>>
>>>>>
>>>>>
>>>>> >>> server.connect('smtp.mail.yahoo.com', 25)
>>>>>
>>>>> Traceback (most recent call last):
>>>>>
>>>>>   File "<stdin>", line 1, in <module>
>>>>>
>>>>>   File "/usr/lib/python2.7/smtplib.py", line 317, in connect
>>>>>
>>>>>     (code, msg) = self.getreply()
>>>>>
>>>>>   File "/usr/lib/python2.7/smtplib.py", line 368, in getreply
>>>>>
>>>>>     raise SMTPServerDisconnected("Connection unexpectedly closed")
>>>>>
>>>>> smtplib.SMTPServerDisconnected: Connection unexpectedly closed
>>>>>
>>>>>
>>>>>
>>>>> >>> server.connect('smtp.mail.yahoo.com', 25)
>>>>>
>>>>> (220, 'smtp.mail.yahoo.com ESMTP ready')
>>>>>
>>>>>
>>>>>
>>>>> >>> server.ehlo()
>>>>>
>>>>> (250, 'smtp431.mail.ir2.yahoo.com Hello***
>>>>> [***])\nPIPELINING\nENHANCEDSTATUSCODES\n8BITMIME\nSIZE 
>>>>> 41697280\nSTARTTLS')
>>>>>
>>>>>
>>>>>
>>>>> >>> server.login("***","***")
>>>>>
>>>>> Traceback (most recent call last):
>>>>>
>>>>>   File "<stdin>", line 1, in <module>
>>>>>
>>>>>   File "/usr/lib/python2.7/smtplib.py", line 585, in login
>>>>>
>>>>>     raise SMTPException("SMTP AUTH extension not supported by
>>>>> server.")
>>>>>
>>>>> smtplib.SMTPException: SMTP AUTH extension not supported by server.
>>>>>
>>>>>
>>>>>
>>>>>    - -          I can create the object
>>>>>    - -          First connect fails
>>>>>    - -          Second is ok
>>>>>    - -          Ehlo is fine
>>>>>    - -          Login fails
>>>>>
>>>>>
>>>>>
>>>>> Same happens with other smtp servers
>>>>>
>>>>>
>>>>>
>>>>> Moreover, If I try to create the server towards port 465 it fails at
>>>>> step 1
>>>>>
>>>>>
>>>>>
>>>>> >>> server = smtplib.SMTP('smtp.mail.yahoo.com', 465)
>>>>>
>>>>> Traceback (most recent call last):
>>>>>
>>>>>   File "<stdin>", line 1, in <module>
>>>>>
>>>>>   File "/usr/lib/python2.7/smtplib.py", line 256, in __init__
>>>>>
>>>>>     (code, msg) = self.connect(host, port)
>>>>>
>>>>>   File "/usr/lib/python2.7/smtplib.py", line 317, in connect
>>>>>
>>>>>     (code, msg) = self.getreply()
>>>>>
>>>>>   File "/usr/lib/python2.7/smtplib.py", line 368, in getreply
>>>>>
>>>>>     raise SMTPServerDisconnected("Connection unexpectedly closed")
>>>>>
>>>>> smtplib.SMTPServerDisconnected: Connection unexpectedly closed
>>>>>
>>>>>
>>>>>
>>>>> has anyone encountered this before?
>>>>>
>>>>>
>>>>> task is
>>>>>
>>>>>
>>>>>     - name: Sending an e-mail
>>>>>       mail:
>>>>>         host: smtp.mail.yahoo.com
>>>>>         port: 25
>>>>>         username: "***"
>>>>>         password: "***"
>>>>>         to: ***
>>>>>         subject: Ansible-report
>>>>>         body: "report generated"
>>>>>         attach:
>>>>>           - "sanity_report.csv"
>>>>>           - "{{playbook_dir}}/outputs.tgz"
>>>>>       delegate_to: localhost
>>>>>
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Ansible Project" group.
>>>>>
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to ansible-proje...@googlegroups.com.
>>>>> To post to this group, send email to ansible...@googlegroups.com.
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/ansible-project/22818f52-2dfd-427a-b25c-dc49dba84517%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/ansible-project/22818f52-2dfd-427a-b25c-dc49dba84517%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Ansible Project" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to ansible-proje...@googlegroups.com.
>>> To post to this group, send email to ansible...@googlegroups.com.
>>>
>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/ansible-project/8b0054e7-64fd-4dc1-a66a-8a6e50da7378%40googlegroups.com
>>> <https://groups.google.com/d/msgid/ansible-project/8b0054e7-64fd-4dc1-a66a-8a6e50da7378%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/7980efc0-133e-459f-b757-49bb31c74db0%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/7980efc0-133e-459f-b757-49bb31c74db0%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CABN89nceLap34BUTPmHziA5FAziqhxnLzzGepG2b2npgOW5fUg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to