Skip to content

Commit 0ffe51f

Browse files
committed
fix(groupware): Add separate section for mail troubleshooting, remove mail shortcuts and re-sort some things
Signed-off-by: David Dreschner <[email protected]>
1 parent 6bb0671 commit 0ffe51f

File tree

3 files changed

+174
-179
lines changed

3 files changed

+174
-179
lines changed

admin_manual/groupware/mail.rst

Lines changed: 56 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,30 @@ Mail
55
Configuration
66
-------------
77

8-
Local IMAP and SMTP servers
9-
^^^^^^^^^^^^^^^^^^^^^^^^^^^
8+
Anti-abuse alerts
9+
^^^^^^^^^^^^^^^^^
1010

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``.
11+
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.
12+
13+
To enable anti-abuse alerts, you'll have to set a few configuration options :doc:`via occ <../occ_command>` .
1314

1415
::
1516

16-
'allow_local_remote_servers' => true,
17+
# Turn alerts on
18+
occ config:app:set mail abuse_detection --value=on
19+
# Turn alerts off
20+
occ config:app:set mail abuse_detection --value=off
21+
22+
# Alert when 50 or more recipients are used for one single message
23+
occ config:app:set mail abuse_number_of_recipients_per_message_threshold --value=50
24+
25+
# Alerts can be configured for three intervals: 15m, 1h and 1d
26+
# Alert when more than 10 messages are sent in 15 minutes
27+
occ config:app:set mail abuse_number_of_messages_per_15m --value=10
28+
# Alert when more than 30 messages are sent in one hour
29+
occ config:app:set mail abuse_number_of_messages_per_1h --value=30
30+
# Alert when more than 100 messages are sent in one day
31+
occ config:app:set mail abuse_number_of_messages_per_1d --value=100
1732

1833
Attachment size limit
1934
^^^^^^^^^^^^^^^^^^^^^
@@ -26,6 +41,42 @@ Admins can prevent users from attaching large attachments to their emails. Users
2641

2742
The unit is bytes. The example about with limit to 3MB attachments. The default is 0 bytes which means no upload limit.
2843

44+
Background sync interval
45+
^^^^^^^^^^^^^^^^^^^^^^^^
46+
47+
Configure how often Mail keeps users' mailboxes updated in the background in seconds. Defaults to 3600, minimum 300.
48+
49+
::
50+
51+
'app.mail.background-sync-interval' => 7200,
52+
53+
Disable TLS verification for IMAP/SMTP
54+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
55+
56+
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.
57+
58+
::
59+
60+
'app.mail.verify-tls-peer' => false
61+
62+
Google OAuth
63+
^^^^^^^^^^^^
64+
65+
This app can allow users to connect their Google accounts with OAuth. This makes it possible to use accounts without 2FA or app password.
66+
67+
1. `Create authorization credentials <https://developers.google.com/identity/protocols/oauth2/web-server#prerequisites>`_. You will receive a client ID and a client secret.
68+
2. Open the Nextcloud settings page. Navigate to *Groupware* and scroll down to *Gmail integration*. Enter and save the client ID and client secret.
69+
70+
Local IMAP and SMTP servers
71+
^^^^^^^^^^^^^^^^^^^^^^^^^^^
72+
73+
By default, Nextcloud does not allow local hostnames and IP addresses as remote servers. This includes IMAP, SMTP and Sieve servers
74+
like ``localhost``, ``mx.local`` and ``10.0.0.3``. This check can be disabled with via ``config/config.php``.
75+
76+
::
77+
78+
'allow_local_remote_servers' => true,
79+
2980
Timeouts
3081
^^^^^^^^
3182

@@ -53,15 +104,6 @@ Sieve timeout
53104

54105
'app.mail.sieve.timeout' => 5
55106

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-
65107
Use php-mail for sending mail
66108
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
67109

@@ -73,49 +115,6 @@ You can use the php-mail function to send mails. This is needed for some web hos
73115

74116
'app.mail.transport' => 'php-mail'
75117

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-
119118
Account delegation
120119
------------------
121120

admin_manual/groupware/troubleshooting.rst

