?i»?

Your IP : 3.144.17.43


Current Path : /home/scgforma/www/cloud/core/doc/admin/configuration_server/
Upload File :
Current File : /home/scgforma/www/cloud/core/doc/admin/configuration_server/email_configuration.html

<!DOCTYPE html>


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Email configuration &mdash; Nextcloud 13 Administration Manual 13 documentation</title>
    
    <link rel="stylesheet" href="../_static/" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="../_static/main.min.css" type="text/css" />
    <link rel="stylesheet" href="../_static/styles.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '13',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </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/js/jquery-1.11.0.min.js"></script>
    <script type="text/javascript" src="../_static/js/jquery-fix.js"></script>
    <script type="text/javascript" src="../_static/bootstrap-3.1.0/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="../_static/bootstrap-sphinx.js"></script>
    <link rel="top" title="Nextcloud 13 Administration Manual 13 documentation" href="../contents.html" />
    <link rel="up" title="Server configuration" href="index.html" />
    <link rel="next" title="Linking external sites" href="external_sites.html" />
    <link rel="prev" title="Config.php Parameters" href="config_sample_php_parameters.html" />
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="theme-color" content="#1d2d44">

  </head>
  <body role="document">


<div class="wrap container not-front">
  <div class="content row">
  <main class="main">
    
			<div class="row">
				<div class="col-md-3">
					<div class="sidebar">
            <h1>Nextcloud 13 Administration Manual</h1>
            
            <div class="sidebar-search">
              <form class="headersearch" action="../search.html" method="get">
                <input type="text" value="" name="q" id="q" class="form-control" /> 
                <button  class="btn btn-default" type="submit" id="searchsubmit">Search</button>
              </form>
            </div>
            
							<div class="menu-support-container">
								<ul id="menu-support" class="menu">
									<ul>
                    <li><a href="../contents.html">Table of Contents</a></li>
									</ul>
                  <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="../installation/index.html">Installation</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Server 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">Configuring the activity app</a></li>
<li class="toctree-l2"><a class="reference internal" href="caching_configuration.html">Configuring memory caching</a></li>
<li class="toctree-l2"><a class="reference internal" href="background_jobs_configuration.html">Defining background jobs</a></li>
<li class="toctree-l2"><a class="reference internal" href="config_sample_php_parameters.html">Config.php Parameters</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="">Email configuration</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-php-and-sendmail">Configuring PHP and sendmail</a></li>
<li class="toctree-l3"><a class="reference internal" href="#using-email-templates">Using email templates</a></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></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 configuration</a></li>
<li class="toctree-l2"><a class="reference internal" href="logging_configuration.html">Logging configuration</a></li>
<li class="toctree-l2"><a class="reference internal" href="harden_server.html">Hardening and security guidance</a></li>
<li class="toctree-l2"><a class="reference internal" href="reverse_proxy_configuration.html">Reverse proxy configuration</a></li>
<li class="toctree-l2"><a class="reference internal" href="thirdparty_php_configuration.html">Using third party PHP components</a></li>
<li class="toctree-l2"><a class="reference internal" href="automatic_configuration.html">Automatic configuration setup</a></li>
<li class="toctree-l2"><a class="reference internal" href="server_tuning.html">Server tuning</a></li>
<li class="toctree-l2"><a class="reference internal" href="theming.html">Theming</a></li>
</ul>
</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>
</ul>

								</ul>
							</div>
					</div>
				</div>
        

				<div class="col-md-9">
					<div class="page-content">
            
<ul class="prevnext-title list-unstyled list-inline">
  <li class="prev">
    <a href="config_sample_php_parameters.html" title="Previous Chapter: Config.php Parameters"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm">&laquo; Config.php Parameters</span>
    </a>
  </li>
  <li class="next">
    <a href="external_sites.html" title="Next Chapter: Linking external sites"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm">Linking external sites &raquo;</span>
    </a>
  </li>
</ul>
						
  <div class="section" id="email-configuration">
