D
D
Dmitry Shitskov2017-05-12 11:58:27
Python
Dmitry Shitskov, 2017-05-12 11:58:27

By what parameters Yandex determines the sending from the script?

Good afternoon!
When trying to send an email using smtplib in Python, Yandex rejects the authorization with a message about suspected spam. I compared the SMTP sessions of the mail client and the script and did not notice any critical differences.
Please share information on the basis of what parameters does Yandex distinguish between authorization from a mail client and authorization from a Python script?
log from python

spoiler
send: 'STARTTLS\r\n'
reply: b'220 Go ahead\r\n'
reply: retcode (220); Msg: b'Go ahead'
send: 'ehlo localhost\r\n'
reply: b'250-smtp2h.mail.yandex.net\r\n'
reply: b'250-8BITMIME\r\n'
reply: b'250-PIPELINING\r\n'
reply: b'250-SIZE 42991616\r\n'
reply: b'250-AUTH LOGIN PLAIN XOAUTH2\r\n'
reply: b'250-DSN\r\n'
reply: b'250 ENHANCEDSTATUSCODES\r\n'
reply: retcode (250); Msg: b'smtp2h.mail.yandex.net\n8BITMIME\nPIPELINING\nSIZE 42991616\nAUTH LOGIN PLAIN XOAUTH2\nDSN\nENHANCEDSTATUSCODES'
send: 'AUTH PLAIN AGtvb2xqZG1312312312312123h5Ymh5c3ExMjM=\r\n'
reply: b'535 5.7.8 Error: authentication failed: Your message looks like spam. You need to use web for sending or prove you are not a robot using the following link http://ya.cc/6lIV\r\n'
reply: retcode (535); Msg: b'5.7.8 Error: authentication failed: Your message looks like spam. You need to use web for sending or prove you are not a robot using the following link http://ya.cc/6lIV'
send: 'AUTH LOGIN a29vbGpkY123123FuZGV4LnJ1\r\n'
reply: b'334 UGFzc3dvcmQ6\r\n'
reply: retcode (334); Msg: b'UGF123123cmQ6'
send: 'aWZoeWJoeXNxMTIz\r\n'
reply: b'535 5.7.8 Error: authentication failed: Your message looks like spam. You need to use web for sending or prove you are not a robot using the following link http://ya.cc/6lIV\r\n'
reply: retcode (535); Msg: b'5.7.8 Error: authentication failed: Your message looks like spam. You need to use web for sending or prove you are not a robot using the following link http://ya.cc/6lIV'
Traceback (most recent call last):
 File "/home/wufam/send_mail.py", line 11, in <module>
 File "/usr/lib/python3.5/smtplib.py", line 729, in login
    raise last_exception
 File "/usr/lib/python3.5/smtplib.py", line 720, in login
   initial_response_ok=initial_response_ok)
 File "/usr/lib/python3.5/smtplib.py", line 641, in auth
   raise SMTPAuthenticationError(code, resp)
smtplib.SMTPAuthenticationError: (535, b'5.7.8 Error: authentication failed: Your message looks like spam. You need to use web for sending or prove you are not a robot using the following link http://ya.cc/6lIV')
[Finished in 0.7s with exit code 1]
[shell_cmd: python3 -OO -u "/home/wufam/send_mail.py"]
[dir: /home/wufam]
[path: /home/wufam/bin:/home/wufam/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin]

My question is not about finding a Python solution or a working script. Only interested in information.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Shitskov, 2017-05-12
@Zarom

It was possible to send after specifying the address-literal of the sender, Yandex does not register the message as spam. Here is the correct initialization:
PLAIN authorization was not a hindrance.
Thanks to Rsa97 and Maxim Grishin for help in finding correct information.

R
Rsa97, 2017-05-12
@Rsa97

ehlo localhost
HELO and EHLO must contain the correct FQDN of the sender. It is highly desirable that the reverse DNS points to this FQDN.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question