Lines changed: 115 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,121 @@ C. **Delete Specific Unshares:**
4040
**Why isn't there an automated migration to correct the problem?**
4141
Unsharing a calendar is a feature, and with the given information, we cannot determine if a calendar was unshared intentionally or as a result of the bug.
4242

43+
Contacts
44+
--------
45+
46+
Unable to update contacts or events
47+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
48+
49+
If you get an error like:
50+
51+
``PATCH https://example.com/remote.php/dav HTTP/1.0 501 Not Implemented``
52+
53+
it is likely because of a misconfigured web server. Please refer to :ref:`trouble-webdav-label` for troubleshooting steps.
54+
55+
Mail
56+
----
57+
58+
Autoconfig for your mail domain fails
59+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
60+
61+
If autoconfiguration for your domain fails, you can create an autoconfig file and place it as ``https://autoconfig.yourdomain.tld/mail/config-v1.1.xml``. For more information please refer to `Mozilla's documentation <https://wiki.mozilla.org/Thunderbird:Autoconfiguration:ConfigFileFormat>`_.
62+
63+
64+
Database insert problems on MySQL
65+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66+
67+
If the mail app fails to insert new rows for messages (`oc_mail_messages`), recipients (`oc_mail_recipients`) or similar tables, you are possibly not using the 4 byte support.
68+
69+
See :doc:`../configuration_database/mysql_4byte_support` for how to update your database configuration.
70+
71+
72+
Export threading data
73+
^^^^^^^^^^^^^^^^^^^^^
74+
75+
If you encounter an issue with threading, e.g. messages that belong to the same conversation thread don't show up as one, you can export the data the algorithm will use to build threads. We are dealing with sensitive data here, but the command will optionally redact the data with the ``--redact`` switch. The exported data will then only keep the original database IDs, the rest of the data is randomized. This format does not the export message details, it still contains metadata about how many messages you have and how they relate. Please consider this before posting the data online.
76+
77+
::
78+
79+
sudo -E -u www-data php occ mail:account:export-threads 1393
80+
81+
.. note:: 1393 represents the :ref:`account ID <mail_get_account_ids_groupware>`.
82+
83+
The output will look similar to this::
84+
85+
[
86+
{
87+
"subject": "83379f9bc36915d5024de878386060b5@redacted",
88+
"id": "2def0f3597806ecb886da1d9cc323a7c@redacted",
89+
"references": [],
90+
"databaseId": 261535
91+
},
92+
{
93+
"subject": "Re: 1d4725ae1ac4e4798b541ca3f3cdce6e@redacted",
94+
"id": "ce9e248333c44a5a64ccad26f2550f95@redacted",
95+
"references": [
96+
"bc95cbaff3abbed716e1d40bbdaa58a0@redacted",
97+
"8651a9ac37674907606c936ced1333d7@redacted",
98+
"4a87e94522a3cf26dba8977ae901094d@redacted",
99+
"a3b30430b1ccb41089170eecbe315d3a@redacted",
100+
"8e9f60369dce3d8b2b27430bd50ec46d@redacted",
101+
"46cfa6e729ff329e6ede076853154113@redacted",
102+
"079e7bc89d69792839a5e1831b1cbc80@redacted",
103+
"079e7bc89d69792839a5e1831b1cbc80@redacted"
104+
],
105+
"databaseId": 262086
106+
},
107+
{
108+
"subject": "Re: 1d4725ae1ac4e4798b541ca3f3cdce6e@redacted",
109+
"id": "8dd0e0ef2f7ab100b75922489ff26306@redacted",
110+
"references": [
111+
"bc95cbaff3abbed716e1d40bbdaa58a0@redacted",
112+
"8651a9ac37674907606c936ced1333d7@redacted",
113+
"4a87e94522a3cf26dba8977ae901094d@redacted",
114+
"a3b30430b1ccb41089170eecbe315d3a@redacted",
115+
"8e9f60369dce3d8b2b27430bd50ec46d@redacted",
116+
"46cfa6e729ff329e6ede076853154113@redacted",
117+
"079e7bc89d69792839a5e1831b1cbc80@redacted",
118+
"ce9e248333c44a5a64ccad26f2550f95@redacted",
119+
"ce9e248333c44a5a64ccad26f2550f95@redacted"
120+
],
121+
"databaseId": 262087
122+
}
123+
]
124+
125+
It's recommended practice to pipe the export into a file, which you can later share with the Mail app community and developers::
126+
127+
sudo -E -u www-data php occ mail:account:export-threads 1393 | gzip -c > /tmp/nextcloud-mail-threads-1393.json.gz
128+
129+
130+
.. _mail_get_account_ids_groupware:
131+
132+
Get account IDs
133+
^^^^^^^^^^^^^^^
134+
135+
For many troubleshooting instructions you need to know the `id` of a mail account. You can acquire this through the database, but it's also possible to utilize the account export command of :doc:`occ <../occ_command>` if you know the UID of the user utilizing the mail account::
136+
137+
sudo -E -u www-data php occ mail:account:export user123
138+
139+
The output will look similar to this::
140+
141+
Account 1393:
142+
143+
- Name: Christoph Wurst
144+
- IMAP user: christoph
145+
- IMAP host: mx.domain.com:993, security: ssl
146+
- SMTP user: christoph
147+
- SMTP host: mx.domain.com:587, security: tls
148+
149+
In this example, ``1393`` is the `account ID`.
150+
151+
152+
Issues connecting to Outlook.com
153+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
154+
155+
If you can not access your Outlook.com account try to enable the `Two-Factor Verification <https://account.live.com/proofs/Manage>`_ and set up an `app password <https://account.live.com/proofs/AppPassword>`_, which you then use for the Nextcloud Mail app.
156+
157+
43158
Logging the IMAP/SMTP/Sieve connections
44159
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
45160
The Nextcloud Mail app offers an extensive logging system to make it easier identifying and tracking down bugs. As this may include sensitive data, be sure to remove or mask them before posting them publicly.
@@ -105,12 +220,6 @@ Once you've collected the necessary data, it's highly recommended to disable the
105220
sudo -E -u www-data php occ config:system:set debug --value false --type bool
106221
sudo -E -u www-data php occ config:system:set loglevel --value 2 --type int
107222

