-í
ŽH ?c       s    d  Z  $ I d k Z J d k Z K d k Z L d k Z M d k Z N d k Z O d k Z P d k Z R d d d d g Z	 T e i
 d Z U d Z X d f  d	 „  ƒ  YZ ] e ƒ  a ^ d
 Z _ d Z ` d Z d d d „ Z l d e i f d „  ƒ  YZ d e i f d „  ƒ  YZ Bd e f d „  ƒ  YZ Rd e f d „  ƒ  YZ {d e f d „  ƒ  YZ Êd f  d „  ƒ  YZ Ðd „  Z 	e d j os
e ƒ  Z e i oØ y d k Z Wn6 e  j
 o' e i! d IJe i" d ƒ n Xe i# d ƒ d Z$ y e i e$ ƒ WnX e% j
 oI Z& e& i e i' j o
 ‚  n e i! d IJe i" d ƒ n Xn d k( Z( e) e( e i* ƒ Z+ e+ e i, e i- f e i. e i/ f ƒ Z0 y  e i1 ƒ  Wn !e2 j
 o
 "n Xn d S(   sc  An RFC 2821 smtp proxy.

Usage: %(program)s [options] [localhost:localport [remotehost:remoteport]]

Options:

    --nosetuid
    -n
        This program generally tries to setuid `nobody', unless this flag is
        set.  The setuid call will fail if this program is not run as root (in
        which case, use this flag).

    --version
    -V
        Print the version number and exit.

    --class classname
    -c classname
        Use `classname' as the concrete SMTP proxy class.  Uses `SMTPProxy' by
        default.

    --debug
    -d
        Turn on debugging prints.

    --help
    -h
        Print this message and exit.

Version: %(__version__)s