<h1>Email configuration<a class="headerlink" href="#email-configuration" 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>
<p>Nextcloud 7 introduces a new feature, the graphical Email Configuration Wizard.</p>
<div class="figure">
<img alt="../_images/smtp-config-wizard.png" src="../_images/smtp-config-wizard.png" />
</div>
<p>With the new wizard, connecting Nextcloud to your mail server is fast and easy.
The wizard fills in the values in <code class="docutils literal"><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, PHP, and Sendmail. Use the SMTP configurator for a remote server, and PHP
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"><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 mailserver administrator to
connect Nextcloud to a remote SMTP server:</p>
<ul class="simple">
<li>Encryption type: None, SSL, or TLS</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&#8217;s IP address or fully-qualified domain name</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-python"><div class="highlight"><pre>If you received this email, the settings seem to be correct.

--
Nextcloud
a safe home for all your data
</pre></div>
</div>
</div>
<div class="section" id="configuring-php-and-sendmail">
<h2>Configuring PHP and sendmail<a class="headerlink" href="#configuring-php-and-sendmail" title="Permalink to this headline">ΒΆ</a></h2>
<p>Configuring PHP or Sendmail requires only that you select one of them, and then
enter your desired return address.</p>
<div class="figure">
<img alt="../_images/smtp-config-php-sendmail.png" src="../_images/smtp-config-php-sendmail.png" />
</div>
<p>How do you decide which one to use? PHP mode uses your local <code class="docutils literal"><span class="pre">sendmail</span></code>
binary. Use this if you want to use <code class="docutils literal"><span class="pre">php.ini</span></code> to control some of your mail
server functions, such as setting paths, headers, or passing extra command
options to the <code class="docutils literal"><span class="pre">sendmail</span></code> binary. These vary according to which server you
are using, so consult your server&#8217;s documentation to see what your options are.</p>
<p>In most cases the <code class="docutils literal"><span class="pre">smtp</span></code> option is best, because it removes the extra step of
passing through PHP, and you can control all of your mail server options in one
place, in your mail server configuration.</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 removed the template editor in Nextcloud 12 because we changed how emails
are generated. While the customization capabilities offered by the template editor
were easy to use, they often resulted in broken emails. To fix this, we designed a
much easier mechanism that automatically generates emails which follow the theme
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 now overwrite templates by writing a class that implements the template interface
(or extends it to not need to copy over everything). Easiest way is 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">OCMailEMailTemplate::class</a></li>
<li>Then override what you need in your own <cite>OCMailEMailTemplate::class</cite> extension</li>
</ol>
<p><strong>Example:</strong></p>
<p>Let&#8217;s assume that we need to override the email header:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;?php

namespace \OCA\MyApp;

use OC\Mail\EMailTemplate;

class MyClass extends EMailTemplate
{
   protected $header = &lt;&lt;&lt;EOF
      &lt;table align=&quot;center&quot; class=&quot;wrapper&quot;&gt;
            // your theme email header modification
      &lt;/table&gt;
   EOF;
}
</pre></div>
</div>
<ol class="arabic" start="3">
<li><p class="first">Then in <code class="docutils literal"><span class="pre">config/config.php</span></code> change <code class="docutils literal"><span class="pre">mail_template_class</span></code> to your class namespace:</p>
<div class="highlight-python"><div class="highlight"><pre>&#39;mail_template_class&#39; =&gt; &#39;OCA\\MyApp\\MyClass&#39;,
</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"><span class="pre">config/config.php</span></code>.
The following examples are for SMTP, PHP, 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-python"><div class="highlight"><pre>&lt;?php

  &quot;mail_smtpmode&quot;     =&gt; &quot;smtp&quot;,
  &quot;mail_smtphost&quot;     =&gt; &quot;smtp.server.dom:425&quot;,
</pre></div>
</div>
<p>or</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;?php

  &quot;mail_smtpmode&quot;     =&gt; &quot;smtp&quot;,
  &quot;mail_smtphost&quot;     =&gt; &quot;smtp.server.dom&quot;,
  &quot;mail_smtpport&quot;     =&gt; 425,
