
    Zj                         d Z ddlZdZ ej        dej                  Zdedeeeef         e	e         f         fdZ
dS )	z
ESMTP utils
    N)parse_esmtp_extensionszauth=(?P<auth>.*))flagsmessagereturnc                    i }g }|                      d          dd         D ]}|                                }|st                              |          }|?|d         }||d<   |                    d |                                 D                        t|                    d          \  }}}|                                }|||<   |dk    r1|                    d |                                 D                        ||fS )aj  
    Parse an EHLO response from the server into a dict of {extension: params}
    and a list of auth method names.

    It might look something like:

         220 size.does.matter.af.MIL (More ESMTP than Crappysoft!)
         EHLO heaven.af.mil
         250-size.does.matter.af.MIL offers FIFTEEN extensions:
         250-8BITMIME
         250-PIPELINING
         250-DSN
         250-ENHANCEDSTATUSCODES
         250-EXPN
         250-HELP
         250-SAML
         250-SEND
         250-SOML
         250-TURN
         250-XADR
         250-XSTA
         250-ETRN
         250-XGEN
         250 SIZE 51200000
    
   Nauthc              3   >   K   | ]}|                                 V  d S Nlower.0methods     T/var/www/app.qaans.com/backend/venv/lib/python3.11/site-packages/aiosmtplib/esmtp.py	<genexpr>z)parse_esmtp_extensions.<locals>.<genexpr>:   *      JJfllnnJJJJJJ     c              3   >   K   | ]}|                                 V  d S r   r   r   s     r   r   z)parse_esmtp_extensions.<locals>.<genexpr>E   r   r   )splitstripOLDSTYLE_AUTH_REGEX	fullmatchextend	partitionr   )r   esmtp_extensions
auth_typeslineoldstyle_authparamskeyword_s           r   r   r      s!   4 (*J d##ABB' K Kzz|| 	 ,55d;;$"6*F'-V$JJ6<<>>JJJJJJ
 "^^C00F--//$*!fJJ6<<>>JJJJJJZ''r   )__doc__re__all__compileIr   strtupledictlistr    r   r   <module>r/      s     
			 & !bj!5RTBBB 9(C 9(E$sCx.$s)2K,L 9( 9( 9( 9( 9( 9(r   