Skip to content

Commit 6bb0671

Browse files
authored
Merge pull request #13993 from nextcloud/fix/move-mail-documentation
fix(groupware): Move admin and user documentation for mail app out of mail repo and update debug logging
2 parents ab1f037 + 0f673fa commit 6bb0671

File tree

3 files changed

+372
-18
lines changed

3 files changed

+372
-18
lines changed

admin_manual/groupware/mail.rst

Lines changed: 121 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,120 @@
22
Mail
33
====
44

5+
Configuration
6+
-------------
7+
8+
Local IMAP and SMTP servers
9+
^^^^^^^^^^^^^^^^^^^^^^^^^^^
10+
11+
By default, Nextcloud does not allow local hostnames and IP addresses as remote servers. This includes IMAP, SMTP and Sieve servers
12+
like ``localhost``, ``mx.local`` and ``10.0.0.3``. This check can be disabled with via ``config/config.php``.
13+
14+
::
15+
16+
'allow_local_remote_servers' => true,
17+
18+
Attachment size limit
19+
^^^^^^^^^^^^^^^^^^^^^
20+
21+
Admins can prevent users from attaching large attachments to their emails. Users will be asked to use link shares instead.
22+
23+
::
24+
25+
'app.mail.attachment-size-limit' => 3*1024*1024,
26+
27+
The unit is bytes. The example about with limit to 3MB attachments. The default is 0 bytes which means no upload limit.
28+
29+
Timeouts
30+
^^^^^^^^
31+
32+
Depending on your mail host, it may be necessary to increase your IMAP and/or SMTP timeout threshold.
33+
Currently IMAP defaults to 5 seconds and SMTP defaults to 20 seconds. They can be changed as follows:
34+
35+
IMAP timeout
36+
~~~~~~~~~~~~
37+
38+
::
39+
40+
'app.mail.imap.timeout' => 5
41+
42+
SMTP timeout
43+
~~~~~~~~~~~~
44+
45+
::
46+
47+
'app.mail.smtp.timeout' => 20
48+
49+
Sieve timeout
50+
~~~~~~~~~~~~~
51+
52+
::
53+
54+
'app.mail.sieve.timeout' => 5
55+
56+
Background sync interval
57+
^^^^^^^^^^^^^^^^^^^^^^^^
58+
59+
Configure how often Mail keeps users' mailboxes updated in the background in seconds. Defaults to 3600, minimum 300.
60+
61+
::
62+
63+
'app.mail.background-sync-interval' => 7200,
64+
65+
Use php-mail for sending mail
66+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
67+
68+
.. warning:: Support for using php-mail was removed in version 4.4 of the mail app!
69+
70+
You can use the php-mail function to send mails. This is needed for some web hosters (1&1 (1und1)).
71+
72+
::
73+
74+
'app.mail.transport' => 'php-mail'
75+
76+
Disable TLS verification for IMAP/SMTP
77+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
78+
79+
Turn off TLS verification for IMAP/SMTP. This happens globally for all accounts and is only needed in edge cases like with email servers that have a self-signed certificate.
80+
81+
::
82+
83+
'app.mail.verify-tls-peer' => false
84+
85+
Anti-abuse alerts
86+
^^^^^^^^^^^^^^^^^
87+
88+
The app can write alerts to the logs when users send messages to a high number of recipients or sends a high number of messages for a short period of time. These events might indicate that the account is abused for sending spam messages.
89+
90+
To enable anti-abuse alerts, you'll have to set a few configuration options :doc:`via occ <../occ_command>` .
91+
92+
::
93+
94+
# Turn alerts on
95+
occ config:app:set mail abuse_detection --value=on
96+
# Turn alerts off
97+
occ config:app:set mail abuse_detection --value=off
98+
99+
# Alert when 50 or more recipients are used for one single message
100+
occ config:app:set mail abuse_number_of_recipients_per_message_threshold --value=50
101+
102+
# Alerts can be configured for three intervals: 15m, 1h and 1d
103+
# Alert when more than 10 messages are sent in 15 minutes
104+
occ config:app:set mail abuse_number_of_messages_per_15m --value=10
105+
# Alert when more than 30 messages are sent in one hour
106+
occ config:app:set mail abuse_number_of_messages_per_1h --value=30
107+
# Alert when more than 100 messages are sent in one day
108+
occ config:app:set mail abuse_number_of_messages_per_1d --value=100
109+
110+
111+
Google OAuth
112+
^^^^^^^^^^^^
113+
114+
This app can allow users to connect their Google accounts with OAuth. This makes it possible to use accounts without 2FA or app password.
115+
116+
1. `Create authorization credentials <https://developers.google.com/identity/protocols/oauth2/web-server#prerequisites>`_. You will receive a client ID and a client secret.
117+
2. Open the Nextcloud settings page. Navigate to *Groupware* and scroll down to *Gmail integration*. Enter and save the client ID and client secret.
118+
5119
Account delegation
6120
------------------
7121