108-
Database insert problems on MySQL
109-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
110-
111-
If the mail app fails to insert new rows for messages (`oc_mail_messages`), recipients (`oc_mail_recipients`) or similar tables, you are possibly not using the 4 byte support.
112-
113-
See :doc:`../configuration_database/mysql_4byte_support` for how to update your database configuration.
114223

115224
Timeout and other connectivity issues
116225
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -135,26 +244,6 @@ The output should look similar to this::
135244
497 connections in 0.97s; 512.37 connections/user sec, bytes read 0
136245
497 connections in 31 real seconds, 0 bytes read per connection
137246

138-
.. _mail_get_account_ids_groupware:
139-
140-
Get account IDs
141-
^^^^^^^^^^^^^^^
142-
143-
For many troubleshooting instructions you need to know the `id` of a mail account. You can acquire this through the database, but it's also possible to utilize the account export command of :doc:`occ <../occ_command>` if you know the UID of the user utilizing the mail account::
144-
145-
sudo -E -u www-data php occ mail:account:export user123
146-
147-
The output will look similar to this::
148-
149-
Account 1393:
150-
151-
- Name: Christoph Wurst
152-
- IMAP user: christoph
153-
- IMAP host: mx.domain.com:993, security: ssl
154-
- SMTP user: christoph
155-
- SMTP host: mx.domain.com:587, security: tls
156-
157-
In this example, ``1393`` is the `account ID`.
158247