</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-python"><div class="highlight"><pre>&lt;?php

  &quot;mail_smtptimeout&quot;  =&gt; 30,
</pre></div>
</div>
<p>If the SMTP server accepts insecure connections, the default setting can be
used:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;?php

&quot;mail_smtpsecure&quot;   =&gt; &#39;&#39;,
</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-python"><div class="highlight"><pre>&lt;?php

  &quot;mail_smtphost&quot;     =&gt; &quot;smtp.server.dom:465&quot;,
  &quot;mail_smtpsecure&quot;   =&gt; &#39;ssl&#39;,
</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-python"><div class="highlight"><pre>&lt;?php

  &quot;mail_smtphost&quot;     =&gt; &quot;smtp.server.dom&quot;,
  &quot;mail_smtpsecure&quot;   =&gt; &#39;tls&#39;,
</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-python"><div class="highlight"><pre>&lt;?php

  &quot;mail_smtpauth&quot;     =&gt; false,
  &quot;mail_smtpname&quot;     =&gt; &quot;&quot;,
  &quot;mail_smtppassword&quot; =&gt; &quot;&quot;,
</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-python"><div class="highlight"><pre>&lt;?php

  &quot;mail_smtpauth&quot;     =&gt; true,
  &quot;mail_smtpauthtype&quot; =&gt; &quot;LOGIN&quot;,
  &quot;mail_smtpname&quot;     =&gt; &quot;username&quot;,
  &quot;mail_smtppassword&quot; =&gt; &quot;password&quot;,
</pre></div>
</div>
</div>
<div class="section" id="php-mail">
<h3>PHP mail<a class="headerlink" href="#php-mail" title="Permalink to this headline">ΒΆ</a></h3>
<p>If you want to use PHP mail it is necessary to have an installed and working
email system on your server. Which program in detail is used to send email is
defined by the configuration settings in the <strong>php.ini</strong> file. (On *nix
systems this will most likely be Sendmail.) Nextcloud should be able to send
email out of the box.</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;?php

  &quot;mail_smtpmode&quot;     =&gt; &quot;php&quot;,
  &quot;mail_smtphost&quot;     =&gt; &quot;127.0.0.1&quot;,
  &quot;mail_smtpport&quot;     =&gt; 25,
  &quot;mail_smtptimeout&quot;  =&gt; 10,
  &quot;mail_smtpsecure&quot;   =&gt; &quot;&quot;,
  &quot;mail_smtpauth&quot;     =&gt; false,
  &quot;mail_smtpauthtype&quot; =&gt; &quot;LOGIN&quot;,
  &quot;mail_smtpname&quot;     =&gt; &quot;&quot;,
  &quot;mail_smtppassword&quot; =&gt; &quot;&quot;,
</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-python"><div class="highlight"><pre>&lt;?php

  &quot;mail_smtpmode&quot;     =&gt; &quot;sendmail&quot;,
  &quot;mail_smtphost&quot;     =&gt; &quot;127.0.0.1&quot;,
  &quot;mail_smtpport&quot;     =&gt; 25,
  &quot;mail_smtptimeout&quot;  =&gt; 10,
  &quot;mail_smtpsecure&quot;   =&gt; &quot;&quot;,
  &quot;mail_smtpauth&quot;     =&gt; false,
  &quot;mail_smtpauthtype&quot; =&gt; &quot;LOGIN&quot;,
  &quot;mail_smtpname&quot;     =&gt; &quot;&quot;,
  &quot;mail_smtppassword&quot; =&gt; &quot;&quot;,