@@ -25,56 +139,49 @@ XOAUTH2 Authentication with Microsoft Azure AD
25139

26140
The Mail app supports XOAUTH2 authentication with hosted Microsoft Outlook accounts. An app has to be registered in the Microsoft Azure web interface and its credentials have to be supplied to the Nextcloud instance. You can find relevant settings in the Groupware section of the admin settings.
27141

28-
Step 1: Open the Azure AD Dashboard
29-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
142+
**Step 1: Open the Azure AD Dashboard**
30143

31144
Visit the `Azure portal <https://portal.azure.com>`_ and navigate to the Azure AD dashboard.
32145

33146
.. figure:: images/azure_xoauth2/1.png
34147

35-
Step 2: Create a new app registration
36-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
148+
**Step 2: Create a new app registration**
37149

38150
.. figure:: images/azure_xoauth2/2.png
39151

40152
Chose a name, allow organizational and personal Microsoft accounts. Configure a web app and copy the redirect URI from the groupware settings of your Nextcloud instance. Have a look at step 8 on where to find the redirect URI. Finally, click on register to proceed.
41153

42154
.. figure:: images/azure_xoauth2/3.png
43155

44-
Step 3: Copy the client ID
45-
~~~~~~~~~~~~~~~~~~~~~~~~~~
156+
**Step 3: Copy the client ID**
46157

47158
This ID will be needed later for the Nextcloud settings.
48159

49160
.. figure:: images/azure_xoauth2/4.png
50161

51-
Step 4: Create a new client secret
52-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
162+
**Step 4: Create a new client secret**
53163

54164
.. figure:: images/azure_xoauth2/5.png
55165

56166
Chose a descriptive name for the secret and set the an appropriate expiration date. Click on add to create the secret.
57167

58168
.. figure:: images/azure_xoauth2/6.png
59169

60-
Step 5: Copy the client secret
61-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
170+
**Step 5: Copy the client secret**
62171

63172
Copy the client secret manually or by clicking on the copy button. You can find it in the value column. The secret will also be needed later for the Nextcloud settings.
64173

65174
.. figure:: images/azure_xoauth2/7.png
66175

67-
Step 6: Configure Nextcloud
68-
~~~~~~~~~~~~~~~~~~~~~~~~~~~
176+
**Step 6: Configure Nextcloud**
69177

70178
Open the groupware settings in the Nextcloud admin settings and fill in the client ID and client secret. Leave the tenant ID as is (common). You can also find the redirect URI here. Click on save to proceed.
71179

72180
.. warning:: Using a custom tenant ID is not covered by this guide. Only configure it if you are an expert and changed the supported account types in step 2.
73181

74182
.. figure:: images/azure_xoauth2/8.png
75183

76-
Step 7: Connect Microsoft Outlook accounts
77-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
184+
**Step 7: Connect Microsoft Outlook accounts**
78185

79186
Congratulations! You are now able to use hosted Microsoft Outlook accounts in the Mail app. Use your Microsoft account email and any password when adding your account. The password will be discarded and you will be prompted with a Microsoft consent popup to log in to your account.
80187

0 commit comments

Comments
 (0)