159248
Manual account synchronization and threading
160249
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -201,84 +290,3 @@ The output will look similar to this::
201290
[debug] Account 1393 has 9839 threads
202291
[debug] Account 1393 has 0 messages with a new thread IDs
203292
62MB of memory used
204-
205-
206-
Export threading data
207-
^^^^^^^^^^^^^^^^^^^^^
208-
209-
If you encounter an issue with threading, e.g. messages that belong to the same conversation thread don't show up as one, you can export the data the algorithm will use to build threads. We are dealing with sensitive data here, but the command will optionally redact the data with the ``--redact`` switch. The exported data will then only keep the original database IDs, the rest of the data is randomized. This format does not the export message details, it still contains metadata about how many messages you have and how they relate. Please consider this before posting the data online.
210-
211-
::
212-
213-
sudo -E -u www-data php occ mail:account:export-threads 1393
214-
215-
.. note:: 1393 represents the :ref:`account ID <mail_get_account_ids_groupware>`.
216-
217-
The output will look similar to this::
218-
219-
[
220-
{
221-
"subject": "83379f9bc36915d5024de878386060b5@redacted",
222-
"id": "2def0f3597806ecb886da1d9cc323a7c@redacted",
223-
"references": [],
224-
"databaseId": 261535
225-
},
226-
{
227-
"subject": "Re: 1d4725ae1ac4e4798b541ca3f3cdce6e@redacted",
228-
"id": "ce9e248333c44a5a64ccad26f2550f95@redacted",
229-
"references": [
230-
"bc95cbaff3abbed716e1d40bbdaa58a0@redacted",
231-
"8651a9ac37674907606c936ced1333d7@redacted",
232-
"4a87e94522a3cf26dba8977ae901094d@redacted",
233-
"a3b30430b1ccb41089170eecbe315d3a@redacted",
234-
"8e9f60369dce3d8b2b27430bd50ec46d@redacted",
235-
"46cfa6e729ff329e6ede076853154113@redacted",
236-
"079e7bc89d69792839a5e1831b1cbc80@redacted",
237-
"079e7bc89d69792839a5e1831b1cbc80@redacted"
238-
],
239-
"databaseId": 262086
240-
},
241-
{
242-
"subject": "Re: 1d4725ae1ac4e4798b541ca3f3cdce6e@redacted",
243-
"id": "8dd0e0ef2f7ab100b75922489ff26306@redacted",
244-
"references": [
245-
"bc95cbaff3abbed716e1d40bbdaa58a0@redacted",
246-
"8651a9ac37674907606c936ced1333d7@redacted",
247-
"4a87e94522a3cf26dba8977ae901094d@redacted",
248-
"a3b30430b1ccb41089170eecbe315d3a@redacted",
249-
"8e9f60369dce3d8b2b27430bd50ec46d@redacted",
250-
"46cfa6e729ff329e6ede076853154113@redacted",
251-
"079e7bc89d69792839a5e1831b1cbc80@redacted",
252-
"ce9e248333c44a5a64ccad26f2550f95@redacted",
253-
"ce9e248333c44a5a64ccad26f2550f95@redacted"
254-
],
255-
"databaseId": 262087
256-
}
257-
]
258-
259-
It's recommended practice to pipe the export into a file, which you can later share with the Mail app community and developers::
260-
261-
sudo -E -u www-data php occ mail:account:export-threads 1393 | gzip -c > /tmp/nextcloud-mail-threads-1393.json.gz
262-
263-
Autoconfig for your mail domain fails
264-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
265-
266-
If autoconfiguration for your domain fails, you can create an autoconfig file and place it as ``https://autoconfig.yourdomain.tld/mail/config-v1.1.xml``. For more information please refer to `Mozilla's documentation <https://wiki.mozilla.org/Thunderbird:Autoconfiguration:ConfigFileFormat>`_.
267-
268-
Issues connecting to Outlook.com
269-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
270-
271-
If you can not access your Outlook.com account try to enable the `Two-Factor Verification <https://account.live.com/proofs/Manage>`_ and set up an `app password <https://account.live.com/proofs/AppPassword>`_, which you then use for the Nextcloud Mail app.
272-
273-
274-
Contacts
275-
--------
276-
277-
Unable to update contacts or events
278-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
279-
280-
If you get an error like:
281-
282-
``PATCH https://example.com/remote.php/dav HTTP/1.0 501 Not Implemented``
283-
284-
it is likely because of a misconfigured web server. Please refer to :ref:`trouble-webdav-label` for troubleshooting steps.

0 commit comments

Comments
 (0)