/snap/core24/1643/usr/lib/python3.12/__pycache__
NameSizeModeActions
abc.cpython-312.pyc80550644editdlrm
aifc.cpython-312.pyc428630644editdlrm
antigravity.cpython-312.pyc10030644editdlrm
argparse.cpython-312.pyc1016820644editdlrm
ast.cpython-312.pyc1002790644editdlrm
base64.cpython-312.pyc244080644editdlrm
bdb.cpython-312.pyc373590644editdlrm
bisect.cpython-312.pyc36410644editdlrm
bz2.cpython-312.pyc151330644editdlrm
calendar.cpython-312.pyc396210644editdlrm
cgi.cpython-312.pyc402280644editdlrm
cgitb.cpython-312.pyc173320644editdlrm
chunk.cpython-312.pyc73100644editdlrm
cmd.cpython-312.pyc186190644editdlrm
code.cpython-312.pyc130510644editdlrm
codecs.cpython-312.pyc422740644editdlrm
codeop.cpython-312.pyc69160644editdlrm
colorsys.cpython-312.pyc46420644editdlrm
compileall.cpython-312.pyc204970644editdlrm
configparser.cpython-312.pyc635820644editdlrm
contextlib.cpython-312.pyc303760644editdlrm
contextvars.cpython-312.pyc2610644editdlrm
copy.cpython-312.pyc98000644editdlrm
copyreg.cpython-312.pyc74140644editdlrm
cProfile.cpython-312.pyc85930644editdlrm
crypt.cpython-312.pyc53610644editdlrm
csv.cpython-312.pyc177880644editdlrm
dataclasses.cpython-312.pyc446780644editdlrm
datetime.cpython-312.pyc4090644editdlrm
decimal.cpython-312.pyc4060644editdlrm
difflib.cpython-312.pyc754990644editdlrm
dis.cpython-312.pyc345600644editdlrm
doctest.cpython-312.pyc1056860644editdlrm
enum.cpython-312.pyc807080644editdlrm
filecmp.cpython-312.pyc146610644editdlrm
fileinput.cpython-312.pyc202800644editdlrm
fnmatch.cpython-312.pyc64950644editdlrm
fractions.cpython-312.pyc366670644editdlrm
ftplib.cpython-312.pyc426360644editdlrm
functools.cpython-312.pyc405060644editdlrm
genericpath.cpython-312.pyc68220644editdlrm
getopt.cpython-312.pyc83630644editdlrm
getpass.cpython-312.pyc68500644editdlrm
gettext.cpython-312.pyc221510644editdlrm
glob.cpython-312.pyc98410644editdlrm
graphlib.cpython-312.pyc103270644editdlrm
gzip.cpython-312.pyc320150644editdlrm
hashlib.cpython-312.pyc80870644editdlrm
heapq.cpython-312.pyc179560644editdlrm
hmac.cpython-312.pyc106980644editdlrm
imaplib.cpython-312.pyc628890644editdlrm
imghdr.cpython-312.pyc69440644editdlrm
inspect.cpython-312.pyc1334460644editdlrm
io.cpython-312.pyc41390644editdlrm
ipaddress.cpython-312.pyc907620644editdlrm
keyword.cpython-312.pyc10410644editdlrm
linecache.cpython-312.pyc64010644editdlrm
locale.cpython-312.pyc595360644editdlrm
lzma.cpython-312.pyc158550644editdlrm
mailbox.cpython-312.pyc1116180644editdlrm
mailcap.cpython-312.pyc111550644editdlrm
mimetypes.cpython-312.pyc241850644editdlrm
modulefinder.cpython-312.pyc279440644editdlrm
netrc.cpython-312.pyc89030644editdlrm
nntplib.cpython-312.pyc449390644editdlrm
ntpath.cpython-312.pyc260330644editdlrm
nturl2path.cpython-312.pyc30340644editdlrm
numbers.cpython-312.pyc139670644editdlrm
opcode.cpython-312.pyc147160644editdlrm
operator.cpython-312.pyc173640644editdlrm
optparse.cpython-312.pyc675460644editdlrm
os.cpython-312.pyc434740644editdlrm
pathlib.cpython-312.pyc620980644editdlrm
pdb.cpython-312.pyc849190644editdlrm
pickle.cpython-312.pyc761760644editdlrm
pickletools.cpython-312.pyc811280644editdlrm
pipes.cpython-312.pyc109140644editdlrm
pkgutil.cpython-312.pyc199590644editdlrm
platform.cpython-312.pyc416000644editdlrm
plistlib.cpython-312.pyc412860644editdlrm
poplib.cpython-312.pyc184460644editdlrm
posixpath.cpython-312.pyc182360644editdlrm
pprint.cpython-312.pyc294740644editdlrm
profile.cpython-312.pyc225400644editdlrm
pstats.cpython-312.pyc379220644editdlrm
pty.cpython-312.pyc73630644editdlrm
pyclbr.cpython-312.pyc148870644editdlrm
pydoc.cpython-312.pyc1429550644editdlrm
py_compile.cpython-312.pyc100780644editdlrm
queue.cpython-312.pyc147320644editdlrm
quopri.cpython-312.pyc93230644editdlrm
random.cpython-312.pyc331530644editdlrm
reprlib.cpython-312.pyc99090644editdlrm
rlcompleter.cpython-312.pyc82820644editdlrm
runpy.cpython-312.pyc143850644editdlrm
sched.cpython-312.pyc77350644editdlrm
secrets.cpython-312.pyc25560644editdlrm
selectors.cpython-312.pyc261280644editdlrm
shelve.cpython-312.pyc129130644editdlrm
shlex.cpython-312.pyc141620644editdlrm
shutil.cpython-312.pyc681130644editdlrm
signal.cpython-312.pyc44480644editdlrm
site.cpython-312.pyc290630644editdlrm
sitecustomize.cpython-312.pyc3000644editdlrm
smtplib.cpython-312.pyc482210644editdlrm
sndhdr.cpython-312.pyc107120644editdlrm
socket.cpython-312.pyc418170644editdlrm
socketserver.cpython-312.pyc342580644editdlrm
sre_compile.cpython-312.pyc6250644editdlrm
sre_constants.cpython-312.pyc6280644editdlrm
sre_parse.cpython-312.pyc6210644editdlrm
ssl.cpython-312.pyc630110644editdlrm
stat.cpython-312.pyc52310644editdlrm
statistics.cpython-312.pyc554230644editdlrm
string.cpython-312.pyc114820644editdlrm
stringprep.cpython-312.pyc251600644editdlrm
struct.cpython-312.pyc3250644editdlrm
subprocess.cpython-312.pyc791870644editdlrm
sunau.cpython-312.pyc254230644editdlrm
symtable.cpython-312.pyc187810644editdlrm
sysconfig.cpython-312.pyc300010644editdlrm
tabnanny.cpython-312.pyc121560644editdlrm
tarfile.cpython-312.pyc1233880644editdlrm
telnetlib.cpython-312.pyc284230644editdlrm
tempfile.cpython-312.pyc473390644editdlrm
textwrap.cpython-312.pyc182930644editdlrm
this.cpython-312.pyc14080644editdlrm
threading.cpython-312.pyc653460644editdlrm
timeit.cpython-312.pyc148640644editdlrm
token.cpython-312.pyc35570644editdlrm
tokenize.cpython-312.pyc247750644editdlrm
trace.cpython-312.pyc330240644editdlrm
traceback.cpython-312.pyc515230644editdlrm
tracemalloc.cpython-312.pyc269070644editdlrm
tty.cpython-312.pyc26680644editdlrm
turtle.cpython-312.pyc1846320644editdlrm
types.cpython-312.pyc149390644editdlrm
typing.cpython-312.pyc1418600644editdlrm
uu.cpython-312.pyc78160644editdlrm
uuid.cpython-312.pyc330070644editdlrm
warnings.cpython-312.pyc237920644editdlrm
wave.cpython-312.pyc320840644editdlrm
weakref.cpython-312.pyc313480644editdlrm
webbrowser.cpython-312.pyc263530644editdlrm
xdrlib.cpython-312.pyc118410644editdlrm
zipapp.cpython-312.pyc99770644editdlrm
zipimport.cpython-312.pyc244750644editdlrm
_aix_support.cpython-312.pyc47590644editdlrm
_collections_abc.cpython-312.pyc459120644editdlrm
_compat_pickle.cpython-312.pyc72210644editdlrm
_compression.cpython-312.pyc74970644editdlrm
_distutils_system_mod.cpython-312.pyc78180644editdlrm
_markupbase.cpython-312.pyc122790644editdlrm
_osx_support.cpython-312.pyc177310644editdlrm
_pydatetime.cpython-312.pyc941930644editdlrm
_pydecimal.cpython-312.pyc2278070644editdlrm
_pyio.cpython-312.pyc1102690644editdlrm
_pylong.cpython-312.pyc99830644editdlrm
_py_abc.cpython-312.pyc70540644editdlrm
_sitebuiltins.cpython-312.pyc47600644editdlrm
_strptime.cpython-312.pyc241160644editdlrm
_sysconfigdata__linux_x86_64-linux-gnu.cpython-312.pyc586510644editdlrm
_sysconfigdata__x86_64-linux-gnu.cpython-312.pyc586450644editdlrm
_threading_local.cpython-312.pyc82950644editdlrm
_weakrefset.cpython-312.pyc117510644editdlrm
__future__.cpython-312.pyc47040644editdlrm
__hello__.cpython-312.pyc8700644editdlrm
Edit: /snap/core24/1643/usr/lib/python3.12/__pycache__/smtplib.cpython-312.pyc (48221B)
Цi dZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl mZgdZdZdZdZdZd Zd Zej.d ej0ZGd d eZGddeZGddeZGddeZGddeZGddeZ GddeZ!GddeZ"GddeZ#GddeZ$d Z%d!Z&d"Z'd#Z(d$Z) ddl*Z*d%Z+Gd'd(Z-e+rGd)d*e-Z.ej_d*d+Z0Gd,d-e-Z1e2d.k(rd/Z3e3d0Z4e3d1jkd2Z6e7d3d4Z8e jrjuxZ;r"e8e;zZ8e jrjuxZ;r"e7d5e>> import smtplib >>> s=smtplib.SMTP("localhost") >>> print(s.help()) This is Sendmail version 8.8.4 Topics: HELO EHLO MAIL RCPT DATA RSET NOOP QUIT HELP VRFY EXPN VERB ETRN DSN For more info use "HELP ". To report bugs in the implementation send email to sendmail-bugs@sendmail.org. For local information send email to Postmaster at your site. End of HELP info >>> s.putcmd("vrfy","someone@here") >>> s.getreply() (250, "Somebody OverHere ") >>> s.quit() N) body_encode) SMTPExceptionSMTPNotSupportedErrorSMTPServerDisconnectedSMTPResponseExceptionSMTPSenderRefusedSMTPRecipientsRefused SMTPDataErrorSMTPConnectError SMTPHeloErrorSMTPAuthenticationError quoteaddr quotedataSMTPi s i z auth=(.*)ceZdZdZy)rz4Base class for all exceptions raised by this module.N__name__ __module__ __qualname____doc__/usr/lib/python3.12/smtplib.pyrrHs>rrceZdZdZy)rzThe command or option is not supported by the SMTP server. This exception is raised when an attempt is made to run a command or a command with an option which is not supported by the server. NrrrrrrKrrceZdZdZy)rzNot connected to any SMTP server. This exception is raised when the server unexpectedly disconnects, or when an attempt is made to use the SMTP instance before connecting it to a server. NrrrrrrRsrrceZdZdZdZy)ra2Base class for all exceptions that include an SMTP error code. These exceptions are generated in some instances when the SMTP server returns an error code. The error code is stored in the `smtp_code' attribute of the error, and the `smtp_error' attribute is set to the error message. c2||_||_||f|_yN) smtp_code smtp_errorargs)selfcodemsgs r__init__zSMTPResponseException.__init__cs3K rNrrrrr)rrrrrZs  rrceZdZdZdZy)rzSender address refused. In addition to the attributes set by on all SMTPResponseException exceptions, this sets `sender' to the string that the SMTP refused. cB||_||_||_|||f|_yr")r#r$senderr%)r&r'r(r-s rr)zSMTPSenderRefused.__init__os% 3' rNr*rrrrrhs  (rrceZdZdZdZy)r zAll recipient addresses refused. The errors for each recipient are accessible through the attribute 'recipients', which is a dictionary of exactly the same sort as SMTP.sendmail() returns. c"||_|f|_yr") recipientsr%)r&r0s rr)zSMTPRecipientsRefused.__init__}s$M rNr*rrrr r us "rr ceZdZdZy)r z'The SMTP server didn't accept the data.Nrrrrr r s1rr ceZdZdZy)r z&Error during connection establishment.Nrrrrr r s0rr ceZdZdZy)r z"The server refused our HELO reply.Nrrrrr r s,rr ceZdZdZy)r zvAuthentication error. Most probably the server didn't accept the username/password combination provided. Nrrrrr r rrr ctjj|\}}||fdk(r&|jj dr|Sd|zSd|zS)zQuote a subset of the email addresses defined by RFC 821. Should be able to handle anything email.utils.parseaddr can handle. r7)emailutils parseaddrstrip startswith addrstring displaynameaddrs rrrs\  --j9KTh&     ( ( -  "" D=rc\tjj|\}}||fdk(r|S|S)Nr6)r9r:r;r>s r _addr_onlyrCs3 --j9KTh& Krc btjddtjdt|S)zQuote data for email. Double leading '.', and change Unix newline '\n', or Mac '\r' into internet CRLF end-of-line. z(?m)^\.z..(?:\r\n|\n|\r(?!\n))resubCRLFdatas rrrs* 66*d &d3 55rc0tjdd|S)Ns(?m)^\.s..)rGrH)bindatas r_quote_periodsrNs 66+ug ..rc8tjdt|S)NrErFrJs r _fix_eolsrPs FF*D$ 77rTFcTeZdZdZdZdZdZdZdZdZ dZ e Z ddde jdfdZdZd Zd Zd Zd Zd,d ZdZd-dZdZd-dZd-dZd-dZdZd-dZdZdZdZ d.dZ!d.dZ"dZ#dZ$e$Z%dZ&dZ'dd d!Z(d/d"Z)d/d#Z*d/d$Z+dd d%Z,dd&d'Z- d0d(Z. d1d)Z/d*Z0d+Z1y)2raThis class manages a connection to an SMTP or ESMTP server. SMTP Objects: SMTP objects have the following attributes: helo_resp This is the message given by the server in response to the most recent HELO command. ehlo_resp This is the message given by the server in response to the most recent EHLO command. This is usually multiline. does_esmtp This is a True value _after you do an EHLO command_, if the server supports ESMTP. esmtp_features This is a dictionary, which, if the server supports ESMTP, will _after you do an EHLO command_, contain the names of the SMTP service extensions this server supports, and their parameters (if any). Note, all extension names are mapped to lower case in the dictionary. See each method's docstrings for details. In general, there is a method of the same name to perform each SMTP command. There is also a method called 'sendmail' that will do an entire mail transaction. rNehloFr7c||_||_i|_d|_||_d|_|r6|j ||\}}|dk7r|jt|||||_ ytj}d|vr||_ yd} tjtj} d| z|_ y#tj$rY wxYw)aInitialize a new instance. If specified, `host` is the name of the remote host to which to connect. If specified, `port` specifies the port to which to connect. By default, smtplib.SMTP_PORT is used. If a host is specified the connect method is called, and if it returns anything other than a success code an SMTPConnectError is raised. If specified, `local_hostname` is used as the FQDN of the local host in the HELO/EHLO command. Otherwise, the local hostname is found using socket.getfqdn(). The `source_address` parameter takes a 2-tuple (host, port) for the socket to bind to as its source address before connecting. If the host is '' and port is 0, the OS default behavior will be used. asciirN.z 127.0.0.1z[%s])_hosttimeoutesmtp_featurescommand_encodingsource_address_auth_challenge_countconnectcloser local_hostnamesocketgetfqdn gethostbyname gethostnamegaierror) r&hostportr_rXr[r'r(fqdnrAs rr)z SMTP.__init__s$    ',%&" ,,tT2KT3s{ &tS11  %"0D  >>#Dd{&*##!//0B0B0DED'-tm#s'CCCc|Sr"rr&s r __enter__zSMTP.__enter__s rc |jd\}}|dk7r t|| |jy#t$rYwxYw#|jwxYw)NQUIT)docmdrrr^)r&r%r'messages r__exit__z SMTP.__exit__s]  JJv.MD's{+D':: JJL&    JJLs&%9A AAAAAc||_y)zSet the debug output level. A non-false value results in debug messages for connection and for all messages sent to and received from the server. N) debuglevel)r&rrs rset_debuglevelzSMTP.set_debuglevel"s %rc|jdkDrHttjjj g|dt j iyt|dt j iy)Nfile)rrprintdatetimenowtimesysstderrr&r%s r _print_debugzSMTP._print_debug+sM ??Q  (##'')..0 I4 Icjj I 4 )cjj )rc| |s td|jdkDr|jd||f|jt j ||f||jS)N0Non-blocking socket (timeout=0) is not supportedrz connect: to) ValueErrorrrr~r[r`create_connection)r&rerfrXs r _get_socketzSMTP._get_socket1sd  wOP P ??Q    mdD\4;N;N O''t g(,(;(;= =rc |r||_|sR|jd|jdk(r/|jd}|dk\r|d|||dzd}} t|}|s |j }tjd||||j|||j|_ d|_ |j\}}|jdkDr|jdt!|||fS#t$r t dwxYw)apConnect to a host on a given port. If the hostname ends with a colon (`:') followed by a number, and there is no port specified, that suffix will be stripped off and the number interpreted as the port number to use. Note: This method is automatically invoked by __init__, if a host is specified during instantiation. :rNruznonnumeric portzsmtplib.connectconnect:)r[findrfindintrOSError default_portr{auditrrXsockrvgetreplyrrr~repr)r&rerfr[ir'r(s rr]z SMTP.connect;s "0D 34::c?: 3AAv!"1XtAEF|d5t9D$$D #T46$$T4>  mmo s ??Q    j$s) 4c{"5!"3445s  C..Dc|jdkDr|jdt||jr_t |t r|j |j}tjd|| |jj|ytd#t$r|jtdwxYw)zSend `s' to the server.rzsend:z smtplib.sendServer not connectedzplease run connect() firstN)rrr~rr isinstancestrencoderZr{rsendallrr^r)r&ss rsendz SMTP.send\s ??Q    gtAw / 99!S!HHT223 IIndA . E !!!$ ))EF F  E ,-CDD Es :B!!%Cc|dk(r|}n|d|}d|vsd|vr0|jddjdd}td||j|ty) zSend a command to the server.r7   z\nz\rz=command and arguments contain prohibited newline characters: N)replacerrrI)r&cmdr%rs rputcmdz SMTP.putcmdosu 2:A%qA 19  $&..tU;AOPQsS  QCv,rcg}|j |jjd|_ |jjtdz}|s|j td|jdkDr|jdt|t|tkDr|j tdd |j|d djd |dd } t!|}|d d dk7rndj%|}|jdkDr|jd|d|||fS#t $r,}|j tdt|zd}~wwxYw#t"$rd }YwxYw)aGet a reply from the server. Returns a tuple consisting of: - server response code (e.g. '250', or such, if all goes well) Note: returns -1 if it can't read response code. - server response string corresponding to response code (multiline responses are converted to a single, multiline string). Raises SMTPServerDisconnected if end-of-file is reached. Nrbruz Connection unexpectedly closed: zConnection unexpectedly closedrzreply:izLine too long.s - zreply: retcode (z); Msg: )rvrmakefilereadline_MAXLINErr^rrrrr~rlenrappendr<rrjoin)r&resplineer'errcodeerrmsgs rrz SMTP.getreply|sz 99  **40DI 7yy))(Q,7  ,-MNN"!!(DJ74y8# +C1ABB KKQRz2 38D d) AayD 58D! ??Q    P Q9 7 ,-O/21v.677 7$  s)"E1 E9 E6 'E11E69 FFcF|j|||jS)z-Send a command, and return its response code.rr)r&rr%s rrnz SMTP.docmds C}}rc~|jd|xs |j|j\}}||_||fS)zwSMTP 'helo' command. Hostname to send for this command defaults to the FQDN of the local host. helo)rr_r helo_resp)r&namer'r(s rrz SMTP.helos= FD7D$7$78mmo sc{rci|_|j|j|xs |j|j \}}|dk(r)t |dk(r|j td||_|dk7r||fSd|_ t|jtsJt|j|jjdjd}|d=|D]}tj!|}|rB|jj#dd d z|j%ddz|jd<]t'j d |}|sv|j)d j+}|j,|j/d d j1} |dk(r0|jj#|d d z| z|j|<| |j|<||fS)zx SMTP 'ehlo' command. Hostname to send for this command defaults to the FQDN of the local host. rrrTzlatin-1rauthr7rz((?P[A-Za-z0-9][A-Za-z0-9\-]*) ?featureN)rYrehlo_msgr_rrr^r ehlo_resp does_esmtprbytesrdecodesplit OLDSTYLE_AUTHmatchgetgroupsrGgrouplowerstringendr<) r&rr'r(reach auth_matchmrparamss rrRz SMTP.ehlos ! DMM4#>4+>+>?mmo s 2:#c(a- JJL()?@ @ 3;#; $..%0F$t~~2FF0~~$$Y/55d; G :D',,T2J.2.A.A.E.Efb.Q/ * 1 1! 4Q 7/8##F+ DdKA''),224!%% "2"34::<f$373F3F3J3J7TV3W!4"$*4+D''04:D''05 :6c{rc:|j|jvS)z7Does the server support a given SMTP service extension?)rrY)r&opts rhas_extnz SMTP.has_extnsyy{d1111rcL|jd||jdS)z;SMTP 'help' command. Returns help text from server.helprurr}s rrz SMTP.helps# FD!}}q!!rc2d|_|jdS)z&SMTP 'rset' command -- resets session.rTrset)rZrnris rrz SMTP.rsets 'zz&!!rcD |jy#t$rYywxYw)aInternal 'rset' command which ignores any SMTPServerDisconnected error. Used internally in the library, since the server disconnected error should appear to the application when the *next* command is issued, if we are doing an internal "safety" reset. N)rrris r_rsetz SMTP._rsets"  IIK%   s  c$|jdS)z-SMTP 'noop' command -- doesn't do anything :>noop)rnris rrz SMTP.noop szz&!!rcd}|rV|jrJtd|Dr$|jdrd|_n t dddj |z}|j ddt|||jS) a8SMTP 'mail' command -- begins mail xfer session. This method may raise the following exceptions: SMTPNotSupportedError The options parameter includes 'SMTPUTF8' but the SMTPUTF8 extension is not supported by the server. r7c3BK|]}|jdk(yw)smtputf8N)r).0xs r zSMTP.mail..s:Q1779j(:srzutf-8z SMTPUTF8 not supported by serverrmailzFROM:) ranyrrZrrrrr)r&r-options optionlists rrz SMTP.mails{ t:'::==,,3D)/:<<sxx00J F9V+> !dnn&<499;q>0S0#yy{ tt*s*'d33+1'= !rTinitial_response_okcH|j}|r|nd}|?t|jdd}|jd|dz|z\}}d|_n|jd|\}}d|_|d k(r|xjdz c_t j |}t||jdd}|j|\}}|jtkDrtd t||fz|d k(r|d vr||fSt||) aAuthentication command - requires response processing. 'mechanism' specifies which authentication mechanism is to be used - the valid values are those listed in the 'auth' element of 'esmtp_features'. 'authobject' must be a callable object taking a single argument: data = authobject(challenge) It will be called to process the server's challenge response; the challenge argument it is passed will be a bytes. It should return an ASCII string that will be base64 encoded and sent to the server. Keyword arguments: - initial_response_ok: Allow sending the RFC 4954 initial-response to the AUTH command, if the authentication methods supports it. NrTr7)eolAUTHrruriNz4Server AUTH mechanism infinite loop. Last response: i) upper encode_base64rrnr\base64 decodebytes _MAXCHALLENGErrr ) r& mechanism authobjectrinitial_responseresponser'r challenges rrz SMTP.authhs-,OO% ,?JLT  '$%5%<%99 == rc|j|jds td|jdj }gd}|Dcgc]}||vr| }}|s t d||c|_|_|D]Q}d|jjddz} |j|t|| |\} } | d vr| | fcSS cc}w#t$r } | } Yd } ~ kd } ~ wwxYw) awLog in on an SMTP server that requires authentication. The arguments are: - user: The user name to authenticate with. - password: The password for the authentication. Keyword arguments: - initial_response_ok: Allow sending the RFC 4954 initial-response to the AUTH command, if the authentication methods supports it. If there has been no previous EHLO or HELO command this session, this method tries ESMTP EHLO first. This method will return normally if the authentication was successful. This method may raise the following exceptions: SMTPHeloError The server didn't reply properly to the helo greeting. SMTPAuthenticationError The server didn't accept the username/ password combination. SMTPNotSupportedError The AUTH command is not supported by the server. SMTPException No suitable authentication method was found. rz,SMTP AUTH extension not supported by server.)zCRAM-MD5PLAINLOGINz(No suitable authentication method found.auth_-_rrN) rrrrYrrr rrrrgetattrr )r&r rradvertised_authlistpreferred_authsrauthlist authmethod method_namer'rrlast_exceptions rloginz SMTP.logins08 ##%}}V$'>@ @#11&9??A9&54T2244 JK K $(  4=" #J!J$4$4$6$>$>sC$HHK ##yyk :(; ) = t :% $<'& #/4&+ #!" #s C&(C C/#C**C/)contextc|j|jds td|jd\}}|dk(rzts t d|t j}|j|j|j|_ d|_ d|_ d|_ i|_d|_||fSt!||) aPuts the connection to the SMTP server into TLS mode. If there has been no previous EHLO or HELO command this session, this method tries ESMTP EHLO first. If the server supports TLS, this will encrypt the rest of the SMTP session. If you provide the context parameter, the identity of the SMTP server and client can be checked. This, however, depends on whether the socket module really checks the certificates. This method may raise the following exceptions: SMTPHeloError The server didn't reply properly to the helo greeting. starttlsz+STARTTLS extension not supported by server.STARTTLSrUz&No SSL support included in this PythonNserver_hostnameF)rrrrn _have_ssl RuntimeErrorssl_create_stdlib_context wrap_socketrrWrvrrrYrr)r&r&rreplys rr(z SMTP.starttlss" ##%}}Z('=? ? :. u 3;"#KLL446++DII<@JJ,HDIDI "DN!DN"$D #DO e}(e4 4rcz|jg}t|trt|j d}|j rF|j dr|jdt|z|D]}|j||j||\}} |dk7r3|dk(r|jn|jt|| |i} t|tr|g}|D]H} |j| |\}} |dk7r |dk7r|| f| | <|dk(s/|jt| t| t|k(r|jt| |j|\}} |dk7r2|dk(r|jn|jt!|| | S)a| This command performs an entire mail transaction. The arguments are: - from_addr : The address sending this mail. - to_addrs : A list of addresses to send this mail to. A bare string will be treated as a list with 1 address. - msg : The message to send. - mail_options : List of ESMTP options (such as 8bitmime) for the mail command. - rcpt_options : List of ESMTP options (such as DSN commands) for all the rcpt commands. msg may be a string containing characters in the ASCII range, or a byte string. A string is encoded to bytes using the ascii codec, and lone \r and \n characters are converted to \r\n characters. If there has been no previous EHLO or HELO command this session, this method tries ESMTP EHLO first. If the server does ESMTP, message size and each of the specified options will be passed to it. If EHLO fails, HELO will be tried and ESMTP options suppressed. This method will return normally if the mail is accepted for at least one recipient. It returns a dictionary, with one entry for each recipient that was refused. Each entry contains a tuple of the SMTP error code and the accompanying error message sent by the server. This method may raise the following exceptions: SMTPHeloError The server didn't reply properly to the helo greeting. SMTPRecipientsRefused The server rejected ALL recipients (no mail was sent). SMTPSenderRefused The server didn't accept the from_addr. SMTPDataError The server replied with an unexpected error code (other than a refusal of a recipient). SMTPNotSupportedError The mail_options parameter includes 'SMTPUTF8' but the SMTPUTF8 extension is not supported by the server. Note: the connection will be open even after an exception is raised. Example: >>> import smtplib >>> s=smtplib.SMTP("localhost") >>> tolist=["one@one.org","two@two.org","three@three.org","four@four.org"] >>> msg = '''\ ... From: Me@my.org ... Subject: testin'... ... ... This is a test ''' >>> s.sendmail("me@my.org",tolist,msg) { "three@three.org" : ( 550 ,"User unknown" ) } >>> s.quit() In the above example, the message was accepted for delivery to three of the four addresses, and one was rejected, with the error code 550. If all addresses are accepted, then the method will return an empty dictionary. rTsizezsize=%dri)rrrrPrrrrrrr^rrrr rKr ) r& from_addrto_addrsr( mail_options rcpt_options esmtp_optsoptionr'rsenderrsrs rsendmailz SMTP.sendmails@ ##% c3 C.''0C ??}}V$!!)c#h"67& *!!&) *yyJ7 t 3;s{  #D$ : : h $ zH 6D99T<8LT4 $#+"&s{ +H55  6 x=CM ) JJL'1 1yy~ t 3;s{  d+ +rc0|j|jd}|d}nt|dk(rd}n td|=|dz|vr||dzn||dz}tj j |gd d}|U||d z||d z||d zfDcgc]}||} }tj j | D cgc]} | d }} tj|} | d =| d =d} dj|g|jdtj5} | rEtjj!| |j"j%d}g|dd}ntjj!| }|j'| d| j)}ddd|j+||||Scc}wcc} w#t$r!|jds tdd} YwxYw#1swYUxYw)a~Converts message to a bytestring and passes it to sendmail. The arguments are as for sendmail, except that msg is an email.message.Message object. If from_addr is None or to_addrs is None, these arguments are taken from the headers of the Message as described in RFC 2822 (a ValueError is raised if there is more than one set of 'Resent-' headers). Regardless of the values of from_addr and to_addr, any Bcc field (or Resent-Bcc field, when the Message is a resent) of the Message object won't be transmitted. The Message object is then serialized using email.generator.BytesGenerator and sendmail is called to transmit the message. If the sender or any of the recipient addresses contain non-ASCII and the server advertises the SMTPUTF8 capability, the policy is cloned with utf8 set to True for the serialization, and SMTPUTF8 and BODY=8BITMIME are asserted on the send. If the server does not support SMTPUTF8, an SMTPNotSupported error is raised. Otherwise the generator is called without modifying the policy. z Resent-DateNr7ruzResent-z0message has more than one 'Resent-' header blockSenderFromrToBccCcz Resent-BccFrTrzOne or more source or delivery addresses require internationalized email support, but the server does not advertise the required SMTPUTF8 capabilityT)utf8)policySMTPUTF8z BODY=8BITMIMEr)linesep)rget_allrrr9r: getaddressescopyrrUnicodeEncodeErrorrrioBytesIO generatorBytesGeneratorrDcloneflattengetvaluer<)r&r(r5r6r7r8resent header_prefixf addr_fieldsamsg_copy internationalbytesmsggflatmsgs r send_messagezSMTP.send_messages[> ##%]+ >M [A %MOP P   -x7C?]X56 #MF$: ;  00)=a@CI  '*=4+?'@'*=5+@'A'*=4+?'@'B- m-K-',kk&>&>{&KL!LHL99S> UO \ "  ! GGY** + 2 27 ;ZZ\ *XOO22SZZ%5%54%5%@3BKKzK?K OO228< IIhI /'')G *}}Y'<)+ +9-M" !==,+KLL!M  ! * *s+ G G7#G.B H 'H H  Hc |j}d|_|r|j|j}d|_|r|jyy#|j}d|_|r|jwwxYw)z(Close the connection to the SMTP server.N)rvr^r)r&rvrs rr^z SMTP.closesi 99DDI 99DDI 99DDI s %A(A6c|jd}dx|_|_i|_d|_|j |S)zTerminate the SMTP session.quitNF)rnrrrYrr^)r&ress rr_z SMTP.quits;jj *..   r localhostrN)r7)rr")rr)NNrr)2rrrrrrrrvrrrr SMTP_PORTrr`_GLOBAL_DEFAULT_TIMEOUTr)rjrprsr~rr]rrrrnrrRrrrrrrrrKrrrrrrrrr%r(r<r\r^r_rrrrrs& 8J D DIHIJLQt77 $.4`%* =BG&  /b 1f2" " "*: D4"BF.2`I7 !<@@D#'+Z?A fP:>35K+Z rrcLeZdZdZeZdejddddZfdZ xZ S)SMTP_SSLa This is a subclass derived from SMTP that connects over an SSL encrypted socket (to use this class you need a socket module that was compiled with SSL support). If host is not specified, '' (the local host) is used. If port is omitted, the standard SMTP-over-SSL port (465) is used. local_hostname and source_address have the same meaning as they do in the SMTP class. context also optional, can contain a SSLContext. N)rXr[r&cr|tj}||_tj ||||||yr")r.r/r&rr))r&rerfr_rXr[r&s rr)zSMTP_SSL.__init__s7446"DL MM$dNG( *rc|jdkDr|jd||ft| |||}|jj ||j }|S)Nrrr*)rrr~superrr&r0rW)r&rerfrX new_socket __class__s rrzSMTP_SSL._get_sockets_"!!*tTl;,T4AJ11*BF**2NJ r)r7rN) rrrr SMTP_SSL_PORTrr`rdr)r __classcell__rks@rrfrfs1 %  * & > >$($ *  rrficReZdZdZdZdeddejffd Zdfd Z xZ S)LMTPaLMTP - Local Mail Transfer Protocol The LMTP protocol, which is very similar to ESMTP, is heavily based on the standard SMTP client. It's common to use Unix sockets for LMTP, so our connect() method must support that as well as a regular host:port server. local_hostname and source_address have the same meaning as they do in the SMTP class. To specify a Unix socket, you must use an absolute path as the host, starting with a '/'. Authentication is supported, using the regular SMTP mechanism. When using a Unix socket, LMTP generally don't support or require any authentication, but your mileage might vary.lhlor7Nc.t||||||y)zInitialize a new instance.)r_r[rXN)rir))r&rerfr_r[rXrks rr)z LMTP.__init__ s# tN(6  Irc|ddk7rt||||S|j|js td t jtj tj |_|jtjur%|jj|jd|_ |jj||j\}}|jdkDr|jd|||fS#t$rP|jdkDr|jd||jr|jjd|_wxYw)z=Connect to the LMTP daemon, on either a Unix or a TCP socket.r/)r[Nrz connect fail:r)rir]rXrr`AF_UNIX SOCK_STREAMrrd settimeoutrvrrrr~r^r)r&rerfr[r'r(rks rr]z LMTP.connect&s$ 7c>7?4n?M M << #DLLOP P  fnnf6H6HIDI||6#A#AA $$T\\2DI II  d #mmo s ??Q    j# .c{ "!!/48yy !DI   sBDAE+ra) rrrrr LMTP_PORTr`rdr)r]rmrns@rrprps1 4HYt $f.L.LI rrp__main__ctjj|dztjjtjj j S)Nz: )r{stdoutwriteflushstdinrr<)prompts rrrEsD $' yy!!#))++rr?r@,zEnter message, end with ^D:r7zMessage length is %drbru)Arr`rKrG email.utilsr9 email.messageemail.generatorrr rIrxr{email.base64mimerr__all__rcrlrIrrrcompileIrrrrrrrr r r r r rrCrrNrPr.r, ImportErrorrrfrrxrprrfromaddrrtoaddrsrwr(r~rrrserverrsr<r_rrrrs)R   9 -       <. ?G?M]  M   (- ( "M "2)21,1-)-3 5/8Ii i V 4< NN:  /4/h z, f~HTl  %G '( C))$$& &$ &Dj))$$& &$ & 3s8 +, + F ! OOHgs+ KKM#YIs GG#"G#