</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 sendmail binary
(<strong>/var/qmail/bin/sendmail</strong>) will then be used to send email. Nextcloud should
be able to send email out of the box.</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;?php

  &quot;mail_smtpmode&quot;     =&gt; &quot;qmail&quot;,
  &quot;mail_smtphost&quot;     =&gt; &quot;127.0.0.1&quot;,
  &quot;mail_smtpport&quot;     =&gt; 25,
  &quot;mail_smtptimeout&quot;  =&gt; 10,
  &quot;mail_smtpsecure&quot;   =&gt; &quot;&quot;,
  &quot;mail_smtpauth&quot;     =&gt; false,
  &quot;mail_smtpauthtype&quot; =&gt; &quot;LOGIN&quot;,
  &quot;mail_smtpname&quot;     =&gt; &quot;&quot;,
  &quot;mail_smtppassword&quot; =&gt; &quot;&quot;,
</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"><span class="pre">mail_smtpdebug</span> <span class="pre">parameter</span></code> in <code class="docutils literal"><span class="pre">config/config.php</span></code>.</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;?php

  &quot;mail_smtpdebug&quot; =&gt; true;
</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 -&gt; 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-python"><div class="highlight"><pre>&lt;?php

  &quot;mail_domain&quot; =&gt; &quot;example.com&quot;,
</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-python"><div class="highlight"><pre>no-reply@example.com
</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-python"><div class="highlight"><pre>ping smtp.server.dom
</pre></div>
</div>
<div class="highlight-python"><div class="highlight"><pre>PING smtp.server.dom (ip-address) 56(84) bytes of data.
64 bytes from your-server.local.lan (192.168.1.10): icmp_req=1 ttl=64
time=3.64ms
</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"><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-python"><div class="highlight"><pre><span class="c1"># netstat -pant</span>
</pre></div>
</div>
<div class="highlight-python"><div class="highlight"><pre>Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address   Foreign Address  State  ID/Program name
tcp    0      0    0.0.0.0:631     0.0.0.0:*        LISTEN   4418/cupsd
tcp    0      0    127.0.0.1:25    0.0.0.0:*        LISTEN   2245/exim4
tcp    0      0    127.0.0.1:3306  0.0.0.0:*        LISTEN   1524/mysqld
</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"><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-python"><div class="highlight"><pre>telnet smtp.domain.dom 25
</pre></div>
</div>
<div class="highlight-python"><div class="highlight"><pre>Trying 192.168.1.10...
Connected to smtp.domain.dom.
Escape character is &#39;^]&#39;.
220 smtp.domain.dom ESMTP Exim 4.80.1 Tue, 22 Jan 2013 22:39:55 +0100
EHLO your-server.local.lan                   # &lt;&lt;&lt; enter this command
250-smtp.domain.dom Hello your-server.local.lan [ip-address]
250-SIZE 52428800
250-8BITMIME
250-PIPELINING
250-AUTH PLAIN LOGIN CRAM-MD5                 # &lt;&lt;&lt; Supported auth protocols
250-STARTTLS                                  # &lt;&lt;&lt; Encryption is supported
250 HELP
QUIT                                          # &lt;&lt;&lt; enter this command
221 smtp.domain.dom closing connection
Connection closed by foreign host.
</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 mail_smtpdebug parameter:</p>
<div class="highlight-python"><div class="highlight"><pre>&lt;?php

  &quot;mail_smtpdebug&quot; =&gt; true,
</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 -&gt; get_lines(): ...</strong> messages appear on the screen.
This is expected behavior and can be ignored.</p>
</div>
</div>
</div>


            
<ul class="prevnext-title list-unstyled list-inline">
  <li class="prev">
    <a href="config_sample_php_parameters.html" title="Previous Chapter: Config.php Parameters"><span class="glyphicon glyphicon-chevron-left visible-sm"></span><span class="hidden-sm">&laquo; Config.php Parameters</span>
    </a>
  </li>
  <li class="next">
    <a href="external_sites.html" title="Next Chapter: Linking external sites"><span class="glyphicon glyphicon-chevron-right visible-sm"></span><span class="hidden-sm">Linking external sites &raquo;</span>
    </a>
  </li>
</ul>
					</div>
				</div>
			</div>
  </main>  
  </div>
</div>
  </body>
</html>