If localhost is not given then `localhost' is used, and if localport is not
given then 8025 is used.  If remotehost is not given then `localhost' is used,
and if remoteport is not given, then 25 is used.
Ns
   SMTPServers   DebuggingServers	   PureProxys   MailmanProxyi    s   Python SMTP proxy version 0.2s   Devnullc      s   X Y d „  Z  Z d „  Z RS(   Nc    s
   Y Y d  S(   N(    (   s   selfs   msg(    (    s"   /mit/python/lib/python2.2/smtpd.pys   writeY s    c    s
   Z Z d  S(   N(    (   s   self(    (    s"   /mit/python/lib/python2.2/smtpd.pys   flushZ s    (   s   writes   flush(    (    (    s"   /mit/python/lib/python2.2/smtpd.pys   DevnullX s   s   
s    s   , c    sL   d e t  i t t ƒ  IJf | o g t  i | IJn h t  i |  ƒ d  S(   N(   s   syss   stderrs   __doc__s   globalss   msgs   exits   code(   s   codes   msg(    (    s"   /mit/python/lib/python2.2/smtpd.pys   usaged s   
s   SMTPChannelc      s§   l m d Z  n d Z p d „  Z ‚ d „  Z † d „  Z Š d „  Z » d „  Z Å d „  Z Ë d	 „  Z Ñ d
 „  Z	 Þ d „  Z
 ë d „  Z û d „  Z d „  Z RS(   Ni    i   c    sù   p q t  i i |  | ƒ r | |  _ s | |  _ t | |  _	 u g  |  _
 v |  i |  _ w d |  _ x t |  _ y g  |  _ z d |  _ { t i ƒ  |  _ | | i ƒ  |  _ } t d It |  i ƒ IJ~ |  i d |  i t f ƒ  |  i d ƒ d  S(   Ni    s    s   Peer:s	   220 %s %ss   
(   s   asynchats
   async_chats   __init__s   selfs   conns   servers   _SMTPChannel__servers   _SMTPChannel__conns   addrs   _SMTPChannel__addrs   _SMTPChannel__lines   COMMANDs   _SMTPChannel__states   _SMTPChannel__greetings   Nones   _SMTPChannel__mailfroms   _SMTPChannel__rcpttoss   _SMTPChannel__datas   sockets   getfqdns   _SMTPChannel__fqdns   getpeernames   _SMTPChannel__peers   DEBUGSTREAMs   reprs   pushs   __version__s   set_terminator(   s   selfs   servers   conns   addr(    (    s"   /mit/python/lib/python2.2/smtpd.pys   __init__p s   c    s!   ‚ ƒ t  i i |  | d ƒ d  S(   Ns   
(   s   asynchats
   async_chats   pushs   selfs   msg(   s   selfs   msg(    (    s"   /mit/python/lib/python2.2/smtpd.pys   push‚ s   c    s   † ‡ |  i i | ƒ d  S(   N(   s   selfs   _SMTPChannel__lines   appends   data(   s   selfs   data(    (    s"   /mit/python/lib/python2.2/smtpd.pys   collect_incoming_data† s   c 	   s”  Š ‹ t  i |  i ƒ } Œ t d It | ƒ IJ� g  |  _ Ž |  i |  i j oò � | o � |  i	 d ƒ ‘ d  Sn ’ t
 } “ | i d ƒ } ” | d j  o • | i ƒ  } – t
 } n+ ˜ | |  i ƒ  } ™ | | d i ƒ  } š t |  d | t
 ƒ } › | o œ |  i	 d | ƒ � d  Sn ž | | ƒ Ÿ d  SnL¡ |  i |  i j o ¢ |  i	 d ƒ £ d  Sn ¦ g  } § x] | i d	 ƒ D§ ]I } ¨ | o | d d
 j o © | i | d ƒ n « | i | ƒ q’W¬ t i | ƒ |  _ ­ |  i i |  i ® |  i ¯ |  i ° |  i ƒ } ± g  |  _ ² t
 |  _ ³ |  i |  _ ´ |  i  d	 ƒ µ | o ¶ |  i	 d ƒ n ¸ |  i	 | ƒ d  S(   Ns   Data:s   500 Error: bad syntaxs    i    i   s   smtp_s'   502 Error: command "%s" not implementeds   451 Internal confusions   
s   .s   250 Ok(!   s   EMPTYSTRINGs   joins   selfs   _SMTPChannel__lines   lines   DEBUGSTREAMs   reprs   _SMTPChannel__states   COMMANDs   pushs   Nones   methods   finds   is   uppers   commands   args   strips   getattrs   DATAs   datas   splits   texts   appends   NEWLINEs   _SMTPChannel__datas   _SMTPChannel__servers   process_messages   _SMTPChannel__peers   _SMTPChannel__mailfroms   _SMTPChannel__rcpttoss   statuss   set_terminator(	   s   selfs   statuss   is   texts   commands   args   lines   datas   method(    (    s"   /mit/python/lib/python2.2/smtpd.pys   found_terminatorŠ sR   		 			c    sq   » ¼ | o ½ |  i d ƒ ¾ d  Sn ¿ |  i o À |  i d ƒ n$ Â | |  _ Ã |  i d |  i ƒ d  S(   Ns   501 Syntax: HELO hostnames   503 Duplicate HELO/EHLOs   250 %s(   s   args   selfs   pushs   _SMTPChannel__greetings   _SMTPChannel__fqdn(   s   selfs   arg(    (    s"   /mit/python/lib/python2.2/smtpd.pys	   smtp_HELO» s   c    s5   Å Æ | o Ç |  i d ƒ n É |  i d ƒ d  S(   Ns   501 Syntax: NOOPs   250 Ok(   s   args   selfs   push(   s   selfs   arg(    (    s"   /mit/python/lib/python2.2/smtpd.pys	   smtp_NOOPÅ s   
c    s$   Ë Í |  i d ƒ Î |  i ƒ  d  S(   Ns   221 Bye(   s   selfs   pushs   close_when_done(   s   selfs   arg(    (    s"   /mit/python/lib/python2.2/smtpd.pys	   smtp_QUITË s   c    s¯   Ñ Ò t  } Ó t | ƒ } Ô | |  i ƒ  | j oo Õ | | i ƒ  } Ö | o × nG Ø | d d j o | d d j o
 | d j o Û | d d !} n n Ü | Sd  S(   Ni    s   <iÿÿÿÿs   >s   <>i   (   s   Nones   addresss   lens   keywords   keylens   args   uppers   strip(   s   selfs   keywords   args   addresss   keylen(    (    s"   /mit/python/lib/python2.2/smtpd.pys	   __getaddrÑ s   	2c    s¯   Þ ß t  d I| IJà |  i d | ƒ } á | o â |  i d ƒ ã d  Sn ä |  i o å |  i d ƒ æ d  Sn ç | |  _ è t  d I|  i IJé |  i d ƒ d  S(   Ns	   ===> MAILs   FROM:s   501 Syntax: MAIL FROM:<address>s   503 Error: nested MAIL commands   sender:s   250 Ok(   s   DEBUGSTREAMs   args   selfs   _SMTPChannel__getaddrs   addresss   pushs   _SMTPChannel__mailfrom(   s   selfs   args   address(    (    s"   /mit/python/lib/python2.2/smtpd.pys	   smtp_MAILÞ s   c    sï   ë ì t  d I| IJí |  i o î |  i d ƒ ï d  Sn ð |  i d | ƒ } ñ | o ò |  i d ƒ ó d  Sn ô | i ƒ  i d ƒ o õ |  i d | ƒ ö d  Sn ÷ |  i	 i
 | ƒ ø t  d I|  i	 IJù |  i d ƒ d  S(	   Ns	   ===> RCPTs   503 Error: need MAIL commands   TO:s   501 Syntax: RCPT TO: <address>s   stimpys   503 You suck %ss   recips:s   250 Ok(   s   DEBUGSTREAMs   args   selfs   _SMTPChannel__mailfroms   pushs   _SMTPChannel__getaddrs   addresss   lowers
   startswiths   _SMTPChannel__rcpttoss   append(   s   selfs   args   address(    (    s"   /mit/python/lib/python2.2/smtpd.pys	   smtp_RCPTë s   c    so   û ü | o ý |  i d ƒ þ d  Sn  t |  _ g  |  _ d |  _ |  i |  _ |  i d ƒ d  S(   Ns   501 Syntax: RSETs    s   250 Ok(	   s   args   selfs   pushs   Nones   _SMTPChannel__mailfroms   _SMTPChannel__rcpttoss   _SMTPChannel__datas   COMMANDs   _SMTPChannel__state(   s   selfs   arg(    (    s"   /mit/python/lib/python2.2/smtpd.pys	   smtp_RSETû s   
c    s„   |  i o |  i d ƒ 	d  Sn 
| o |  i d ƒ d  Sn |  i |  _ |  i d ƒ |  i d ƒ d  S(   Ns   503 Error: need RCPT commands   501 Syntax: DATAs   
.
s#   354 End data with <CR><LF>.<CR><LF>(   s   selfs   _SMTPChannel__rcpttoss   pushs   args   DATAs   _SMTPChannel__states   set_terminator(   s   selfs   arg(    (    s"   /mit/python/lib/python2.2/smtpd.pys	   smtp_DATAs   
(   s   COMMANDs   DATAs   __init__s   pushs   collect_incoming_datas   found_terminators	   smtp_HELOs	   smtp_NOOPs	   smtp_QUITs   _SMTPChannel__getaddrs	   smtp_MAILs	   smtp_RCPTs	   smtp_RSETs	   smtp_DATA(    (    (    s"   /mit/python/lib/python2.2/smtpd.pys   SMTPChannell s   		1
c      s)   d „  Z  "d „  Z (d „  Z RS(   Nc    sª   | |  _ | |  _ t i i |  ƒ |  i t	 i
 t	 i ƒ |  i ƒ  |  i | ƒ |  i d ƒ t d |  i i t i t i ƒ  ƒ | | f IJd  S(   Ni   s0   %s started at %s
	Local addr: %s
	Remote addr:%s(   s	   localaddrs   selfs
   _localaddrs
   remoteaddrs   _remoteaddrs   asyncores
   dispatchers   __init__s   create_sockets   sockets   AF_INETs   SOCK_STREAMs   set_reuse_addrs   binds   listens   DEBUGSTREAMs	   __class__s   __name__s   times   ctime(   s   selfs	   localaddrs
   remoteaddr(    (    s"   /mit/python/lib/python2.2/smtpd.pys   __init__s   c    sH   "#|  i ƒ  \ } } $t d t | ƒ IJ%t |  | | ƒ } d  S(   Ns   Incoming connection from %s(   s   selfs   accepts   conns   addrs   DEBUGSTREAMs   reprs   SMTPChannels   channel(   s   selfs   addrs   conns   channel(    (    s"   /mit/python/lib/python2.2/smtpd.pys   handle_accept"s   c    s   (=>t  ‚ d S(   sI  Override this abstract method to handle messages from the client.

        peer is a tuple containing (ipaddr, port) of the client that made the
        socket connection to our smtp port.

        mailfrom is the raw address the client claims the message is coming
        from.

        rcpttos is a list of raw addresses the client wishes to deliver the
        message to.

        data is a string containing the entire full text of the message,
        headers (if supplied) and all.  It has been `de-transparencied'
        according to RFC 821, Section 4.5.2.  In other words, a line
        containing a `.' followed by other text has had the leading dot
        removed.

        This function should return None, for a normal `250 Ok' response;
        otherwise it returns the desired response string in RFC 821 format.

        N(   s   NotImplementedError(   s   selfs   peers   mailfroms   rcpttoss   data(    (    s"   /mit/python/lib/python2.2/smtpd.pys   process_message(s   (   s   __init__s   handle_accepts   process_message(    (    (    s"   /mit/python/lib/python2.2/smtpd.pys
   SMTPServers   c      s   BDd „  Z  RS(   Nc    s€   DEd } F| i d ƒ } Gd GHHxH | DH]= } J| o | o Kd G| d GHLd } n M| GHq0 WNd GHd  S(   Ni   s   
s%   ---------- MESSAGE FOLLOWS ----------s   X-Peer:i    s%   ------------ END MESSAGE ------------(   s	   inheaderss   datas   splits   liness   lines   peer(   s   selfs   peers   mailfroms   rcpttoss   datas   lines	   inheaderss   lines(    (    s"   /mit/python/lib/python2.2/smtpd.pys   process_messageDs   	
 	(   s   process_message(    (    (    s"   /mit/python/lib/python2.2/smtpd.pys   DebuggingServerBs   c      s   RSd „  Z  ad „  Z RS(   Nc 	   s«   ST| i d ƒ } Vd } Wx1 | DW]& } X| o YPn Z| d 7} q( W[| i | d | d ƒ \t i | ƒ } ]|  i
 | | | ƒ } _t d IJd  S(   Ns   
i    i   s
   X-Peer: %ss   we got some refusals(   s   datas   splits   liness   is   lines   inserts   peers   NEWLINEs   joins   selfs   _delivers   mailfroms   rcpttoss   refuseds   DEBUGSTREAM(	   s   selfs   peers   mailfroms   rcpttoss   datas   is   liness   refuseds   line(    (    s"   /mit/python/lib/python2.2/smtpd.pys   process_messageSs   	
 	c    sQ  abd  k  }	 ch  } dyg e|	 i ƒ  } f| i |  i d |  i d ƒ gz h| i | | | ƒ } Wd  ij| i ƒ  XWnÁ k|	 i j
 o" } lt d IJm| i } n� nt i |	 i f j
 os } ot d I| i IJst | d d ƒ } tt | d d ƒ }
 ux$ | Du] } v| |
 f | | <q!Wn Xw| Sd  S(	   Ni    i   s   got SMTPRecipientsRefuseds   gots	   smtp_codeiÿÿÿÿs
   smtp_errors   ignore(   s   smtplibs   refuseds   SMTPs   ss   connects   selfs   _remoteaddrs   sendmails   mailfroms   rcpttoss   datas   quits   SMTPRecipientsRefuseds   es   DEBUGSTREAMs
   recipientss   sockets   errors   SMTPExceptions	   __class__s   getattrs   errcodes   errmsgs   r(   s   selfs   mailfroms   rcpttoss   datas   es   errcodes   refuseds   ss   rs   smtplibs   errmsg(    (    s"   /mit/python/lib/python2.2/smtpd.pys   _deliveras(   	!
 	(   s   process_messages   _deliver(    (    (    s"   /mit/python/lib/python2.2/smtpd.pys	   PureProxyRs   c      s   {|d „  Z  RS(   Nc    sÉ  |}d k  l }
 ~d k l } d k l } €d k l } „g  } …xò | D…]ç } †| i	 ƒ  i
 d ƒ d } Ž| i
 d ƒ } �t | ƒ d j o
 �qV n ‘| d } ’t | ƒ d j o “| d	 } n
 •d
 } –| i | ƒ p | d
 d d d d d f j o
 ˜qV n ™| i | | | f ƒ qV W�x* | D�] \ } } } ž| i | ƒ qNW t d Id i | ƒ IJ¡| o) ¢|  i | | | ƒ } ¤t d IJn ¦h  } §|
 | ƒ } ¨| i | ƒ } ¬| i d ƒ o ­| | d <n ®| i d ƒ o  ¯t i t i ƒ  ƒ | d <n °xy| D°]n\ } } } ±t d I| IJ²| i  | ƒ }	 ³|	 o) ´| i | d d ƒ}	 µ|	 | | <n ·| d
 j o ¹| i" |	 d d	 ƒnÝ º| d j o »| i" |	 d d	 ƒn³ ¼| d j o ½| i" |	 d d	 ƒn‰ ¾| d j o ¿| i" |	 d d	 ƒn_ À| d d f j oH Â| d j o Ãd | d <n Åd | d <Æ| i" |	 d d	 ƒn qPWd  S(    N(   s   StringIO(   s   Utils(   s   Message(   s   MailLists   @i    s   -i   i   s    s   admins   owners   requests   joins   leaves   forwarding recips:s    s   we got refusalss   froms   Froms   dates   Dates   sending message tos   locks   tolists   toadmins   toowners	   torequests	   subscribes   Subjects   unsubscribe(#   s	   cStringIOs   StringIOs   Mailmans   Utilss   Messages   MailLists	   listnamess   rcpttoss   rcpts   lowers   splits   locals   partss   lens   listnames   commands   list_existss   appends   removes   DEBUGSTREAMs   joins   selfs   _delivers   mailfroms   datas   refuseds   mlistss   ss   msgs	   getheaders   times   ctimes   gets   mlists   Enqueue(   s   selfs   peers   mailfroms   rcpttoss   datas	   listnamess   listnames   mlistss   refuseds   mlists   StringIOs   Utilss   MailLists   rcpts   ss   partss   commands   msgs   Messages   local(    (    s"   /mit/python/lib/python2.2/smtpd.pys   process_message|sh   	
 	
	3

 
	 
 (   s   process_message(    (    (    s"   /mit/python/lib/python2.2/smtpd.pys   MailmanProxy{s   s   Optionsc      s   ÊËd Z  Ìd Z RS(   Ni   s	   PureProxy(   s   setuids	   classname(    (    (    s"   /mit/python/lib/python2.2/smtpd.pys   OptionsÊs   	c  	   sV  ÐÑÒy; Ót  i  t i d d Õd d d d d g ƒ \ } } Wn+ Öt  i j
 o } ×t d | ƒ n XÙt ƒ  } Úxê | DÚ]ß \ }  } Û|  d d	 f j o Üt d
 ƒ n­ Ý|  d d f j o$ Þt i t IJßt i d
 ƒ ns à|  d d f j o ád
 | _ nM â|  d d f j o ã| | _ n' ä|  d d f j o åt i a n qˆ Wèt | ƒ d j  o éd } êd } n‚ ët | ƒ d j  o ì| d
 } íd } nR ît | ƒ d j  o ï| d
 } ð| d } n òt d d t i | ƒ ƒ õ| i d ƒ } ö| d
 j  o ÷t d d | ƒ n ø| |  | _ ùy út | | d ƒ | _ Wn* ût j
 o üt d d | ƒ n Xý| i d ƒ } þ| d
 j  o ÿt d d | ƒ n  | |  | _ y t | | d ƒ | _ Wn* t j
 o t d d | ƒ n X| Sd  S(   Ni   s   nVhc:ds   class=s   nosetuids   versions   helps   debugs   -hs   --helpi    s   -Vs	   --versions   -ns
   --nosetuids   -cs   --classs   -ds   --debugs   localhost:8025s   localhost:25i   i   s   Invalid arguments: %ss   :s   Bad local spec: %ss   Bad local port: %ss   Bad remote spec: %ss   Bad remote port: %s(   s   getopts   syss   argvs   optss   argss   errors   es   usages   Optionss   optionss   opts   args   stderrs   __version__s   exits   setuids	   classnames   DEBUGSTREAMs   lens	   localspecs
   remotespecs
   COMMASPACEs   joins   finds   is	   localhosts   ints	   localports
   ValueErrors
   remotehosts
   remoteport(	   s   opts   es   is   argss	   localspecs
   remotespecs   args   optionss   opts(    (    s"   /mit/python/lib/python2.2/smtpd.pys	   parseargsÐs^   %
 	s   __main__s7   Cannot import module "pwd"; try running with -n option.i   s   nobodyi   s3   Cannot setuid "nobody"; try running with -n option.(3   s   __doc__s   syss   oss   errnos   getopts   times   sockets   asyncores   asynchats   __all__s   argvs   programs   __version__s   Devnulls   DEBUGSTREAMs   NEWLINEs   EMPTYSTRINGs
   COMMASPACEs   usages
   async_chats   SMTPChannels
   dispatchers
   SMTPServers   DebuggingServers	   PureProxys   MailmanProxys   Optionss	   parseargss   __name__s   optionss   setuids   pwds   ImportErrors   stderrs   exits   getpwnams   nobodys   OSErrors   es   EPERMs   __main__s   getattrs	   classnames   class_s	   localhosts	   localports
   remotehosts
   remoteports   proxys   loops   KeyboardInterrupt(   s   Optionss   nobodys   asyncores   times   syss   class_s   pwds   __main__s   proxys   Devnulls   EMPTYSTRINGs   __version__s   DebuggingServers   asynchats   es   sockets   __all__s	   parseargss   MailmanProxys   NEWLINEs	   PureProxys   programs   errnos   usages   getopts   SMTPChannels
   SMTPServers   oss   optionss
   COMMASPACE(    (    s"   /mit/python/lib/python2.2/smtpd.pys   ?$ s`   %				§/)O9 
