File: //lib/python3.10/__pycache__/smtpd.cpython-310.pyc
o
    E�h]�  �                   @   s`  d Z ddlZddlZddlZddlZddlZddlZddlZddlm	Z	 ddl
mZmZ g d�Z
e	dedd� ddlZddlZejd Zd	ZG d
d� d�Ze� adZd
ZdZd(dd�ZG dd� dej�ZG dd� dej�ZG dd� de�ZG dd� de�ZG dd� de�Z G dd� d�Z!dd� Z"e#d k�r.e"� Z$e$j%Z%d!e%v r�e%�&d!�Z'e(e%de'� e)� e*� dg�Z+e%e'd" d� Z%nddl,Z+e-e+e%�Z.e.e$j/e$j0fe$j1e$j2fe$j3e$j4d#�Z5e$j6�rzddl7Z7W n e8y�   e9d$ej:d%� e�;d"� Y nw e7�<d&�d Z=ze�6e=� W n e>�y   e9d'ej:d%� e�;d"� Y nw ze�?�  W dS  e@�y-   Y dS w dS ))a�  An RFC 5321 smtp proxy with optional RFC 1870 and RFC 6531 extensions.
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 `PureProxy' by
        default.
    --size limit
    -s limit
        Restrict the total size of the incoming message to "limit" number of
        bytes via the RFC 1870 SIZE extension.  Defaults to 33554432 bytes.
    --smtputf8
    -u
        Enable the SMTPUTF8 extension and behave as an RFC 6531 smtp proxy.
    --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.
�    N)�warn)�
get_addr_spec�get_angle_addr)�SMTPChannel�
SMTPServer�DebuggingServer�	PureProxy�MailmanProxyz�The smtpd module is deprecated and unmaintained and will be removed in Python 3.12.  Please see aiosmtpd (https://aiosmtpd.readthedocs.io/) for the recommended replacement.�   )�
stacklevelzPython SMTP proxy version 0.3c                   @   �   e Zd Zdd� Zdd� ZdS )�Devnullc                 C   �   d S �N� ��self�msgr   r   �/usr/lib/python3.10/smtpd.py�writer   �    z
Devnull.writec                 C   r   r   r   �r   r   r   r   �flushs   r   z
Devnull.flushN)�__name__�
__module__�__qualname__r   r   r   r   r   r   r
   q   s    r
   �
z, i   � c                 C   s4   t tt�  tjd� |rt |tjd� t�| � d S )N��file)�print�__doc__�globals�sys�stderr�exit)�coder   r   r   r   �usage|   s   r'