Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #109096

Re: [smtplib] how to assure login was succesful?

From Dennis Lee Bieber <wlfraed@ix.netcom.com>
Newsgroups comp.lang.python
Subject Re: [smtplib] how to assure login was succesful?
Date 2016-05-24 20:30 -0400
Organization IISS Elusive Unicorn
Message-ID <mailman.74.1464136246.20402.python-list@python.org> (permalink)
References <b1d2c666-1d1a-4dce-907d-3f0e1336b5d8@googlegroups.com> <v1s9kbhi8scg8ih3ff9gk7p6mv22jc0ocg@4ax.com>

Show all headers | View raw


On Tue, 24 May 2016 10:08:01 -0700 (PDT), maurice
<mauricioliveiraguarda@gmail.com> declaimed the following:

>Hello to all.
>
>I have the following question:
>
>Once my python script reaches the point where I login in my email account with: server.login(username,password) (where server server = smtplib.SMTP('smtp.office365.com:587')), it returns a tuple like this:
>
>(235,
> '2.7.0 Authentication successful target host [address here]')
>
>This method returns a tuple (code, resp). Just want to confirm if I use a variable to store code alone I should check if it is 235 or not, by looking at the reference it seems it is the only code value that does not raise an exception.
>

	I would recommend you examine the RFC for SMTP to see what the return
codes could be.

Hmm, 235 may not be a standard response...

https://tools.ietf.org/html/rfc5321#section-4.2.3


Ah... Extended codes...

https://tools.ietf.org/html/rfc5248#section-2.4
https://tools.ietf.org/html/rfc4954#section-6


For the most part, any 2xx code falls into some sort of success category.
-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[smtplib] how to assure login was succesful? maurice <mauricioliveiraguarda@gmail.com> - 2016-05-24 10:08 -0700
  Re: [smtplib] how to assure login was succesful? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-05-24 20:30 -0400
  Re: [smtplib] how to assure login was succesful? dieter <dieter@handshake.de> - 2016-05-25 10:23 +0200

csiph-web