diff --git a/admin_manual/configuration_server/email_configuration.rst b/admin_manual/configuration_server/email_configuration.rst index dbd67cd4e..f9a273aaa 100644 --- a/admin_manual/configuration_server/email_configuration.rst +++ b/admin_manual/configuration_server/email_configuration.rst @@ -2,38 +2,36 @@ Email configuration =================== -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. +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. -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, +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. -Nextcloud 7 introduces a new feature, the graphical Email Configuration Wizard. - .. figure:: ../images/smtp-config-wizard.png - -With the new wizard, connecting Nextcloud to your mail server is fast and easy. -The wizard fills in the values in ``config/config.php``, so you may use either + +With the new wizard, connecting Nextcloud to your mail server is fast and easy. +The wizard fills in the values in ``config/config.php``, so you may use either or both as you prefer. -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. +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. -.. note:: The Sendmail option refers to the Sendmail SMTP server, and any - drop-in Sendmail replacement such as Postfix, Exim, or Courier. All of +.. note:: 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 ``sendmail`` binary, and are freely-interchangeable. Configuring an SMTP server -------------------------- -You need the following information from your mailserver administrator to +You need the following information from your mail server administrator to connect Nextcloud to a remote SMTP server: -* Encryption type: None, SSL, or TLS +* Encryption type: None, SSL/TLS, or STARTTLS * The From address you want your outgoing Nextcloud mails to use @@ -41,40 +39,30 @@ connect Nextcloud to a remote SMTP server: * Authentication method: None, Login, Plain, or NT LAN Manager -* The server's IP address or fully-qualified domain name +* The server's IP address or fully-qualified domain name and the SMTP port -* Login credentials, if required +* Login credentials (if required) .. figure:: ../images/smtp-config-smtp.png -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 +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:: If you received this email, the settings seem to be correct. - + -- Nextcloud a safe home for all your data -Configuring PHP and sendmail ----------------------------- +Configuring Sendmail/qmail +-------------------------- -Configuring PHP or Sendmail requires only that you select one of them, and then -enter your desired return address. - -.. figure:: ../images/smtp-config-php-sendmail.png - -How do you decide which one to use? PHP mode uses your local ``sendmail`` -binary. Use this if you want to use ``php.ini`` to control some of your mail -server functions, such as setting paths, headers, or passing extra command -options to the ``sendmail`` binary. These vary according to which server you -are using, so consult your server's documentation to see what your options are. - -In most cases the ``smtp`` 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. +Configuring Sendmail or qmail requires only that you select one of them +instead of SMTP, and then enter your desired return email address. +In most cases the ``SMTP`` 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. Using email templates --------------------- @@ -94,8 +82,8 @@ settings and look the same in all the different email clients out there. Modifying the look of emails beyond the theming app capabilities ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -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 +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). This is the interface of the class that needs to be implemented: https://github.com/nextcloud/server/blob/master/lib/public/Mail/IEMailTemplate.php @@ -120,7 +108,7 @@ Let's assume that we need to override the email header:: class MyClass extends EMailTemplate { - protected $header = << // your theme email header modification @@ -136,7 +124,7 @@ You will find a detailed step by step guide in our `support portal "username", "mail_smtppassword" => "password", -PHP mail -^^^^^^^^ - -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 **php.ini** file. (On \*nix -systems this will most likely be Sendmail.) Nextcloud should be able to send -email out of the box. - -:: - - "php", - "mail_smtphost" => "127.0.0.1", - "mail_smtpport" => 25, - "mail_smtptimeout" => 10, - "mail_smtpsecure" => "", - "mail_smtpauth" => false, - "mail_smtpauthtype" => "LOGIN", - "mail_smtpname" => "", - "mail_smtppassword" => "", - Sendmail ^^^^^^^^ @@ -284,8 +249,8 @@ qmail ^^^^^ 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 -(**/var/qmail/bin/sendmail**) will then be used to send email. Nextcloud should +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. :: @@ -313,7 +278,7 @@ of the Admin settings page. Troubleshooting --------------- -If you are unable to send email, try turning on debugging. Do this by enabling +If you are unable to send email, try turning on debugging. Do this by enabling the ``mail_smtpdebug parameter`` in ``config/config.php``. :: @@ -322,15 +287,15 @@ the ``mail_smtpdebug parameter`` in ``config/config.php``. "mail_smtpdebug" => true; -.. note:: Immediately after pressing the **Send email** button, as described - before, several **SMTP -> get_lines(): ...** messages appear on the screen. +.. note:: Immediately after pressing the **Send email** button, as described + before, several **SMTP -> get_lines(): ...** messages appear on the screen. This is expected behavior and can be ignored. **Question**: Why is my web domain different from my mail domain? -**Answer**: 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 +**Answer**: 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: :: @@ -339,7 +304,7 @@ parameter: "mail_domain" => "example.com", -This setting results in every email sent by Nextcloud (for example, the password +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:: no-reply@example.com @@ -357,13 +322,13 @@ reset email) having the domain part of the sender address appear as follows:: time=3.64ms -**Question**: How can I find out if the SMTP server is listening on a specific +**Question**: How can I find out if the SMTP server is listening on a specific TCP port? -**Answer**: 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 ``netstat`` command. This example shows all active -servers on your system, and the ports they are listening on. The SMTP server is +**Answer**: 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 ``netstat`` 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. :: @@ -378,30 +343,30 @@ listening on localhost port 25. 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 -* 25/tcp is unencrypted smtp +* 25/tcp is unencrypted smtp -* 110/tcp/udp is unencrypted pop3 +* 110/tcp/udp is unencrypted pop3 * 143/tcp/udp is unencrypted imap4 * 465/tcp is encrypted ssmtp * 993/tcp/udp is encrypted imaps - -* 995/tcp/udp is encrypted pop3s + +* 995/tcp/udp is encrypted pop3s -**Question**: How can I determine if the SMTP server supports the outdated SMTPS +**Question**: How can I determine if the SMTP server supports the outdated SMTPS protocol? -**Answer**: A good indication that the SMTP server supports the SMTPS protocol -is that it is listening on port **465**. +**Answer**: A good indication that the SMTP server supports the SMTPS protocol +is that it is listening on port **465**. -**Question**: How can I determine what authorization and encryption protocols +**Question**: How can I determine what authorization and encryption protocols the mail server supports? -**Answer**: SMTP servers usually announce the availability of STARTTLS -immediately after a connection has been established. You can easily check this +**Answer**: SMTP servers usually announce the availability of STARTTLS +immediately after a connection has been established. You can easily check this using the ``telnet`` command. .. note:: You must enter the marked lines to obtain the information displayed. diff --git a/admin_manual/images/smtp-config-wizard.png b/admin_manual/images/smtp-config-wizard.png index d6570c606..ab037d853 100644 Binary files a/admin_manual/images/smtp-config-wizard.png and b/admin_manual/images/smtp-config-wizard.png differ