HEX
Server: LiteSpeed
System: Linux houston.panomity.com 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64
User: nudepix (1011)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //usr/share/doc/python3-aiosmtpd/html/cli.html
<!DOCTYPE html>
<html class="writer-html5" lang="en" data-content_root="./">
<head>
  <meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Command line usage &mdash; aiosmtpd 1.4.4.post2 documentation</title>
      <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
      <link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=86f27845" />
      <link rel="stylesheet" type="text/css" href="_static/aiosmtpd.css?v=4cc6bf70" />

  
  
        <script src="_static/jquery.js?v=8dae8fb0"></script>
        <script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
        <script src="_static/documentation_options.js?v=ad49bbf5"></script>
        <script src="_static/doctools.js?v=888ff710"></script>
        <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
    <script src="_static/js/theme.js"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Programmatic usage" href="controller.html" />
    <link rel="prev" title="Concepts" href="concepts.html" /> 
</head>

<body class="wy-body-for-nav"> 
  <div class="wy-grid-for-nav">
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >

          
          
          <a href="index.html" class="icon icon-home">
            aiosmtpd
          </a>
              <div class="version">
                1.4.4.post2
              </div>
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
        </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="intro.html">Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="concepts.html">Concepts</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Command line usage</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#options">Options</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="controller.html">Programmatic usage</a></li>
<li class="toctree-l1"><a class="reference internal" href="smtp.html">The SMTP Module</a></li>
<li class="toctree-l1"><a class="reference internal" href="lmtp.html">The LMTP class</a></li>
<li class="toctree-l1"><a class="reference internal" href="handlers.html">Handlers</a></li>
<li class="toctree-l1"><a class="reference internal" href="auth.html">Authentication System</a></li>
<li class="toctree-l1"><a class="reference internal" href="proxyprotocol.html">PROXY Protocol Support</a></li>
<li class="toctree-l1"><a class="reference internal" href="migrating.html">Migrating from smtpd to aiosmtpd</a></li>
<li class="toctree-l1"><a class="reference internal" href="testing.html">Testing</a></li>
<li class="toctree-l1"><a class="reference internal" href="manpage.html">aiosmtpd</a></li>
<li class="toctree-l1"><a class="reference internal" href="NEWS.html">NEWS for aiosmtpd</a></li>
</ul>

        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="index.html">aiosmtpd</a>
      </nav>

      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
      <li class="breadcrumb-item active">Command line usage</li>
      <li class="wy-breadcrumbs-aside">
            <a href="_sources/cli.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
             
  <section id="command-line-usage">
<span id="cli"></span><h1>Command line usage<a class="headerlink" href="#command-line-usage" title="Link to this heading"></a></h1>
<p><code class="docutils literal notranslate"><span class="pre">aiosmtpd</span></code> provides a main entry point which can be used to run the server
on the command line.  There are two ways to run the server, depending on how
the package has been installed.</p>
<p>You can run the server by passing it to Python directly:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ python3 -m aiosmtpd -n
</pre></div>
</div>
<p>This starts a server on localhost, port 8025 without setting the uid to
‘nobody’ (i.e. because you aren’t running it as root).  Once you’ve done that,
you can connect directly to the server using your favorite command line
protocol tool.  Type the <code class="docutils literal notranslate"><span class="pre">QUIT</span></code> command at the server once you see the
greeting:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">%</span> <span class="n">telnet</span> <span class="n">localhost</span> <span class="mi">8025</span>
<span class="n">Trying</span> <span class="mf">127.0.0.1</span><span class="o">...</span>
<span class="n">Connected</span> <span class="n">to</span> <span class="n">localhost</span><span class="o">.</span>
<span class="n">Escape</span> <span class="n">character</span> <span class="ow">is</span> <span class="s1">&#39;^]&#39;</span><span class="o">.</span>
<span class="mi">220</span> <span class="n">subdivisions</span> <span class="n">Python</span> <span class="n">SMTP</span> <span class="o">...</span>
<span class="n">QUIT</span>
<span class="mi">221</span> <span class="n">Bye</span>
<span class="n">Connection</span> <span class="n">closed</span> <span class="n">by</span> <span class="n">foreign</span> <span class="n">host</span><span class="o">.</span>
</pre></div>
</div>
<p>Of course, you could use Python’s <code class="xref py py-mod docutils literal notranslate"><span class="pre">smtplib</span></code> module, or any other SMTP client to
talk to the server.</p>
<p>Hit control-C at the server to stop it.</p>
<p>The entry point may also be installed as the <code class="docutils literal notranslate"><span class="pre">aiosmtpd</span></code> command, so this is
equivalent to the above <code class="docutils literal notranslate"><span class="pre">python3</span></code> invocation:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>$ aiosmtpd -n
</pre></div>
</div>
<section id="options">
<h2>Options<a class="headerlink" href="#options" title="Link to this heading"></a></h2>
<p>Optional arguments are described in the <a class="reference internal" href="manpage.html#manpage"><span class="std std-ref">man page</span></a> document.</p>
</section>
</section>


           </div>
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="concepts.html" class="btn btn-neutral float-left" title="Concepts" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="controller.html" class="btn btn-neutral float-right" title="Programmatic usage" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2015-2024, The aiosmtpd Developers.</p>
  </div>

  Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    provided by <a href="https://readthedocs.org">Read the Docs</a>.
   

</footer>
        </div>
      </div>
    </section>
  </div>
  <script>
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>