Ë ‚Ö¦i ªãóÌ—dZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z ddl mZgd¢ZdZdZdZdZd Zd Zej.d ej0«ZGd „d e«ZGd„de«ZGd„de«ZGd„de«ZGd„de«ZGd„de«Z Gd„de«Z!Gd„de«Z"Gd„de«Z#Gd„de«Z$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(r¸d/„Z3e3d0«Z4e3d1«jkd2«Z6e7d3«d4Z8e jrju«xZ;r"e8e;zZ8e jrju«xZ;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) Ú SMTPExceptionÚSMTPNotSupportedErrorÚSMTPServerDisconnectedÚSMTPResponseExceptionÚSMTPSenderRefusedÚSMTPRecipientsRefusedÚ SMTPDataErrorÚSMTPConnectErrorÚ SMTPHeloErrorÚSMTPAuthenticationErrorÚ quoteaddrÚ quotedataÚSMTPéiÑú s i éz auth=(.*)có—eZdZdZy)rz4Base class for all exceptions raised by this module.N©Ú__name__Ú __module__Ú __qualname__Ú__doc__©óú /usr/lib64/python3.12/smtplib.pyrrHs„Ú>rrcó—eZdZdZy)rzÌThe 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. NrrrrrrKó„òrrcó—eZdZdZy)rzÌNot 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. NrrrrrrRs„òrrcó—eZdZdZd„Zy)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. có2—||_||_||f|_y©N)Ú smtp_codeÚ smtp_errorÚargs)ÚselfÚcodeÚmsgs rÚ__init__zSMTPResponseException.__init__cs€ØˆŒØˆŒØ˜3�Kˆ� rN©rrrrr)rrrrrZs „ñó rrcó—eZdZdZd„Zy)rz«Sender address refused. In addition to the attributes set by on all SMTPResponseException exceptions, this sets `sender' to the string that the SMTP refused. cóB—||_||_||_|||f|_yr")r#r$Úsenderr%)r&r'r(r-s rr)zSMTPSenderRefused.__init__os%€ØˆŒØˆŒØˆŒ ؘ3 Ð'ˆ� rNr*rrrrrhs „ñó (rrcó—eZdZdZd„Zy)r zÎAll 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 có—eZdZdZy)r z'The SMTP server didn't accept the data.Nrrrrr r ‚s„Ú1rr có—eZdZdZy)r z&Error during connection establishment.Nrrrrr r …s„Ú0rr có—eZdZdZy)r z"The server refused our HELO reply.Nrrrrr r ˆs„Ú,rr có—eZdZdZy)r zvAuthentication error. Most probably the server didn't accept the username/password combination provided. Nrrrrr r ‹rrr cóª—tjj|«\}}||fdk(r&|j«j d«r|Sd|zSd|zS)z‡Quote a subset of the email addresses defined by RFC 821. Should be able to handle anything email.utils.parseaddr can handle. ©Úr7Ú)ÚemailÚutilsÚ parseaddrÚstripÚ startswith©Ú addrstringÚ displaynameÚaddrs rrr’s\€ô Ÿ ™ ×-Ñ-¨jÓ9Ñ€K�Ø�TИhÒ&à × Ñ Ó × (Ñ (¨Ô -ØÐ ؘ Ñ"Ð"Ø �D‰=Ðrcó\—tjj|«\}}||fdk(r|S|S)Nr6)r9r:r;r>s rÚ _addr_onlyrCŸs3€ÜŸ ™ ×-Ñ-¨jÓ9Ñ€K�Ø�TИhÒ&àÐØ €Krc ób—tjddtjdt|««S)z�Quote 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))©ÚreÚsubÚCRLF©Údatas rrr§s*€ô �6‰6�*˜dÜ �‰Ð&¬¨dÓ3ó 5ð5rcó0—tjdd|«S)Ns(?m)^\.s..)rGrH)Úbindatas rÚ_quote_periodsrN°s€Ü �6‰6�+˜u gÓ .Ð.rcó8—tjdt|«S)NrErFrJs rÚ _fix_eolsrP³s€Ü �F‰FÐ*¬D°$Ó 7Ð7rTFcóT—eZdZdZdZdZdZdZdZdZ dZ e Z ddde jdfd„Zd„Zd „Zd „Zd „Zd „Zd,d „Zd„Zd-d„Zd„Zd-d„Zd-d„Zd-d„Zd„Zd-d„Zd„Zd„Zd„Z d.d„Z!d.d„Z"d„Z#d„Z$e$Z%d„Z&d„Z'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)2ra´This 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. rNÚehloFr7có¶—||_||_i|_d|_||_d|_|r6|j ||«\}}|dk7r|j«t||«‚|�||_ 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. ÚasciiréÜNÚ.z 127.0.0.1z[%s])Ú_hostÚtimeoutÚesmtp_featuresÚcommand_encodingÚsource_addressÚ_auth_challenge_countÚconnectÚcloser Úlocal_hostnameÚsocketÚgetfqdnÚ gethostbynameÚ gethostnameÚgaierror) r&ÚhostÚportr_rXr[r'r(ÚfqdnrAs rr)z SMTP.__init__åsÜ€ð$ˆŒ ؈Œ Ø ˆÔØ 'ˆÔØ,ˆÔØ%&ˆÔ"á ØŸ,™, t¨TÓ2‰KˆT�3Ø�sŠ{Ø— ‘ ” Ü& t¨SÓ1Ð1Ø Ð %Ø"0ˆDÕ ô —>‘>Ó#ˆDØ�d‰{Ø&*�Õ#ð#�ðÜ!×/Ñ/´×0BÑ0BÓ0DÓE�Dð'-¨t¡m�Õ#øô—‘òÙðúsÂ'CÃCÃCcó—|Sr"r©r&s rÚ __enter__zSMTP.__enter__s€Øˆ rcóº— |jd«\}}|dk7r t||«‚ |j«y#t$rYŒwxYw#|j«wxYw)NÚQUITéÝ)Údocmdrrr^)r&r%r'Úmessages rÚ__exit__z SMTP.__exit__s]€ð Ø ŸJ™J vÓ.‰MˆD�'Ø�sŠ{Ü+¨D°'Ó:Ð:ðð �J‰J�Løô&ò Ù ð ûð �J‰J�Lús&‚%9§A¹ AÁAÁAÁAÁAcó—||_y)z¬Set 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 rÚset_debuglevelzSMTP.set_debuglevel"s €ð%ˆ�rcóä—|jdkDrHttjj«j «g|¢­dt j iŽyt|dt j iŽy)NéÚfile)rrÚprintÚdatetimeÚnowÚtimeÚsysÚstderr©r&r%s rÚ _print_debugzSMTP._print_debug+sM€Ø �?‰?˜QÒ Ü ”(×#Ñ#×'Ñ'Ó)×.Ñ.Ó0Ð I°4Ò I¼c¿j¹jÓ Iä �4Ð )œcŸj™jÓ )rcó—|� |s td«‚|jdkDr|jd||f|j«t j ||f||j«S)Nú0Non-blocking socket (timeout=0) is not supportedrz connect: to)Ú ValueErrorrrr~r[r`Úcreate_connection)r&rerfrXs rÚ _get_socketzSMTP._get_socket1sd€ð Ð ¡wÜÐOÓPÐ PØ �?‰?˜QÒ Ø × Ñ ˜m¨d°D¨\¸4×;NÑ;NÔ OÜ×'Ñ'¨¨t¨ °gØ(,×(;Ñ(;ó=ð =rcó —|r||_|sR|jd«|jd«k(r/|jd«}|dk\r|d|||dzd}} t|«}|s |j }tjd|||«|j|||j«|_ d|_ |j«\}}|jdkDr|jdt!|««||fS#t$r t d«‚wxYw)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.connectúconnect:)r[ÚfindÚrfindÚintr�ÚOSErrorÚ default_portr{ÚauditrƒrXÚsockrvÚgetreplyrrr~Úrepr)r&rerfr[Úir'r(s rr]z SMTP.connect;sþ€ñ Ø"0ˆDÔ á˜Ÿ™ 3›¨4¯:©:°c«?Ò:Ø— ‘ ˜3“ˆAØ�AŠvØ! " 1˜X t¨A°©E¨F |�d�ð5ܘt›9�DñØ×$Ñ$ˆDÜ � ‰ Ð# T¨4°Ô6Ø×$Ñ$ T¨4°·±Ó>ˆŒ ؈Œ Ø—m‘m“o‰ ˆˆsØ �?‰?˜QÒ Ø × Ñ ˜j¬$¨s«)Ô 4Ø�cˆ{Ðøô"ò5Ü!Ð"3Ó4Ð4ð5ús Á C.Ã.Dcó’—|jdkDr|jdt|««|jr_t |t «r|j |j«}tjd||« |jj|«ytd«‚#t$r|j«td«‚wxYw)zSend `s' to the server.rzsend:z smtplib.sendúServer not connectedzplease run connect() firstN)rrr~r�r�Ú isinstanceÚstrÚencoderZr{rŒÚsendallrŠr^r)r&Úss rÚsendz SMTP.send\s§€à �?‰?˜QÒ Ø × Ñ ˜g¤t¨A£wÔ /Ø �9Š9ܘ!œSÔ!ð—H‘H˜T×2Ñ2Ó3�Ü �I‰I�n d¨AÔ .ð EØ— ‘ ×!Ñ! !Õ$ô )Ð)EÓFÐ Føô ò EØ— ‘ ” Ü,Ð-CÓDÐDð Eús Á:B!Â!%CcóÄ—|dk(r|}n|›d|›�}d|vsd|vr0|jdd«jdd«}td|›�«‚|j|›t›�«y) zSend a command to the server.r7Ú Ú Ú z\nz\rz=command and arguments contain prohibited newline characters: N)Úreplacer�r˜rI)r&Úcmdr%r—s rÚputcmdz SMTP.putcmdosu€à �2Š:؉Aà�%�q˜˜�ˆAØ �1‰9˜ ™ Ø— ‘ ˜$ Ó&×.Ñ.¨t°UÓ;ˆAÜØOÐPQÈsÐSóð ð � ‰ �Q�Cœ�v�,Õrcó—g}|j€ |jjd«|_ |jjtdz«}|s|j «td«‚|jdkDr|jdt|««t|«tkDr|j «tdd «‚|j|d djd ««|dd } t!|«}|d d dk7rnŒÖdj%|«}|jdkDr|jd|›d|›�«||fS#t $r,}|j «tdt|«z«‚d}~wwxYw#t"$rd }YŒ€wxYw)a¨Get 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. NÚrbruz Connection unexpectedly closed: zConnection unexpectedly closedrzreply:iôzLine too long.és ééÿÿÿÿó-ó zreply: retcode (z); Msg: )rvr�ÚmakefileÚreadlineÚ_MAXLINErŠr^rr”rrr~r�ÚlenrÚappendr<r‰r�Újoin)r&ÚrespÚlineÚer'ÚerrcodeÚerrmsgs rrŽz SMTP.getreply|sz€ðˆØ �9‰9Ð ØŸ ™ ×*Ñ*¨4Ó0ˆDŒIØð 7Ø—y‘y×)Ñ)¬(°Q©,Ó7�ñ Ø— ‘ ” Ü,Ð-MÓNÐNØ�‰ Ò"Ø×!Ñ! (¬D°«JÔ7Ü�4‹yœ8Ò#Ø— ‘ ” Ü+¨CÐ1AÓBÐBØ �K‰K˜˜Q˜R˜Ÿ™ zÓ2Ô 3ؘ˜�8ˆDð ܘd›)�ð �A�aˆy˜DÒ Øð5ð8—‘˜DÓ!ˆØ �?‰?˜QÒ Ø × Ò ÂÉÐPÔ QؘˆÐøô9ò 7Ø— ‘ ” Ü,Ð-OÜ/2°1«vñ.6ó7ð7ûð 7ûô$ò Ø�Ùð ús)±"EÃ1 E9Å E6Å 'E1Å1E6Å9 FÆFcóF—|j||«|j«S)z-Send a command, and return its response code.©rŸrŽ)r&ržr%s rrnz SMTP.docmd­s€à � ‰ �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)rŸr_rŽÚ helo_resp)r&Únamer'r(s rrµz SMTP.helo³s=€ð � ‰ �F˜DÒ7 D×$7Ñ$7Ô8Ø—m‘m“o‰ ˆˆs؈ŒØ�cˆ{Ðrcóò—i|_|j|j|xs |j«|j «\}}|dk(r)t |«dk(r|j «td«‚||_|dk7r||fSd|_ t|jt«sJt|j««‚|jjd«jd«}|d=|D�]}tj!|«}|rB|jj#dd «d z|j%d«dz|jd<Œ]t'j d |«}|sŒv|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. r¤rr’éúTzlatin-1rœÚauthr7ršz((?P[A-Za-z0-9][A-Za-z0-9\-]*) ?ÚfeatureN)rYrŸÚehlo_msgr_rŽrªr^rÚ ehlo_respÚ does_esmtpr“Úbytesr�ÚdecodeÚsplitÚ OLDSTYLE_AUTHÚmatchÚgetÚgroupsrGÚgroupÚlowerÚstringÚendr<) r&r·r'r(r­ÚeachÚ auth_matchÚmr»Úparamss rrRz SMTP.ehlo½sÖ€ð !ˆÔØ � ‰ �D—M‘M 4Ò#>¨4×+>Ñ+>Ô?Ø—m‘m“o‰ ˆˆsð �2Š:œ#˜c›( aš-Ø �J‰JŒLÜ(Ð)?Ó@Ð @؈ŒØ �3Š;ؘ#�;Р؈Œä˜$Ÿ.™.¬%Ô0ÐF´$°t·~±~Ó2FÓFÐ0Ø�~‰~×$Ñ$ YÓ/×5Ñ5°dÓ;ˆØ �ˆG܈Dô'×,Ñ,¨TÓ2ˆJÙà.2×.AÑ.A×.EÑ.EÀfÈbÓ.QØñ/Ø *× 1Ñ 1°!Ó 4°QÑ 7ñ/8�×#Ñ# FÑ+àô —‘ÐDÀdÓKˆAÚØŸ'™' )Ó,×2Ñ2Ó4�ØŸ™ !§%¡%¨ Ó"2Ð"3Ð4×:Ñ:Ó<�ؘfÒ$Ø37×3FÑ3F×3JÑ3JÈ7ÐTVÓ3WØ!ñ4"Ø$*ñ4+�D×'Ñ'¨Ò0ð4:�D×'Ñ'¨Ó0ð5ð6�cˆ{Ðrcó:—|j«|jvS)z7Does the server support a given SMTP service extension?)rÇrY)r&Úopts rÚhas_extnz SMTP.has_extnðs€à�y‰y‹{˜d×1Ñ1Ð1Ð1rcóL—|jd|«|j«dS)z;SMTP 'help' command. Returns help text from server.Úhelprur³r}s rrÒz SMTP.helpôs#€ð � ‰ �F˜DÔ!Ø�}‰}‹˜qÑ!Ð!rcó2—d|_|jd«S)z&SMTP 'rset' command -- resets session.rTÚrset)rZrnris rrÔz SMTP.rsetús€à 'ˆÔØ�z‰z˜&Ó!Ð!rcóD— |j«y#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)rÔrris rÚ_rsetz SMTP._rsetÿs"€ð Ø �I‰I�KøÜ%ò Ù ð ús ‚“ žcó$—|jd«S)z-SMTP 'noop' command -- doesn't do anything :>Únoop)rnris rrØz SMTP.noop s€à�z‰z˜&Ó!Ð!rcó—d}|rV|jrJtd„|D««r$|jd«rd|_n t d«‚ddj |«z}|j ddt|«›|›�«|j«S) 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. r7c3óBK—|]}|j«dk(–—Œy­w)Úsmtputf8N)rÇ)Ú.0Úxs rÚ zSMTP.mail..sèø€Ð:±'¨Q�1—7‘7“9˜jÕ(±'ùs‚rÛzutf-8z SMTPUTF8 not supported by serverršÚmailzFROM:) r¾ÚanyrÐrZrr¬rŸrrŽ)r&r-ÚoptionsÚ optionlists rrßz SMTP.mails{€ðˆ Ù �t—’ÜÑ:±'Ó:Ô:Ø—=‘= Ô,Ø,3�DÕ)ä/Ø:ó<ð<à˜sŸx™x¨Ó0Ñ0ˆJØ � ‰ ‘F¬9°VÔ+<¹jÐIÔJØ�}‰}‹Ðrcóª—d}|r |jrddj|«z}|jddt|«›|›�«|j «S)z;SMTP 'rcpt' command -- indicates 1 recipient for this mail.r7ršÚrcptzTO:)r¾r¬rŸrrŽ)r&Úreciprárâs rräz SMTP.rcpt$sG€àˆ Ù �t—’ؘsŸx™x¨Ó0Ñ0ˆJØ � ‰ ‘F¬°5Ô)9¹:ÐFÔGØ�}‰}‹Ðrcóô—|jd«|j«\}}|jdkDr|jd||f«|dk7r t ||«‚t |t «rt|«jd«}t|«}|ddtk7r |tz}|dztz}|j|«|j«\}}|jdkDr|jd||f«||fS) aÚSMTP 'DATA' command -- sends message data to server. Automatically quotes lines beginning with a period per rfc821. Raises SMTPDataError if there is an unexpected reply to the DATA command; the return value from this method is the final response code received when the all data is sent. If msg is a string, lone '\r' and '\n' characters are converted to '\r\n' characters. If msg is bytes, it is transmitted as is. rKrzdata:ibrTéþÿÿÿNó.) rŸrŽrrr~r r“r”rPr•rNÚbCRLFr˜)r&r(r'ÚreplÚqs rrKz SMTP.data,sã€ð � ‰ �FÔØ—}‘}“‰ ˆˆtØ �?‰?˜QÒ Ø × Ñ ˜g¨¨d |Ô 4Ø �3Š;Ü  dÓ+Ð +ä˜#œsÔ#Ü “n×+Ñ+¨GÓ4�ܘsÓ#ˆAØ��ˆvœŠØœ‘I�Ø�D‘œ5Ñ ˆAØ �I‰I�aŒLØŸ-™-›/‰KˆT�3Ø�‰ Ò"Ø×!Ñ! '¨D°#¨;Ô7ؘ#�;Ð rcóX—|jdt|««|j«S)z5SMTP 'verify' command -- checks for address validity.Úvrfy©rŸrCrŽ©r&Úaddresss rÚverifyz SMTP.verifyIó!€à � ‰ �FœJ wÓ/Ô0Ø�}‰}‹ÐrcóX—|jdt|««|j«S)z.SMTP 'expn' command -- expands a mailing list.Úexpnrîrïs rrôz SMTP.expnPròrcóΗ|j€Y|j€Ld|j«dcxkrdks/n|j«\}}d|cxkrdksnt ||«‚yyyy)abCall self.ehlo() and/or self.helo() if needed. If there has been no previous EHLO or HELO command this session, this method tries ESMTP EHLO first. This method may raise the following exceptions: SMTPHeloError The server didn't reply properly to the helo greeting. NéÈri+)r¶r½rRrµr )r&r'r­s rÚehlo_or_helo_if_neededzSMTP.ehlo_or_helo_if_neededWsi€ð �>‰>Ð ! d§n¡nÐ&<ؘ4Ÿ9™9›; q™>Ô0¨SÔ0Ø#Ÿy™y›{‘ ��tؘtÔ* sÔ*Ü'¨¨dÓ3Ð3ð+ð1ð'=Ð !rT©Úinitial_response_okcóH—|j«}|r|«nd}|�?t|jd«d¬«}|jd|dz|z«\}}d|_n|jd|«\}}d|_|d k(r’|xjdz c_t j |«}t||«jd«d¬«}|j|«\}}|jtkDrtd t||f«z«‚|d k(rŒ’|d vr||fSt||«‚) aýAuthentication 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)ÚeolÚAUTHršruriNz4Server AUTH mechanism infinite loop. Last response: ©éëi÷) ÚupperÚ encode_base64r•rnr\Úbase64Ú decodebytesÚ _MAXCHALLENGErr�r ) r&Ú mechanismÚ authobjectrùÚinitial_responseÚresponser'r­Ú challenges rrºz SMTP.authhs-€ð,—O‘OÓ%ˆ Ù,?™JœLÀTÐØ Ð 'Ü$Ð%5×%<Ñ%<¸WÓ%EÈ2ÔNˆHØŸ:™: f¨i¸#©oÀÑ.HÓI‰LˆT�4Ø)*ˆDÕ &àŸ:™: f¨iÓ8‰LˆT�4Ø)*ˆDÔ &à�cŠkØ × &Ò &¨!Ñ +Õ &Ü×*Ñ*¨4Ó0ˆIÜ$Ù˜9Ó%×,Ñ,¨WÓ5¸2ô?ˆHàŸ:™: hÓ/‰LˆT�4à×)Ñ)¬MÒ9Ü#ØJܘD $˜<Ó(ñ)óðð�c‹kð �:Ñ Ø˜$�<Ð Ü% d¨DÓ1Ð1rcó¤—|€y|jdztj|jj d«|d«j «zS)zh Authobject to use with CRAM-MD5 authentication. Requires self.user and self.password to be set.NršrTÚmd5)ÚuserÚhmacÚHMACÚpasswordr•Ú hexdigest©r&rs rÚ auth_cram_md5zSMTP.auth_cram_md5˜sL€ð Ð ØØ�y‰y˜3‰¤§¡Ø �M‰M× Ñ  Ó )¨9°eó"=ß=F¹Y»[ñIð Ircó:—d|j›d|j›�S)ze Authobject to use with PLAIN authentication. Requires self.user and self.password to be set.Ú)r rrs rÚ auth_plainzSMTP.auth_plain¡s�ð"ŸY›Y¨¯ ª Ð6Ð6rcóT—|�|jdkr |jS|jS)ze Authobject to use with LOGIN authentication. Requires self.user and self.password to be set.é)r\r rrs rÚ auth_loginzSMTP.auth_login¦s+€ð Ð  × :Ñ :¸QÒ >Ø—9‘9Ð à—=‘=Ð rcóä—|j«|jd«s td«‚|jdj «}gd¢}|D�cgc]}||vr|‘Œ }}|s t d«‚||c|_|_|D]Q}d|j«jdd«z} |j|t|| «|¬«\} } | d vr| | fcSŒS ‚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. rºz,SMTP AUTH extension not supported by server.)zCRAM-MD5ÚPLAINÚLOGINz(No suitable authentication method found.Úauth_Ú-Ú_rørýN) r÷rÐrrYrÁrr rrÇr�rºÚgetattrr )r&r rrùÚadvertised_authlistÚpreferred_authsrºÚauthlistÚ authmethodÚ method_namer'r­r¯Úlast_exceptions rÚloginz SMTP.login®s*€ð8 ×#Ñ#Ô%Ø�}‰}˜VÔ$Ü'Ø>ó@ð @ð#×1Ñ1°&Ñ9×?Ñ?ÓAÐò9ˆñ&5ó4¡_˜TØÐ2Ñ2ò _ˆð4áÜÐ JÓKÐ Kð $(¨Ð ˆŒ �4”=Û"ˆJØ! J×$4Ñ$4Ó$6×$>Ñ$>¸sÀCÓ$HÑHˆKð #Ø#Ÿy™yؤ¨¨kÓ :Ø(;ð )ó =‘ ��tð ˜:Ñ%Ø  $˜<Ò'ð&ð#ðÐùò/4øô&+ò #Ø!"•ûð #úsÁ CÂ&(Cà C/Ã#C*Ã*C/)Úcontextcó˜—|j«|jd«s td«‚|jd«\}}|dk(rzts t d«‚|€t j«}|j|j|j¬«|_ d|_ d|_ d|_ i|_d|_||fSt!||«‚) a“Puts 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 PythonN©Úserver_hostnameF)r÷rÐrrnÚ _have_sslÚ RuntimeErrorÚsslÚ_create_stdlib_contextÚ wrap_socketr�rWrvr¶r½rYr¾r)r&r&r­Úreplys rr(z SMTP.starttlsðsÍ€ð" ×#Ñ#Ô%Ø�}‰}˜ZÔ(Ü'Ø=ó?ð ?àŸ ™  :Ó.‰ ˆˆuØ �3Š;ÝÜ"Ð#KÓLÐL؈Ü×4Ñ4Ó6�Ø×+Ñ+¨D¯I©IØ<@¿J¹Jð,óHˆDŒIàˆDŒIð "ˆDŒNØ!ˆDŒNØ"$ˆDÔ Ø#ˆDŒOð �eˆ}Ðô(¨¨eÓ4Ð 4rcóz—|j«g}t|t«rt|«j d«}|j rF|j d«r|jdt|«z«|D]}|j|«Œ|j||«\}} |dk7r3|dk(r|j«n|j«t|| |«‚i} t|t«r|g}|D]H} |j| |«\}} |dk7r |dk7r|| f| | <|dk(sŒ/|j«t| «‚t| «t|«k(r|j«t| «‚|j|«\}} |dk7r2|dk(r|j«n|j«t!|| «‚| 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. rTÚsizezsize=%dr¹i¥éû)r÷r“r”rPr•r¾rÐr«rªrßr^rÖrrär rKr ) r&Ú from_addrÚto_addrsr(Ú mail_optionsÚ rcpt_optionsÚ esmtp_optsÚoptionr'r­ÚsenderrsrÊs rÚsendmailz SMTP.sendmails‹€ð@ ×#Ñ#Ô%؈ Ü �cœ3Ô Ü˜C“.×'Ñ'¨Ó0ˆCØ �?Š?Ø�}‰}˜VÔ$Ø×!Ñ! )¬c°#«hÑ"6Ô7Û&�Ø×!Ñ! &Õ)ð'à—y‘y ¨JÓ7‰ ˆˆtØ �3Š;Ø�sŠ{Ø— ‘ • à— ‘ ” Ü# D¨$° Ó:Ð :ØˆÜ �h¤Ô $Ø �zˆHÛˆDØŸ9™9 T¨<Ó8‰LˆT�4ؘ’  $¨#¢+Ø"&¨ �˜‘Ø�s‹{Ø— ‘ ” Ü+¨HÓ5Ð5ð ô ˆx‹=œC ›MÒ )à �J‰JŒLÜ'¨Ó1Ð 1Ø—y‘y “~‰ ˆˆtØ �3Š;Ø�sŠ{Ø— ‘ • à— ‘ ” Ü  dÓ+Ð +àˆrcó0—|j«|jd«}|€d}nt|«dk(rd}n td«‚|€=|dz|vr||dzn||dz}tj j |g«d d}|€U||d z||d z||d zfD�cgc]}|�|‘Œ} }tj j | «D� cgc]} | d‘Œ }} tj|«} | d =| d =d} dj|g|¢«jd«tj«5} | rEtjj!| |j"j%d¬«¬«}g|¢d‘d‘­}ntjj!| «}|j'| d¬«| j)«}ddd«|j+||||«Scc}wcc} w#t$r!|jd«s td«‚d} YŒîwxYw#1swYŒUxYw)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 blockÚSenderÚFromrÚToÚBccÚCcz Resent-BccFrTrÛz”One or more source or delivery addresses require internationalized email support, but the server does not advertise the required SMTPUTF8 capabilityT)Úutf8)ÚpolicyÚSMTPUTF8z BODY=8BITMIMEr)Úlinesep)r÷Úget_allrªr�r9r:Ú getaddressesÚcopyr¬r•ÚUnicodeEncodeErrorrÐrÚioÚBytesIOÚ generatorÚBytesGeneratorrDÚcloneÚflattenÚgetvaluer<)r&r(r5r6r7r8ÚresentÚ header_prefixÚfÚ addr_fieldsÚaÚmsg_copyÚ internationalÚbytesmsgÚgÚflatmsgs rÚ send_messagezSMTP.send_message…s]€ð> ×#Ñ#Ô%Ø—‘˜]Ó+ˆØ ˆ>؉MÜ �‹[˜AÒ Ø%‰MäÐOÓPÐ PØ Ð ð -¨xÑ7¸CÑ?ð˜]¨XÑ5Ò6à # M°FÑ$:Ñ ;ð ôŸ ™ ×0Ñ0°)°Ó=¸aÑ@ÀÑCˆIØ Ð Ø'*¨=¸4Ñ+?Ñ'@Ø'*¨=¸5Ñ+@Ñ'AØ'*¨=¸4Ñ+?Ñ'@ñ'Bó-ñ'B ð ˜mòð'BˆKð-ô',§k¡k×&>Ñ&>¸{Ô&KÓLÑ&K ˜˜!›Ð&KˆHÐLä—9‘9˜S“>ˆØ �UˆOØ �\Ð "؈ ð !Ø �G‰G�YÐ* Ð*Ó +× 2Ñ 2°7Ô ;ô�Z‰ZŒ\˜XÙÜ—O‘O×2Ñ2Ø S§Z¡Z×%5Ñ%5¸4Ð%5Ó%@ð3óB�àK ÐK¨zÐK¸?ÑK‘ ä—O‘O×2Ñ2°8Ó<�Ø �I‰I�h¨ˆIÔ /Ø×'Ñ'Ó)ˆG÷ð�}‰}˜Y¨°'¸<Ø)ó+ð +ùò9-ùòMøô"ò !Ø—=‘= Ô,Ü+ðKóLðLð!ŠMð  !ú÷ˆ\ús+ Gà GÃ7#GÄ.B H Ç'H ÈH È Hcóò— |j}d|_|r|j«|j}d|_|r|j«yy#|j}d|_|r|j«wwxYw)z(Close the connection to the SMTP server.N)rvr^r�)r&rvr�s rr^z SMTP.closeÒsi€ð Ø—9‘9ˆD؈DŒIÙØ— ‘ ” à—9‘9ˆD؈DŒIÙØ— ‘ • ðøð—9‘9ˆD؈DŒIÙØ— ‘ • ðús ‚%AÁ(A6có€—|jd«}dx|_|_i|_d|_|j «|S)zTerminate the SMTP session.ÚquitNF)rnr½r¶rYr¾r^)r&Úress rr_z SMTP.quitßs;€à�j‰j˜Ó ˆà*.Ð.ˆŒ˜œØ ˆÔ؈ŒØ � ‰ Œ ؈ r©Ú localhostrN)r7)rr")rr)NNrr)2rrrrrrr�rvr¶r¼r½r¾Ú SMTP_PORTr‹r`Ú_GLOBAL_DEFAULT_TIMEOUTr)rjrprsr~rƒr]r˜rŸrŽrnrµrRrÐrÒrÔrÖrØrßrärKrñrírôr÷rºrrrr%r(r<r\r^r_rrrrr¾s&„ñ ð8€Jà €DØ €DØ€IØ€HØ€IØ€JØ€Là Q°tØ×7Ñ7Ø $ó.4ò`òò%ò*ò =óòBGó&  ò/óbó ó1òf2ó"ò "ò ò"óó*òò:ð €Dòò4ð"BFô.2ó`Ió7ó !ð<@ô@ðD#'ô+ðZ?AØ ófðP:>Ø35óK+òZ órrcóL‡—eZdZdZeZdejdddœd„Zˆfd„Z ˆ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&cór—|€tj«}||_tj ||||||«yr")r.r/r&rr))r&rerfr_rXr[r&s rr)zSMTP_SSL.__init__øs7€ðˆÜ×4Ñ4Ó6�Ø"ˆDŒLÜ �M‰M˜$  d¨N¸GØ(õ *rc󾕗|jdkDr|jd||f«t‰|� |||«}|jj ||j ¬«}|S)Nrr†r*)rrr~Úsuperrƒr&r0rW)r&rerfrXÚ new_socketÚ __class__s €rrƒzSMTP_SSL._get_sockets_ø€Ø�‰ Ò"Ø×!Ñ! *¨t°T¨lÔ;Ü™Ñ,¨T°4¸ÓAˆJØŸ™×1Ñ1°*ØBFÇ*Á*ð2óNˆJàÐ r)r7rN) rrrrÚ SMTP_SSL_PORTr‹r`rdr)rƒÚ __classcell__©rks@rrfrfës1ø„ñ ð%ˆ ð *Ø &× >Ñ >Ø$(°$ô *÷ ð rrfiÓcóR‡—eZdZdZdZdeddejfˆfd„ Zdˆfd„ Z ˆxZ S)ÚLMTPa‰LMTP - 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#ø€ô ‰Ñ˜˜t°NØ(6Àð õ IrcóÜ•—|ddk7rt‰|�|||¬«S|j�|js td«‚ t jtj tj «|_|jtjur%|jj|j«d|_ |jj|«|j«\}}|jdkDr|jd|«||fS#t$rP|jdkDr|jd|«|jr|jj«d|_‚wxYw)z=Connect to the LMTP daemon, on either a Unix or a TCP socket.rÚ/)r[Nr€z connect fail:r†)rir]rXr�r`ÚAF_UNIXÚ SOCK_STREAMr�rdÚ settimeoutrvrŠrrr~r^rŽ)r&rerfr[r'r(rks €rr]z LMTP.connect&s$ø€à �‰7�cŠ>Ü‘7‘? 4¨¸n�?ÓMÐ Mà �<‰<Ð #¨D¯LªLÜÐOÓPÐ Pð ÜŸ ™ ¤f§n¡n´f×6HÑ6HÓIˆDŒIØ�|‰|¤6×#AÑ#AÑAØ— ‘ ×$Ñ$ T§\¡\Ô2؈DŒIØ �I‰I× Ñ ˜dÔ #ð—m‘m“o‰ ˆˆsØ �?‰?˜QÒ Ø × Ñ ˜j¨#Ô .Ø�cˆ{Ðøôò Ø�‰ Ò"Ø×!Ñ! /°4Ô8Ø�yŠyØ— ‘ —‘Ô!؈DŒIØ ð  úsÁBDÄAE+ra) rrrrr¼Ú LMTP_PORTr`rdr)r]rmrns@rrprps1ø„ñ 4ð€Hà Y¸tØ $¨f×.LÑ.LõI÷ ñrrpÚ__main__cóÚ—tjj|dz«tjj«tjj «j «S)Nz: )r{ÚstdoutÚwriteÚflushÚstdinr¨r<)Úprompts rrrEsD€Ü � ‰ ×ј $™Ô'Ü � ‰ ×ÑÔÜ�y‰y×!Ñ!Ó#×)Ñ)Ó+Ð+rr?r@Ú,zEnter message, end with ^D:r7zMessage length is %drbru)Arr`rKrGÚ email.utilsr9Ú email.messageÚemail.generatorrr rIrxr{Úemail.base64mimerrÚ__all__rcrlrIrér©rÚcompileÚIrÂrŠrrrrrr r r r r rrCrrNrPr.r,Ú ImportErrorrrfr«rxrprrÚfromaddrrÁÚtoaddrsrwr(r~r¨r®rªÚserverrsr<r_rrrÚrŒs)ðñóRÛ Û ÛÛÛÛ Û Û ÛÛ Ý9ò -€ð € Ø€ Ø €Ø€Ø €Ø€ à�— ‘ ˜<¨¯©Ó.€ ô?�Gô?ô˜Môô˜]ôô  ˜Mô  ô (Ð-ô (ô "˜Mô "ô2Ð)ô2ô1Ð,ô1ô-Ð)ô-ôÐ3ôò òò5ò/ò8ðÛð€I÷i ñi ñV ô�4ôð< ‡N�N�:Ôð € ô/ˆ4ô/ðh ˆzÒò,ñ �f‹~€HÙ�T‹l× Ñ  Ó%€GÙ Ð 'Ô(Ø €CØ—)‘)×$Ñ$Ó&Ð &ˆ$Ð &Ø�D‰jˆð—)‘)×$Ñ$Ó&Ð &ˆ$Ñ &á Ð ¡3 s£8Ñ +Ô,á �+Ó €FØ ×ј!ÔØ ‡O�O�H˜g sÔ+Ø ‡K�K…Mð#øðYòØ‚Iðúsà GÇG#Ç"G#