Server IP : 184.154.167.98 / Your IP : 18.118.166.157 Web Server : Apache System : Linux pink.dnsnetservice.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64 User : puertode ( 1767) PHP Version : 8.2.26 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/puertode/public_html/sesiones/core/doc/admin/configuration_server/ |
Upload File : |
<!DOCTYPE html> <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Email — Nextcloud latest Administration Manual latest documentation</title> <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../_static/custom.css" type="text/css" /> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="Linking external sites" href="external_sites.html" /> <link rel="prev" title="Configuration Parameters" href="config_sample_php_parameters.html" /> <script src="../_static/js/modernizr.min.js"></script> </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="../contents.html"> <img src="../_static/logo-white.png" class="logo" alt="Logo"/> </a> <div role="search"> <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> <input type="text" name="q" placeholder="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="main navigation"> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="../index.html">Introduction</a></li> <li class="toctree-l1"><a class="reference internal" href="../release_notes.html">Release notes</a></li> <li class="toctree-l1"><a class="reference internal" href="../release_schedule.html">Maintenance and release schedule</a></li> <li class="toctree-l1"><a class="reference internal" href="../installation/index.html">Installation and server configuration</a></li> <li class="toctree-l1 current"><a class="reference internal" href="index.html">Nextcloud configuration</a><ul class="current"> <li class="toctree-l2"><a class="reference internal" href="security_setup_warnings.html">Warnings on admin page</a></li> <li class="toctree-l2"><a class="reference internal" href="occ_command.html">Using the occ command</a></li> <li class="toctree-l2"><a class="reference internal" href="activity_configuration.html">Activity app</a></li> <li class="toctree-l2"><a class="reference internal" href="caching_configuration.html">Memory caching</a></li> <li class="toctree-l2"><a class="reference internal" href="background_jobs_configuration.html">Background jobs</a></li> <li class="toctree-l2"><a class="reference internal" href="config_sample_php_parameters.html">Configuration Parameters</a></li> <li class="toctree-l2 current"><a class="current reference internal" href="#">Email</a><ul> <li class="toctree-l3"><a class="reference internal" href="#configuring-an-smtp-server">Configuring an SMTP server</a></li> <li class="toctree-l3"><a class="reference internal" href="#configuring-sendmail-qmail">Configuring Sendmail/qmail</a></li> <li class="toctree-l3"><a class="reference internal" href="#using-email-templates">Using email templates</a><ul> <li class="toctree-l4"><a class="reference internal" href="#modifying-the-look-of-emails-beyond-the-theming-app-capabilities">Modifying the look of emails beyond the theming app capabilities</a></li> </ul> </li> <li class="toctree-l3"><a class="reference internal" href="#setting-mail-server-parameters-in-config-php">Setting mail server parameters in config.php</a><ul> <li class="toctree-l4"><a class="reference internal" href="#smtp">SMTP</a></li> <li class="toctree-l4"><a class="reference internal" href="#ssl">SSL</a></li> <li class="toctree-l4"><a class="reference internal" href="#tls">TLS</a></li> <li class="toctree-l4"><a class="reference internal" href="#sendmail">Sendmail</a></li> <li class="toctree-l4"><a class="reference internal" href="#qmail">qmail</a></li> </ul> </li> <li class="toctree-l3"><a class="reference internal" href="#send-a-test-email">Send a test email</a></li> <li class="toctree-l3"><a class="reference internal" href="#troubleshooting">Troubleshooting</a></li> <li class="toctree-l3"><a class="reference internal" href="#enabling-debug-mode">Enabling debug mode</a></li> </ul> </li> <li class="toctree-l2"><a class="reference internal" href="external_sites.html">Linking external sites</a></li> <li class="toctree-l2"><a class="reference internal" href="language_configuration.html">Language & Locale</a></li> <li class="toctree-l2"><a class="reference internal" href="logging_configuration.html">Logging</a></li> <li class="toctree-l2"><a class="reference internal" href="antivirus_configuration.html">Antivirus scanner</a></li> <li class="toctree-l2"><a class="reference internal" href="reverse_proxy_configuration.html">Reverse proxy</a></li> <li class="toctree-l2"><a class="reference internal" href="bruteforce_configuration.html">Brute force protection</a></li> <li class="toctree-l2"><a class="reference internal" href="automatic_configuration.html">Automatic setup</a></li> <li class="toctree-l2"><a class="reference internal" href="theming.html">Theming</a></li> <li class="toctree-l2"><a class="reference internal" href="oauth2.html">OAuth2</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="../apps_management.html">Apps management</a></li> <li class="toctree-l1"><a class="reference internal" href="../configuration_user/index.html">User management</a></li> <li class="toctree-l1"><a class="reference internal" href="../configuration_files/index.html">File sharing and management</a></li> <li class="toctree-l1"><a class="reference internal" href="../file_workflows/index.html">File workflows</a></li> <li class="toctree-l1"><a class="reference internal" href="../configuration_database/index.html">Database configuration</a></li> <li class="toctree-l1"><a class="reference internal" href="../configuration_mimetypes/index.html">Mimetypes management</a></li> <li class="toctree-l1"><a class="reference internal" href="../maintenance/index.html">Maintenance</a></li> <li class="toctree-l1"><a class="reference internal" href="../issues/index.html">Issues and troubleshooting</a></li> <li class="toctree-l1"><a class="reference internal" href="../gdpr/index.html">GDPR</a></li> </ul> </div> </div> </nav> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <nav class="wy-nav-top" aria-label="top navigation"> <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="../contents.html">Nextcloud latest Administration Manual</a> </nav> <div class="wy-nav-content"> <div class="rst-content style-external-links"> <div role="navigation" aria-label="breadcrumbs navigation"> <ul class="wy-breadcrumbs"> <li><a href="../contents.html">Docs</a> »</li> <li><a href="index.html">Nextcloud configuration</a> »</li> <li>Email</li> <li class="wy-breadcrumbs-aside"> <a href="https://github.com/nextcloud/documentation/edit/master/admin_manual/configuration_server/email_configuration.rst" class="fa fa-github"> Edit on GitHub</a> </li> </ul> <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> <div class="section" id="email"> <h1>Email<a class="headerlink" href="#email" title="Permalink to this headline">¶</a></h1> <p>Nextcloud is capable of sending password reset emails, notifying users of new file shares, changes in files, and activity notifications. Your users configure which notifications they want to receive on their Personal pages.</p> <p>Nextcloud does not contain a full email server, but rather connects to your existing mail server. You must have a functioning mail server for Nextcloud to be able to send emails. You may have a mail server on the same machine as Nextcloud, or it may be a remote server.</p> <div class="figure"> <img alt="../_images/smtp-config-wizard.png" src="../_images/smtp-config-wizard.png" /> </div> <p>With the wizard, connecting Nextcloud to your mail server is fast and easy. The wizard fills in the values in <code class="docutils literal notranslate"><span class="pre">config/config.php</span></code>, so you may use either or both as you prefer.</p> <p>The Nextcloud Email wizard supports three types of mail server connections: SMTP, qmail, and Sendmail. Use the SMTP configurator for a remote server or Sendmail when your mail server is on the same machine as Nextcloud.</p> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last">The Sendmail option refers to the Sendmail SMTP server and any drop-in Sendmail replacement such as Postfix, Exim, or Courier. All of these include a <code class="docutils literal notranslate"><span class="pre">sendmail</span></code> binary, and are freely-interchangeable.</p> </div> <div class="section" id="configuring-an-smtp-server"> <h2>Configuring an SMTP server<a class="headerlink" href="#configuring-an-smtp-server" title="Permalink to this headline">¶</a></h2> <p>You need the following information from your mail server administrator to connect Nextcloud to a remote SMTP server:</p> <ul class="simple"> <li>Encryption type: None, SSL/TLS, or STARTTLS</li> <li>The From address you want your outgoing Nextcloud mails to use</li> <li>Whether authentication is required</li> <li>Authentication method: None, Login, Plain, or NT LAN Manager</li> <li>The server’s IP address or fully-qualified domain name and the SMTP port</li> <li>Login credentials (if required)</li> </ul> <div class="figure"> <img alt="../_images/smtp-config-smtp.png" src="../_images/smtp-config-smtp.png" /> </div> <p>Your changes are saved immediately, and you can click the Send Email button to test your configuration. This sends a test message to the email address you configured on your Personal page. The test message says:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">If</span> <span class="n">you</span> <span class="n">received</span> <span class="n">this</span> <span class="n">email</span><span class="p">,</span> <span class="n">the</span> <span class="n">settings</span> <span class="n">seem</span> <span class="n">to</span> <span class="n">be</span> <span class="n">correct</span><span class="o">.</span> <span class="o">--</span> <span class="n">Nextcloud</span> <span class="n">a</span> <span class="n">safe</span> <span class="n">home</span> <span class="k">for</span> <span class="nb">all</span> <span class="n">your</span> <span class="n">data</span> </pre></div> </div> </div> <div class="section" id="configuring-sendmail-qmail"> <h2>Configuring Sendmail/qmail<a class="headerlink" href="#configuring-sendmail-qmail" title="Permalink to this headline">¶</a></h2> <p>Configuring Sendmail or qmail requires only that you select one of them instead of SMTP, and then enter your desired return email address.</p> <p>In most cases the <code class="docutils literal notranslate"><span class="pre">SMTP</span></code> option is best, since you will be able to control all of your mail server options in one place, in your mail server configuration then.</p> </div> <div class="section" id="using-email-templates"> <h2>Using email templates<a class="headerlink" href="#using-email-templates" title="Permalink to this headline">¶</a></h2> <p>We designed a mechanism that generates emails which follow the theming settings and look the same in all the different email clients out there.</p> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last">If, for some reason, you need text-only emails, consider simply configuring this on the client side or let the receiving (or even sending) mail server drop the HTML part. Note that there is no security impact from <strong>sending</strong> HTML emails, just from displaying them and thus any security risk can only be mitigated by disabling showing HTML on the client (or removing the HTML part in the mail server).</p> </div> <div class="section" id="modifying-the-look-of-emails-beyond-the-theming-app-capabilities"> <h3>Modifying the look of emails beyond the theming app capabilities<a class="headerlink" href="#modifying-the-look-of-emails-beyond-the-theming-app-capabilities" title="Permalink to this headline">¶</a></h3> <p>You can overwrite templates by writing a class that implements the template interface (or extends it to not need to copy over everything). Easiest way is to then put this class into an app and load it so you do not need to patch it on every update.</p> <p>This is the interface of the class that needs to be implemented: <a class="reference external" href="https://github.com/nextcloud/server/blob/master/lib/public/Mail/IEMailTemplate.php">https://github.com/nextcloud/server/blob/master/lib/public/Mail/IEMailTemplate.php</a></p> <p>That is the implementation that could be extended and used to see how it works: <a class="reference external" href="https://github.com/nextcloud/server/blob/master/lib/private/Mail/EMailTemplate.php">https://github.com/nextcloud/server/blob/master/lib/private/Mail/EMailTemplate.php</a></p> <p>An example from <a class="reference external" href="https://portal.nextcloud.com/article/customized-email-templates-29.html">a GitHub issue</a>:</p> <ol class="arabic simple"> <li>Look at the source code of extended class <a class="reference external" href="https://github.com/nextcloud/server/blob/master/lib/private/Mail/EMailTemplate.php">OC\Mail\EMailTemplate::class</a></li> <li>Then override what you need in your own <cite>OC\Mail\EMailTemplate::class</cite> extension</li> </ol> <p><strong>Example:</strong></p> <p>Let’s assume that we need to override the email header:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><?php namespace \OCA\MyApp; use OC\Mail\EMailTemplate; class MyClass extends EMailTemplate { protected $header = <<<EOF <table align="center" class="wrapper"> // your theme email header modification </table> EOF; } </pre></div> </div> <ol class="arabic" start="3"> <li><p class="first">Then in <code class="docutils literal notranslate"><span class="pre">config/config.php</span></code> change <code class="docutils literal notranslate"><span class="pre">mail_template_class</span></code> to your class namespace:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="s1">'mail_template_class'</span> <span class="o">=></span> <span class="s1">'OCA</span><span class="se">\\</span><span class="s1">MyApp</span><span class="se">\\</span><span class="s1">MyClass'</span><span class="p">,</span> </pre></div> </div> </li> </ol> <p>You will find a detailed step by step guide in our <a class="reference external" href="https://portal.nextcloud.com/article/customized-email-templates-29.html">support portal</a>.</p> </div> </div> <div class="section" id="setting-mail-server-parameters-in-config-php"> <h2>Setting mail server parameters in config.php<a class="headerlink" href="#setting-mail-server-parameters-in-config-php" title="Permalink to this headline">¶</a></h2> <p>If you prefer, you may set your mail server parameters in <code class="docutils literal notranslate"><span class="pre">config/config.php</span></code>. The following examples are for SMTP, Sendmail, and Qmail.</p> <div class="section" id="smtp"> <h3>SMTP<a class="headerlink" href="#smtp" title="Permalink to this headline">¶</a></h3> <p>If you want to send email using a local or remote SMTP server it is necessary to enter the name or IP address of the server, optionally followed by a colon separated port number, e.g. <strong>:425</strong>. If this value is not given the default port 25/tcp will be used unless you change that by modifying the <strong>mail_smtpport</strong> parameter.</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="s2">"mail_smtpmode"</span> <span class="o">=></span> <span class="s2">"smtp"</span><span class="p">,</span> <span class="s2">"mail_smtphost"</span> <span class="o">=></span> <span class="s2">"smtp.server.dom:425"</span><span class="p">,</span> </pre></div> </div> <p>or</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="s2">"mail_smtpmode"</span> <span class="o">=></span> <span class="s2">"smtp"</span><span class="p">,</span> <span class="s2">"mail_smtphost"</span> <span class="o">=></span> <span class="s2">"smtp.server.dom"</span><span class="p">,</span> <span class="s2">"mail_smtpport"</span> <span class="o">=></span> <span class="mi">425</span><span class="p">,</span> </pre></div> </div> <p>If a malware or SPAM scanner is running on the SMTP server it might be necessary that you increase the SMTP timeout to e.g. 30s:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="s2">"mail_smtptimeout"</span> <span class="o">=></span> <span class="mi">30</span><span class="p">,</span> </pre></div> </div> <p>If the SMTP server accepts insecure connections, the default setting can be used:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="s2">"mail_smtpsecure"</span> <span class="o">=></span> <span class="s1">''</span><span class="p">,</span> </pre></div> </div> <p>If the SMTP server only accepts secure connections you can choose between the following two variants:</p> </div> <div class="section" id="ssl"> <h3>SSL<a class="headerlink" href="#ssl" title="Permalink to this headline">¶</a></h3> <p>A secure connection will be initiated using the outdated SMTPS protocol which uses the port 465/tcp:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="s2">"mail_smtphost"</span> <span class="o">=></span> <span class="s2">"smtp.server.dom:465"</span><span class="p">,</span> <span class="s2">"mail_smtpsecure"</span> <span class="o">=></span> <span class="s1">'ssl'</span><span class="p">,</span> </pre></div> </div> </div> <div class="section" id="tls"> <h3>TLS<a class="headerlink" href="#tls" title="Permalink to this headline">¶</a></h3> <p>A secure connection will be initiated using the STARTTLS protocol which uses the default port 25/tcp:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="s2">"mail_smtphost"</span> <span class="o">=></span> <span class="s2">"smtp.server.dom"</span><span class="p">,</span> <span class="s2">"mail_smtpsecure"</span> <span class="o">=></span> <span class="s1">'tls'</span><span class="p">,</span> </pre></div> </div> <p>And finally it is necessary to configure if the SMTP server requires authentication, if not, the default values can be taken as is.</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="s2">"mail_smtpauth"</span> <span class="o">=></span> <span class="n">false</span><span class="p">,</span> <span class="s2">"mail_smtpname"</span> <span class="o">=></span> <span class="s2">""</span><span class="p">,</span> <span class="s2">"mail_smtppassword"</span> <span class="o">=></span> <span class="s2">""</span><span class="p">,</span> </pre></div> </div> <p>If SMTP authentication is required you have to set the required username and password and can optionally choose between the authentication types <strong>LOGIN</strong> (default) or <strong>PLAIN</strong>.</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="s2">"mail_smtpauth"</span> <span class="o">=></span> <span class="n">true</span><span class="p">,</span> <span class="s2">"mail_smtpauthtype"</span> <span class="o">=></span> <span class="s2">"LOGIN"</span><span class="p">,</span> <span class="s2">"mail_smtpname"</span> <span class="o">=></span> <span class="s2">"username"</span><span class="p">,</span> <span class="s2">"mail_smtppassword"</span> <span class="o">=></span> <span class="s2">"password"</span><span class="p">,</span> </pre></div> </div> <p>Advanced users can add additional stream options in <code class="docutils literal notranslate"><span class="pre">config/config.php</span></code>, which maps directly to <a class="reference external" href="https://swiftmailer.symfony.com/">Swift Mailer’s</a> <code class="docutils literal notranslate"><span class="pre">streamOptions</span></code> configuration parameter:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="s2">"mail_smtpstreamoptions"</span> <span class="o">=></span> <span class="n">array</span><span class="p">(),</span> </pre></div> </div> </div> <div class="section" id="sendmail"> <h3>Sendmail<a class="headerlink" href="#sendmail" title="Permalink to this headline">¶</a></h3> <p>If you want to use the well known Sendmail program to send email, it is necessary to have an installed and working email system on your *nix server. The sendmail binary (<strong>/usr/sbin/sendmail</strong>) is usually part of that system. Nextcloud should be able to send email out of the box.</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="s2">"mail_smtpmode"</span> <span class="o">=></span> <span class="s2">"sendmail"</span><span class="p">,</span> <span class="s2">"mail_smtphost"</span> <span class="o">=></span> <span class="s2">"127.0.0.1"</span><span class="p">,</span> <span class="s2">"mail_smtpport"</span> <span class="o">=></span> <span class="mi">25</span><span class="p">,</span> <span class="s2">"mail_smtptimeout"</span> <span class="o">=></span> <span class="mi">10</span><span class="p">,</span> <span class="s2">"mail_smtpsecure"</span> <span class="o">=></span> <span class="s2">""</span><span class="p">,</span> <span class="s2">"mail_smtpauth"</span> <span class="o">=></span> <span class="n">false</span><span class="p">,</span> <span class="s2">"mail_smtpauthtype"</span> <span class="o">=></span> <span class="s2">"LOGIN"</span><span class="p">,</span> <span class="s2">"mail_smtpname"</span> <span class="o">=></span> <span class="s2">""</span><span class="p">,</span> <span class="s2">"mail_smtppassword"</span> <span class="o">=></span> <span class="s2">""</span><span class="p">,</span> </pre></div> </div> </div> <div class="section" id="qmail"> <h3>qmail<a class="headerlink" href="#qmail" title="Permalink to this headline">¶</a></h3> <p>If you want to use the qmail program to send email, it is necessary to have an installed and working qmail email system on your server. The qmail binary installed on your server will then be used to send email. Nextcloud should be able to send email out of the box.</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="s2">"mail_smtpmode"</span> <span class="o">=></span> <span class="s2">"qmail"</span><span class="p">,</span> <span class="s2">"mail_smtphost"</span> <span class="o">=></span> <span class="s2">"127.0.0.1"</span><span class="p">,</span> <span class="s2">"mail_smtpport"</span> <span class="o">=></span> <span class="mi">25</span><span class="p">,</span> <span class="s2">"mail_smtptimeout"</span> <span class="o">=></span> <span class="mi">10</span><span class="p">,</span> <span class="s2">"mail_smtpsecure"</span> <span class="o">=></span> <span class="s2">""</span><span class="p">,</span> <span class="s2">"mail_smtpauth"</span> <span class="o">=></span> <span class="n">false</span><span class="p">,</span> <span class="s2">"mail_smtpauthtype"</span> <span class="o">=></span> <span class="s2">"LOGIN"</span><span class="p">,</span> <span class="s2">"mail_smtpname"</span> <span class="o">=></span> <span class="s2">""</span><span class="p">,</span> <span class="s2">"mail_smtppassword"</span> <span class="o">=></span> <span class="s2">""</span><span class="p">,</span> </pre></div> </div> </div> </div> <div class="section" id="send-a-test-email"> <h2>Send a test email<a class="headerlink" href="#send-a-test-email" title="Permalink to this headline">¶</a></h2> <p>To test your email configuration, save your email address in your personal settings and then use the <strong>Send email</strong> button in the <em>Email Server</em> section of the Admin settings page.</p> </div> <div class="section" id="troubleshooting"> <h2>Troubleshooting<a class="headerlink" href="#troubleshooting" title="Permalink to this headline">¶</a></h2> <p>If you are unable to send email, try turning on debugging. Do this by enabling the <code class="docutils literal notranslate"><span class="pre">mail_smtpdebug</span></code> parameter in <code class="docutils literal notranslate"><span class="pre">config/config.php</span></code>.</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="s2">"mail_smtpdebug"</span> <span class="o">=></span> <span class="n">true</span><span class="p">;</span> </pre></div> </div> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last">Immediately after pressing the <strong>Send email</strong> button, as described before, several <strong>SMTP -> get_lines(): …</strong> messages appear on the screen. This is expected behavior and can be ignored.</p> </div> <p><strong>Question</strong>: Why is my web domain different from my mail domain?</p> <p><strong>Answer</strong>: The default domain name used for the sender address is the hostname where your Nextcloud installation is served. If you have a different mail domain name you can override this behavior by setting the following configuration parameter:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="s2">"mail_domain"</span> <span class="o">=></span> <span class="s2">"example.com"</span><span class="p">,</span> </pre></div> </div> <p>This setting results in every email sent by Nextcloud (for example, the password reset email) having the domain part of the sender address appear as follows:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">no</span><span class="o">-</span><span class="n">reply</span><span class="nd">@example</span><span class="o">.</span><span class="n">com</span> </pre></div> </div> <p><strong>Question</strong>: How can I find out if an SMTP server is reachable?</p> <p><strong>Answer</strong>: Use the ping command to check the server availability:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ping</span> <span class="n">smtp</span><span class="o">.</span><span class="n">server</span><span class="o">.</span><span class="n">dom</span> </pre></div> </div> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">PING</span> <span class="n">smtp</span><span class="o">.</span><span class="n">server</span><span class="o">.</span><span class="n">dom</span> <span class="p">(</span><span class="n">ip</span><span class="o">-</span><span class="n">address</span><span class="p">)</span> <span class="mi">56</span><span class="p">(</span><span class="mi">84</span><span class="p">)</span> <span class="nb">bytes</span> <span class="n">of</span> <span class="n">data</span><span class="o">.</span> <span class="mi">64</span> <span class="nb">bytes</span> <span class="kn">from</span> <span class="nn">your</span><span class="o">-</span><span class="n">server</span><span class="o">.</span><span class="n">local</span><span class="o">.</span><span class="n">lan</span> <span class="p">(</span><span class="mf">192.168</span><span class="o">.</span><span class="mf">1.10</span><span class="p">):</span> <span class="n">icmp_req</span><span class="o">=</span><span class="mi">1</span> <span class="n">ttl</span><span class="o">=</span><span class="mi">64</span> <span class="n">time</span><span class="o">=</span><span class="mf">3.64</span><span class="n">ms</span> </pre></div> </div> <p><strong>Question</strong>: How can I find out if the SMTP server is listening on a specific TCP port?</p> <p><strong>Answer</strong>: The best way to get mail server information is to ask your mail server admin. If you are the mail server admin, or need information in a hurry, you can use the <code class="docutils literal notranslate"><span class="pre">netstat</span></code> command. This example shows all active servers on your system, and the ports they are listening on. The SMTP server is listening on localhost port 25.</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># netstat -pant</span> </pre></div> </div> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Active</span> <span class="n">Internet</span> <span class="n">connections</span> <span class="p">(</span><span class="n">servers</span> <span class="ow">and</span> <span class="n">established</span><span class="p">)</span> <span class="n">Proto</span> <span class="n">Recv</span><span class="o">-</span><span class="n">Q</span> <span class="n">Send</span><span class="o">-</span><span class="n">Q</span> <span class="n">Local</span> <span class="n">Address</span> <span class="n">Foreign</span> <span class="n">Address</span> <span class="n">State</span> <span class="n">ID</span><span class="o">/</span><span class="n">Program</span> <span class="n">name</span> <span class="n">tcp</span> <span class="mi">0</span> <span class="mi">0</span> <span class="mf">0.0</span><span class="o">.</span><span class="mf">0.0</span><span class="p">:</span><span class="mi">631</span> <span class="mf">0.0</span><span class="o">.</span><span class="mf">0.0</span><span class="p">:</span><span class="o">*</span> <span class="n">LISTEN</span> <span class="mi">4418</span><span class="o">/</span><span class="n">cupsd</span> <span class="n">tcp</span> <span class="mi">0</span> <span class="mi">0</span> <span class="mf">127.0</span><span class="o">.</span><span class="mf">0.1</span><span class="p">:</span><span class="mi">25</span> <span class="mf">0.0</span><span class="o">.</span><span class="mf">0.0</span><span class="p">:</span><span class="o">*</span> <span class="n">LISTEN</span> <span class="mi">2245</span><span class="o">/</span><span class="n">exim4</span> <span class="n">tcp</span> <span class="mi">0</span> <span class="mi">0</span> <span class="mf">127.0</span><span class="o">.</span><span class="mf">0.1</span><span class="p">:</span><span class="mi">3306</span> <span class="mf">0.0</span><span class="o">.</span><span class="mf">0.0</span><span class="p">:</span><span class="o">*</span> <span class="n">LISTEN</span> <span class="mi">1524</span><span class="o">/</span><span class="n">mysqld</span> </pre></div> </div> <ul class="simple"> <li>25/tcp is unencrypted smtp</li> <li>110/tcp/udp is unencrypted pop3</li> <li>143/tcp/udp is unencrypted imap4</li> <li>465/tcp is encrypted ssmtp</li> <li>993/tcp/udp is encrypted imaps</li> <li>995/tcp/udp is encrypted pop3s</li> </ul> <p><strong>Question</strong>: How can I determine if the SMTP server supports the outdated SMTPS protocol?</p> <p><strong>Answer</strong>: A good indication that the SMTP server supports the SMTPS protocol is that it is listening on port <strong>465</strong>.</p> <p><strong>Question</strong>: How can I determine what authorization and encryption protocols the mail server supports?</p> <p><strong>Answer</strong>: SMTP servers usually announce the availability of STARTTLS immediately after a connection has been established. You can easily check this using the <code class="docutils literal notranslate"><span class="pre">telnet</span></code> command.</p> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last">You must enter the marked lines to obtain the information displayed.</p> </div> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">telnet</span> <span class="n">smtp</span><span class="o">.</span><span class="n">domain</span><span class="o">.</span><span class="n">dom</span> <span class="mi">25</span> </pre></div> </div> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Trying</span> <span class="mf">192.168</span><span class="o">.</span><span class="mf">1.10</span><span class="o">...</span> <span class="n">Connected</span> <span class="n">to</span> <span class="n">smtp</span><span class="o">.</span><span class="n">domain</span><span class="o">.</span><span class="n">dom</span><span class="o">.</span> <span class="n">Escape</span> <span class="n">character</span> <span class="ow">is</span> <span class="s1">'^]'</span><span class="o">.</span> <span class="mi">220</span> <span class="n">smtp</span><span class="o">.</span><span class="n">domain</span><span class="o">.</span><span class="n">dom</span> <span class="n">ESMTP</span> <span class="n">Exim</span> <span class="mf">4.80</span><span class="o">.</span><span class="mi">1</span> <span class="n">Tue</span><span class="p">,</span> <span class="mi">22</span> <span class="n">Jan</span> <span class="mi">2013</span> <span class="mi">22</span><span class="p">:</span><span class="mi">39</span><span class="p">:</span><span class="mi">55</span> <span class="o">+</span><span class="mi">0100</span> <span class="n">EHLO</span> <span class="n">your</span><span class="o">-</span><span class="n">server</span><span class="o">.</span><span class="n">local</span><span class="o">.</span><span class="n">lan</span> <span class="c1"># <<< enter this command</span> <span class="mi">250</span><span class="o">-</span><span class="n">smtp</span><span class="o">.</span><span class="n">domain</span><span class="o">.</span><span class="n">dom</span> <span class="n">Hello</span> <span class="n">your</span><span class="o">-</span><span class="n">server</span><span class="o">.</span><span class="n">local</span><span class="o">.</span><span class="n">lan</span> <span class="p">[</span><span class="n">ip</span><span class="o">-</span><span class="n">address</span><span class="p">]</span> <span class="mi">250</span><span class="o">-</span><span class="n">SIZE</span> <span class="mi">52428800</span> <span class="mi">250</span><span class="o">-</span><span class="mi">8</span><span class="n">BITMIME</span> <span class="mi">250</span><span class="o">-</span><span class="n">PIPELINING</span> <span class="mi">250</span><span class="o">-</span><span class="n">AUTH</span> <span class="n">PLAIN</span> <span class="n">LOGIN</span> <span class="n">CRAM</span><span class="o">-</span><span class="n">MD5</span> <span class="c1"># <<< Supported auth protocols</span> <span class="mi">250</span><span class="o">-</span><span class="n">STARTTLS</span> <span class="c1"># <<< Encryption is supported</span> <span class="mi">250</span> <span class="n">HELP</span> <span class="n">QUIT</span> <span class="c1"># <<< enter this command</span> <span class="mi">221</span> <span class="n">smtp</span><span class="o">.</span><span class="n">domain</span><span class="o">.</span><span class="n">dom</span> <span class="n">closing</span> <span class="n">connection</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><strong>Question</strong>: How can I send mail when using self-signed certificates if remote SMTP server do not have options to allow this on their side?</p> <p><strong>Answer</strong>: If you are having remote SMTP setup, you can try adding this to your <code class="docutils literal notranslate"><span class="pre">config/config.php</span></code>:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="s2">"mail_smtpstreamoptions"</span> <span class="o">=></span> <span class="n">array</span><span class="p">(</span> <span class="s1">'ssl'</span> <span class="o">=></span> <span class="n">array</span><span class="p">(</span> <span class="s1">'allow_self_signed'</span> <span class="o">=></span> <span class="n">true</span><span class="p">,</span> <span class="s1">'verify_peer'</span> <span class="o">=></span> <span class="n">false</span><span class="p">,</span> <span class="s1">'verify_peer_name'</span> <span class="o">=></span> <span class="n">false</span> <span class="p">)</span> <span class="p">),</span> </pre></div> </div> </div> <div class="section" id="enabling-debug-mode"> <h2>Enabling debug mode<a class="headerlink" href="#enabling-debug-mode" title="Permalink to this headline">¶</a></h2> <p>If you are unable to send email, it might be useful to activate further debug messages by enabling the <code class="docutils literal notranslate"><span class="pre">mail_smtpdebug</span></code> parameter:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="s2">"mail_smtpdebug"</span> <span class="o">=></span> <span class="n">true</span><span class="p">,</span> </pre></div> </div> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last">Immediately after pressing the <strong>Send email</strong> button, as described before, several <strong>SMTP -> get_lines(): …</strong> messages appear on the screen. This is expected behavior and can be ignored.</p> </div> </div> </div> </div> </div> <footer> <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> <a href="external_sites.html" class="btn btn-neutral float-right" title="Linking external sites" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> <a href="config_sample_php_parameters.html" class="btn btn-neutral" title="Configuration Parameters" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> </div> <hr/> <div role="contentinfo"> <p> © Copyright 2020 Nextcloud GmbH </p> </div> </footer> </div> </div> </section> </div> <div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions"> <span class="rst-current-version" data-toggle="rst-current-version"> <span class="fa fa-book"> Read the Docs</span> v: latest <span class="fa fa-caret-down"></span> </span> <div class="rst-other-versions"> <dl> <dt>Versions</dt> <dd><a href="https://docs.nextcloud.com/server/15/admin_manual">15</a></dd> <dd><a href="https://docs.nextcloud.com/server/16/admin_manual">16</a></dd> <dd><a href="https://docs.nextcloud.com/server/17/admin_manual">17</a></dd> <dd><a href="https://docs.nextcloud.com/server/stable/admin_manual">stable</a></dd> <dd><a href="https://docs.nextcloud.com/server/latest/admin_manual">latest</a></dd> </dl> <dl> <dt>Downloads</dt> </dl> <dl> <dt>On Read the Docs</dt> <dd> <a href="///projects//?fromdocs=">Project Home</a> </dd> <dd> <a href="///builds//?fromdocs=">Builds</a> </dd> </dl> <hr/> Free document hosting provided by <a href="http://www.readthedocs.org">Read the Docs</a>. </div> </div> <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <script type="text/javascript" src="../_static/language_data.js"></script> <script type="text/javascript" src="../_static/js/theme.js"></script> <script type="text/javascript"> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); </script> </body> </html>