Changes by R. David Murray rdmur...@bitdance.com:
--
resolution: - duplicate
stage: - resolved
status: open - closed
superseder: - error responses from server are masked in smtplib when server
closes connection
___
Python tracker
Milan Oberkirch added the comment:
This bug is fixed (at least in 3.5) so you might want to close it.
(See the _rset function in smtplib.py:482 and how its used in sendmail.)
--
nosy: +jesstess, zvyn
___
Python tracker rep...@bugs.python.org
DDarko added the comment:
I understand, in that case:
/cpython/file/default/Lib/smtplib.py
760c760,761
self.rset()
---
try: self.rset()
except: pass
Solves the problem.
--
___
Python tracker
R. David Murray added the comment:
Well, a bare except is almost always a bad idea, and certainly is in this case.
I'll create a patch for this if no one beats me to it.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16005
New submission from DDarko:
I'm trying to send an email as follows:
smtp = smtplib.SMTP(host, port=25)
smtp.ehlo()
smtp.sendmail(from_mail, to_mail, data)
The last line / command calls the raise.
I would like to know the reason why SMTP did not accept my email?
In theory, enough to capture the
Changes by R. David Murray rdmur...@bitdance.com:
--
components: +email -Library (Lib)
nosy: +barry, r.david.murray
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16005
___
Christian Heimes added the comment:
According to RFC 821 a smtp server must always apply with OK when it receives a
RSET command.
RESET (RSET)
This command specifies that the current mail transaction is
to be aborted. Any stored sender, recipients, and mail data
must be
DDarko added the comment:
The problem is that this is not my SMTP server.
I want to connect as a client with smtplib.
For this, as I said earlier it is mx.google.com
send: 'ehlo [127.0.1.1]\r\n'
reply: b'250-mx.google.com at your service, [MYIP]\r\n'
reply: b'250-SIZE 35882577\r\n'
reply:
R. David Murray added the comment:
I believe that Google is technically out of compliance with the SMTP spec here.
What they are doing is not unreasonable, since they don't have any reason to
want to waste resources on talking to a server they think is spamming them.
Making this work in a
DDarko added the comment:
I do not understand why at all reset is performed ?
If moments later raise is done.
If someone despite error SMTPSenderRefused, SMTPRecipientsRefused or
SMTPDataError will still want to maintain a connection and use other data with
session is likely he will call
R. David Murray added the comment:
The rset just returns the connection to the base state, allowing a new
message sending transaction to start from a known state.
In any case, since the library has done this in the past, it must continue to
do this in the future, or it will break currently
11 matches
Mail list logo