-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expand file tree
/
Copy pathmosquitto.conf.5.xml
More file actions
2832 lines (2697 loc) · 117 KB
/
mosquitto.conf.5.xml
File metadata and controls
2832 lines (2697 loc) · 117 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet type="text/xsl" href="manpage.xsl"?>
<refentry xml:id="mosquitto.conf" xmlns:xlink="http://www.w3.org/1999/xlink">
<refmeta>
<refentrytitle>mosquitto.conf</refentrytitle>
<manvolnum>5</manvolnum>
<refmiscinfo class="source">Mosquitto Project</refmiscinfo>
<refmiscinfo class="manual">File formats and conventions</refmiscinfo>
</refmeta>
<refnamediv>
<refname>mosquitto.conf</refname>
<refpurpose>the configuration file for mosquitto</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>mosquitto.conf</command>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para>
<command>mosquitto.conf</command> is the configuration file for
mosquitto. This file can reside anywhere as long as mosquitto can read
it. By default, mosquitto does not need a configuration file and will
use the default values listed below. See
<citerefentry><refentrytitle><link xlink:href="mosquitto-8.html">mosquitto</link></refentrytitle><manvolnum>8</manvolnum></citerefentry>
for information on how to load a configuration file.
</para>
<para>
Mosquitto can be instructed to reload the configuration file by
sending a SIGHUP signal as described in the Signals section of
<citerefentry><refentrytitle><link xlink:href="mosquitto-8.html">mosquitto</link></refentrytitle><manvolnum>8</manvolnum></citerefentry>.
Not all configuration options can be reloaded, as detailed in
the options below.
</para>
</refsect1>
<refsect1>
<title>Sections</title>
<para>
The rest of this man page is divided into the following sections:
<variablelist>
<varlistentry>
<term><option>File Format</option> a description of the configuration
file syntax.</term>
</varlistentry>
<varlistentry>
<term><option>Authentication</option> a discussion of the authentication
options available.</term>
</varlistentry>
<varlistentry>
<term><option>General Options</option> the general options for configuring
Mosquitto.</term>
</varlistentry>
<varlistentry>
<term><option>Listeners</option> general options for configuring listeners,
which are the ways that MQTT clients can connect to Mosquitto,
as well as certificate and pre-shared-key based SSL/TLS options.</term>
</varlistentry>
<varlistentry>
<term><option>Configuring Bridges</option> general options for configuring bridges,
which are a way of connecting multiple brokers together,
as well as certificate and pre-shared-key based SSL/TLS options.</term>
</varlistentry>
<varlistentry>
<term><option>Other</option> The Files, Bugs, See Also sections.</term>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1>
<title>File Format</title>
<para>
All lines with a # as the very first character are treated as a
comment.
</para>
<para>
Configuration lines start with a variable name. The variable value
is separated from the name by a single space.
</para>
</refsect1>
<refsect1>
<title>Authentication</title>
<para>
The authentication options described below allow a wide range of
possibilities in conjunction with the listener options. This
section aims to clarify the possibilities. An overview is also
available at
<ulink url="https://mosquitto.org/documentation/authentication-methods/"/>
</para>
<para>
The simplest option is to have no authentication at all. This is
the default if no other options are given. Unauthenticated
encrypted support is provided by using the certificate based
SSL/TLS based options certfile and keyfile.
</para>
<para>
MQTT provides username/password authentication as part of the
protocol. Use the password_file option to define the valid
usernames and passwords. Be sure to use network encryption if you
are using this option otherwise the username and password will be
vulnerable to interception. Use the
<option>per_listener_settings</option> to control whether passwords
are required globally or on a per-listener basis.
</para>
<para>
Mosquitto provides the Dynamic Security plugin which handles
username/password authentication and access control in a much
more flexible way than a password file. See
<ulink url="https://mosquitto.org/documentation/dynamic-security/"/>
</para>
<para>
When using certificate based encryption there are three options
that affect authentication. The first is require_certificate, which
may be set to true or false. If false, the SSL/TLS component of the
client will verify the server but there is no requirement for the
client to provide anything for the server: authentication is
limited to the MQTT built in username/password. If
require_certificate is true, the client must provide a valid
certificate in order to connect successfully. In this case, the
second and third options, use_identity_as_username and
use_subject_as_username, become relevant. If set to true,
use_identity_as_username causes the Common Name (CN) from the
client certificate to be used instead of the MQTT username for
access control purposes. The password is not used because it is
assumed that only authenticated clients have valid certificates.
This means that any CA certificates you include in cafile or capath
will be able to issue client certificates that are valid for
connecting to your broker. If use_identity_as_username is false,
the client must authenticate as normal (if required by
password_file) through the MQTT options. The same principle applies
for the use_subject_as_username option, but the entire certificate
subject is used as the username instead of just the CN.
</para>
<para>
When using pre-shared-key based encryption through the psk_hint
and psk_file options, the client must provide a valid identity and
key in order to connect to the broker before any MQTT communication
takes place. If use_identity_as_username is true, the PSK identity
is used instead of the MQTT username for access control purposes.
If use_identity_as_username is false, the client may still
authenticate using the MQTT username/password if using the
password_file option.
</para>
<para>
Both certificate and PSK based encryption are configured on a
per-listener basis.
</para>
<para>
Authentication plugins can be created to augment the
password_file, acl_file and psk_file options with e.g. SQL based
lookups.
</para>
<para>
It is possible to support multiple authentication schemes at
once. A config could be created that had a listener for all of the
different encryption options described above and hence a large
number of ways of authenticating.
</para>
</refsect1>
<refsect1>
<title>General Options</title>
<variablelist>
<varlistentry>
<term><option>acl_file</option> <replaceable>file path</replaceable></term>
<listitem>
<para>
<emphasis>Note:</emphasis> It is suggested that you use the
<option>mosquitto_acl_file</option> plugin instead of this
option. Using plugins for authentication and authorisation
allows greater control of what listeners they are applied to,
without the need for the deprecated
<option>per_listener_settings</option> option.
</para>
<para>
Set the path to an access control list file. If
defined, the contents of the file are used to control
client access to topics on the broker.
</para>
<para>
If this parameter is defined then only the topics
listed will have access. Topic access is added with
lines of the format:
</para>
<para>
<code>topic [read|write|readwrite|deny] <topic></code>
</para>
<para>
The access type is controlled using "read", "write",
"readwrite" or "deny". This parameter is optional (unless
<topic> includes a space character) - if not
given then the access is read/write. <topic> can
contain the + or # wildcards as in
subscriptions. The "deny" option can used to explicitly
deny access to a topic that would otherwise be granted
by a broader read/write/readwrite statement. Any "deny"
topics are handled before topics that grant read/write access.
</para>
<para>
The first set of topics are applied to anonymous
clients, assuming <option>allow_anonymous</option> is
true. User specific topic ACLs are added after a user
line as follows:
</para>
<para>
<code>user <username></code>
</para>
<para>
The username referred to here is the same as in
<option>password_file</option>. It is not the
clientid.
</para>
<para>
It is also possible to define ACLs based on pattern
substitution within the topic. The form is the same as
for the topic keyword, but using pattern as the
keyword.
</para>
<para>
<code>pattern [read|write|readwrite|deny] <topic></code>
</para>
<para>
The patterns available for substitution are:
</para>
<itemizedlist mark="circle">
<listitem><para>%c to match the client id of the client</para></listitem>
<listitem><para>%u to match the username of the client</para></listitem>
</itemizedlist>
<para>
The substitution pattern must be the only text for
that level of hierarchy. Pattern ACLs apply to all
users even if the "user" keyword has previously been
given.
</para>
<para>Example:</para>
<para><code>pattern write sensor/%u/data</code></para>
<para>Allow access for bridge connection messages:</para>
<para><code>pattern write $SYS/broker/connection/%c/state</code></para>
<para>
If the first character of a line of the ACL file is a
# it is treated as a comment.
</para>
<para>
If <option>per_listener_settings</option> is
<replaceable>true</replaceable>, this option applies to
the current listener being configured only. If
<option>per_listener_settings</option> is
<replaceable>false</replaceable>, this option applies
to all listeners.
</para>
<para>
Note: In general it is not possible to grant write
access to topics in the $SYS topic tree. The exception
is <replaceable>$SYS/broker/connection/+/state</replaceable>.
</para>
<para>
Reloaded on reload signal. The currently loaded ACLs
will be freed and reloaded. Existing subscriptions will
be affected after the reload.
</para>
<para>
See also
<ulink url="https://mosquitto.org/documentation/dynamic-security/"/>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>allow_anonymous</option> [ true | false ]</term>
<listitem>
<para>Global boolean value that determines whether clients that
connect without providing a username are allowed to
connect. If set to <replaceable>false</replaceable>
then another means of connection should be created to
control authenticated client access.</para>
<para>Defaults to <replaceable>false</replaceable>,
unless no listeners are defined in the configuration
file, in which case it set to <replaceable>true</replaceable>,
but connections are only allowed from the local machine.</para>
<para>
If you want to control this setting for each listener individually,
use the <option>listener_allow_anonymous</option> option.
</para>
<para>(Note: Deprecated) If <option>per_listener_settings</option> is
<replaceable>true</replaceable>, this option applies to
the current listener being configured only. If
<option>per_listener_settings</option> is
<replaceable>false</replaceable>, this option applies
to all listeners.</para>
<important><para>In version 1.6.x and earlier, this option defaulted
to <replaceable>true</replaceable> unless there was another security
option set.</para></important>
<para>Reloaded on reload signal.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>allow_duplicate_messages</option> [ true | false ]</term>
<listitem>
<para>This option is deprecated and will be removed in a
future version. The behaviour will default to true.
</para>
<para>If a client is subscribed to multiple subscriptions
that overlap, e.g. foo/# and foo/+/baz , then MQTT
expects that when the broker receives a message on a
topic that matches both subscriptions, such as
foo/bar/baz, then the client should only receive the
message once.</para>
<para>Mosquitto keeps track of which clients a message has
been sent to in order to meet this requirement. This
option allows this behaviour to be disabled, which may
be useful if you have a large number of clients
subscribed to the same set of topics and want to
minimise memory usage.</para>
<para>It can be safely set to
<replaceable>true</replaceable> if you know in advance
that your clients will never have overlapping
subscriptions, otherwise your clients must be able to
correctly deal with duplicate messages even when then
have QoS=2.</para>
<para>Defaults to <replaceable>true</replaceable>.</para>
<para>This option applies globally.</para>
<para>Reloaded on reload signal.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>allow_zero_length_clientid</option> [ true | false ]</term>
<listitem>
<para>MQTT 3.1.1 and MQTT 5 allow clients to connect with a zero
length client id and have the broker generate a client
id for them. Use this option to allow/disallow this
behaviour. Defaults to true.</para>
<para>See also the <option>auto_id_prefix</option> option.</para>
<para>If <option>per_listener_settings</option> is
<replaceable>true</replaceable>, this option applies to
the current listener being configured only. If
<option>per_listener_settings</option> is
<replaceable>false</replaceable>, this option applies
to all listeners.</para>
<para>Reloaded on reload signal.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>auth_plugin_deny_special_chars</option> [ true | false ]</term>
<listitem>
<para>If <replaceable>true</replaceable> then before an ACL
check is made, the username/client id of the client
needing the check is searched for the presence of
either a '+' or '#' character. If either of these
characters is found in either the username or client
id, then the ACL check is denied before it is sent to
the plugin.</para>
<para>This check prevents the case where a malicious user
could circumvent an ACL check by using one of these
characters as their username or client id. This is the
same issue as was reported with mosquitto itself as
CVE-2017-7650.</para>
<para>If you are entirely sure that the plugin you are
using is not vulnerable to this attack (i.e. if you
never use usernames or client ids in topics) then you
can disable this extra check and hence have all ACL
checks delivered to your plugin by setting this option
to <replaceable>false</replaceable>.</para>
<para>Defaults to <replaceable>true</replaceable>.</para>
<para>Applies to the current authentication plugin being configured.</para>
<para>Not currently reloaded on reload signal.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>auto_id_prefix</option> <replaceable>prefix</replaceable></term>
<listitem>
<para>
This option is deprecated, please use <option>listener_auto_id_prefix</option> instead.
</para>
<para>If <option>allow_zero_length_clientid</option> is
<replaceable>true</replaceable>, this option allows you
to set a string that will be prefixed to the
automatically generated client ids to aid visibility in
logs. Defaults to <option>auto-</option>.</para>
<para>If <option>per_listener_settings</option> is
<replaceable>true</replaceable>, this option applies to
the current listener being configured only. If
<option>per_listener_settings</option> is
<replaceable>false</replaceable>, this option applies
to all listeners.</para>
<para>Reloaded on reload signal.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>autosave_interval</option> <replaceable>seconds</replaceable></term>
<listitem>
<para>The number of seconds that mosquitto will wait
between each time it saves the in-memory database to
disk. If set to 0, the in-memory database will only be
saved when mosquitto exits or when receiving the
SIGUSR1 signal. Note that this setting only has an
effect if persistence is enabled. Defaults to 1800
seconds (30 minutes).</para>
<para>This option applies globally.</para>
<para>Reloaded on reload signal.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>autosave_on_changes</option> [ true | false ]</term>
<listitem>
<para>If <replaceable>true</replaceable>, mosquitto will
count the number of subscription changes, retained
messages received and queued messages and if the total
exceeds <option>autosave_interval</option> then the
in-memory database will be saved to disk. If
<replaceable>false</replaceable>, mosquitto will save
the in-memory database to disk by treating
<option>autosave_interval</option> as a time in
seconds.</para>
<para>This option applies globally.</para>
<para>Reloaded on reload signal.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>check_retain_source</option> [ true | false ]</term>
<listitem>
<para>This option affects the scenario when a client
subscribes to a topic that has retained messages. It is
possible that the client that published the retained
message to the topic had access at the time they
published, but that access has been subsequently
removed. If <option>check_retain_source</option> is set
to true, the default, the source of a retained message
will be checked for access rights before it is
republished. When set to false, no check will be made
and the retained message will always be
published.</para>
<para>This option applies globally, regardless of the
<option>per_listener_settings</option> option.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>clientid_prefixes</option> <replaceable>prefix</replaceable></term>
<listitem>
<para>This option is deprecated and will be removed in a
future version.</para>
<para>If defined, only clients that have a clientid with a
prefix that matches clientid_prefixes will be allowed
to connect to the broker. For example, setting
"secure-" here would mean a client "secure-client"
could connect but another with clientid "mqtt"
couldn't. By default, all client ids are valid.</para>
<para>This option applies globally.</para>
<para>Reloaded on reload signal. Note that currently
connected clients will be unaffected by any
changes.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>connection_messages</option> [ true | false ]</term>
<listitem>
<para>If set to <replaceable>true</replaceable>, the log
will include entries when clients connect and
disconnect. If set to <replaceable>false</replaceable>,
these entries will not appear.</para>
<para>This option applies globally.</para>
<para>Reloaded on reload signal.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>enable_control_api</option> [ true | false ]</term>
<listitem>
<para>If set to <replaceable>true</replaceable>, the
<option>$CONTROL/broker/v1</option> will be enabled. This currently
allows interrogating which plugins are enabled, but in the future
will allow access to configuring general broker options. If you enable
this you should ensure you have authentication and appropriate access
control configured, i.e. only allowing access to
<option>$CONTROL/broker/#</option> for a limited set of users.
</para>
<para>This option applies globally.</para>
<para>Reloaded on reload signal.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>global_max_clients</option> <replaceable>count</replaceable></term>
<listitem>
<para>
The maximum number of client sessions to allow across
the whole broker. In this context a client session means
either a client currently connected via the network, or
a client that has clean_session = False (MQTT v3.x) and
is disconnected, or has disconnected and still hasn't
exceeded its session expiry interval (MQTT v5).
</para>
<para>
See also the <option>max_connections</option> setting, which applies to
listeners. If you set <option>global_max_clients</option>
to 1000 and <option>max_connections</option> on a
listener to 10, then that means only 10 simultaneous
connections will be allowed at once, with an overall
maximum of 1000 client sessions.
</para>
<para>This option applies globally.</para>
<para>Defaults to -1 (unlimited)</para>
<para>Reloaded on reload signal.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>global_max_connections</option> <replaceable>count</replaceable></term>
<listitem>
<para>
The maximum number of currently connected clients to
allow across the whole broker.
</para>
<para>
See also the <option>global_max_clients</option> and
<option>max_connections</option> settings.
</para>
<para>This option applies globally.</para>
<para>Defaults to -1 (unlimited)</para>
<para>Reloaded on reload signal.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>global_plugin</option> <replaceable>file path</replaceable></term>
<listitem>
<para>
Load an external module to extend broker features. This loads plugins
for use across all listeners, regardless of the value of the
<option>per_listener_settings</option> option. This option functions
the same as the <option>plugin</option> option in all other ways.
</para>
<para>
If you set <option>per_listener_settings true</option>, then define both a
<option>global_plugin</option> and a <option>plugin</option> (which will be
attached to a specific listener), then the global plugin will always be
processed first.
</para>
<para>
If you set <option>per_listener_settings false</option>, then
<option>global_plugin</option> behaves identically to
<option>plugin</option>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>include_dir</option> <replaceable>dir</replaceable></term>
<listitem>
<para>External configuration files may be included by using
the include_dir option. This defines a directory that
will be searched for config files. All files that end
in '.conf' will be loaded as a configuration file. It
is best to have this as the last option in the main
file. This option will only be processed from the main
configuration file. The directory specified must not
contain the main configuration file.</para>
<para>The configuration files in
<option>include_dir</option> are loaded in case
sensitive alphabetical order, with the upper case of
each letter ordered before the lower case of the same
letter.</para>
<example title="Load Order for include_dir" label="Load Order for include_dir">
<para>Given the files
<replaceable>b.conf</replaceable>,
<replaceable>A.conf</replaceable>,
<replaceable>01.conf</replaceable>,
<replaceable>a.conf</replaceable>,
<replaceable>B.conf</replaceable>, and
<replaceable>00.conf</replaceable> inside
<option>include_dir</option>, the config files
would be loaded in this order:</para>
<programlisting language="config">
00.conf
01.conf
A.conf
a.conf
B.conf
b.conf
</programlisting></example>
<para>If this option is used multiple times, then each
<option>include_dir</option> option is processed
completely in the order that they are written in the
main configuration file.</para>
<example title="Load Order for Multiple include_dir" label="Load Order for Multiple include_dir">
<para>Assuming a directory
<replaceable>one.d</replaceable> containing
files <replaceable>B.conf</replaceable> and
<replaceable>C.conf</replaceable>, and a second
directory <replaceable>two.d</replaceable>
containing files
<replaceable>A.conf</replaceable> and
<replaceable>D.conf</replaceable>, and a
config:</para>
<programlisting language="config">
include_dir one.d
include_dir two.d
</programlisting><para>Then the config files would be loaded in this order:</para>
<programlisting language="config">
# files from one.d
B.conf
C.conf
# files from two.d
A.conf
D.conf
</programlisting></example>
</listitem>
</varlistentry>
<varlistentry>
<term><option>log_dest</option> <replaceable>destinations</replaceable></term>
<listitem>
<para>Send log messages to a particular destination.
Possible destinations are: <option>stdout</option>
<option>stderr</option> <option>syslog</option>
<option>topic</option> <option>file</option>
<option>dlt</option> <option>android</option>.</para>
<para><option>stdout</option> and
<option>stderr</option> log to the console on the
named output.</para>
<para><option>syslog</option> uses the userspace syslog
facility which usually ends up in /var/log/messages or
similar.</para>
<para><option>topic</option> logs to the broker topic
'$SYS/broker/log/<severity>', where severity is
one of E, W, N, I, M which are error,
warning, notice, information and message. Message type
severity is used by the subscribe and unsubscribe
log_type options and publishes log messages at
$SYS/broker/log/M/subscribe and
$SYS/broker/log/M/unsubscribe. Debug messages are never
logged on topics.</para>
<para>The <option>file</option> destination requires an
additional parameter which is the file to be logged to,
e.g. "log_dest file /var/log/mosquitto.log". The file
will be closed and reopened when the broker receives a
HUP signal. Only a single file destination may be
configured.</para>
<para>The <option>dlt</option> destination is for the
automotive `Diagnostic Log and Trace` tool. This
requires that Mosquitto has been compiled with DLT
support.</para>
<para>The <option>android</option> destination is for
Android only, and will output to the logd daemon.</para>
<para>Use "log_dest none" if you wish to disable logging.
Defaults to stderr. This option may be specified
multiple times.</para>
<para>Note that if the broker is running as a Windows
service it will default to "log_dest none" and neither
stdout nor stderr logging is available.</para>
<para>Reloaded on reload signal.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>log_facility</option> <replaceable>local facility</replaceable></term>
<listitem>
<para>If using syslog logging (not on Windows), messages
will be logged to the "daemon" facility by default. Use
the <option>log_facility</option> option to choose
which of local0 to local7 to log to instead. The option
value should be an integer value, e.g. "log_facility 5"
to use local5.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>log_timestamp</option> [ true | false ]</term>
<listitem>
<para>Boolean value, if set to
<replaceable>true</replaceable> a timestamp value will
be added to each log entry. The default is
<replaceable>true</replaceable>.</para>
<para>Reloaded on reload signal.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>log_timestamp_format</option> <replaceable>format</replaceable></term>
<listitem>
<para>Set the format of the log timestamp. If left unset,
this is the number of seconds since the Unix epoch.
This option is a free text string which will be passed
to the strftime function as the format specifier. To
get an ISO 8601 datetime, for example:</para>
<programlisting language="config">
log_timestamp_format %Y-%m-%dT%H:%M:%S
</programlisting>
<para>Reloaded on reload signal.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>log_type</option> <replaceable>types</replaceable></term>
<listitem>
<para>Choose types of messages to log. Possible types are:
<replaceable>debug</replaceable>,
<replaceable>error</replaceable>,
<replaceable>warning</replaceable>,
<replaceable>notice</replaceable>,
<replaceable>information</replaceable>,
<replaceable>subscribe</replaceable>,
<replaceable>unsubscribe</replaceable>,
<replaceable>websockets</replaceable>,
<replaceable>none</replaceable>,
<replaceable>all</replaceable>.</para>
<para>Defaults to <replaceable>error</replaceable>,
<replaceable>warning</replaceable>, <replaceable>notice
</replaceable>and
<replaceable>information</replaceable>. This option
may be specified multiple times. Note that the
<replaceable>debug </replaceable>type (used for
decoding incoming/outgoing network packets) is never
logged in topics.</para>
<para>Reloaded on reload signal.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>max_inflight_bytes</option> <replaceable>count</replaceable></term>
<listitem>
<para>Outgoing QoS 1 and 2 messages will be allowed in flight until this byte
limit is reached. This allows control of outgoing message rate based on
message size rather than message count. If the limit is set to 100,
messages of over 100 bytes are still allowed, but only a single message
can be in flight at once. Defaults to 0. (No limit).</para>
<para>See also the <option>max_inflight_messages</option> option.</para>
<para>This option applies globally.</para>
<para>Reloaded on reload signal.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>max_inflight_messages</option> <replaceable>count</replaceable></term>
<listitem>
<para>The maximum number of outgoing QoS 1 or 2 messages that can be
in the process of being transmitted simultaneously.
This includes messages currently going through
handshakes and messages that are being retried.
Defaults to 20. Set to 0 for no maximum. If set to 1,
this will guarantee in-order delivery of
messages.</para>
<para>This option applies globally.</para>
<para>Reloaded on reload signal.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>max_keepalive</option> <replaceable>value</replaceable></term>
<listitem>
<para>For MQTT v5 clients, it is possible to have the
server send a "server keepalive" value that will
override the keepalive value set by the client. This
is intended to be used as a mechanism to say that the
server will disconnect the client earlier than it
anticipated, and that the client should use the new
keepalive value. The max_keepalive option allows you to
specify that clients may only connect with keepalive
less than or equal to this value, otherwise they will
be sent a server keepalive telling them to use
max_keepalive. This only applies to MQTT v5 clients.
The maximum value is 65535. Set to 0 to allow infinite
keepalive. Defaults to 0.
</para>
<para>
Set to 0 to allow clients to set keepalive = 0, which
means no keepalive checks are made and the client will
never be disconnected by the broker if no messages are
received. You should be very sure this is the behaviour
that you want.
</para>
<para>
For MQTT v3.1.1 and v3.1 clients, there is no mechanism
to tell the client what keepalive value they should use.
If an MQTT v3.1.1 or v3.1 client specifies a keepalive
time greater than max_keepalive they will be sent a
CONNACK message with the "identifier rejected" reason
code, and disconnected.
</para>
<para>This option applies globally.</para>
<para>Reloaded on reload signal.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>max_packet_size</option> <replaceable>value</replaceable></term>
<listitem>
<para>For MQTT v5 clients, it is possible to have the
server send a "maximum packet size" value that will
instruct the client it will not accept MQTT packets
with size greater than <option>value</option> bytes.
This applies to the full MQTT packet, not just the
payload. Setting this option to a positive value will
set the maximum packet size to that number of bytes. If
a client sends a packet which is larger than this
value, it will be disconnected. This applies to all
clients regardless of the protocol version they are
using, but v3.1.1 and earlier clients will of course
not have received the maximum packet size information.
</para>
<para>
Defaults to 2000000 bytes since 2.1. Earlier versions
defaulted to no limit.
</para>
<para>This option applies to all clients, not just those
using MQTT v5, but it is not possible to notify clients
using MQTT v3.1.1 or MQTT v3.1 of the limit.</para>
<para>Setting below 20 bytes is forbidden because it is
likely to interfere with normal client operation even
with small payloads.</para>
<para>This option applies globally.</para>
<para>Reloaded on reload signal.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>max_queued_bytes</option> <replaceable>count</replaceable></term>
<listitem>
<para>The number of outgoing QoS 1 and 2 messages above those currently in-flight will be
queued (per client) by the broker. Once this limit has been reached, subsequent
messages will be silently dropped. This is an important option if you are sending
messages at a high rate and/or have clients who are slow to respond or may be offline
for extended periods of time. Defaults to 0. (No maximum).</para>
<para>See also the
<option>max_queued_messages</option> option.
If both max_queued_messages and max_queued_bytes are specified,
packets will be queued until the first limit is reached.
</para>
<para>This option applies globally.</para>
<para>Reloaded on reload signal.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>max_queued_messages</option> <replaceable>count</replaceable></term>
<listitem>
<para>The maximum number of QoS 1 or 2 messages to hold in the
queue (per client) above those messages that are currently
in flight. Defaults to 1000. Set to 0 for no maximum (not
recommended). See also the
<option>queue_qos0_messages</option> and
<option>max_queued_bytes</option> options.</para>
<para>This option applies globally.</para>
<para>Reloaded on reload signal.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>memory_limit</option> <replaceable>limit</replaceable></term>
<listitem>
<para>
This option sets the maximum number of heap memory bytes that the broker
will allocate, and hence sets a hard limit on memory use by the broker.
Memory requests that exceed this value will be denied. The effect will
vary depending on what has been denied. If an incoming message is being
processed, then the message will be dropped and the publishing client
will be disconnected. If an outgoing message is being sent, then the
individual message will be dropped and the receiving client will be
disconnected. Defaults to no limit.</para>
<para>This option is only available if memory tracking support is compiled
in.</para>
<para>Reloaded on reload signal. Setting to a lower value and reloading will
not result in memory being freed.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>message_size_limit</option> <replaceable>limit</replaceable></term>
<listitem>
<para>This option sets the maximum publish payload size
that the broker will allow. Received messages that
exceed this size will not be accepted by the broker. This means that the
message will not be forwarded on to subscribing clients, but the QoS flow
will be completed for QoS 1 or QoS 2 messages. MQTT v5 clients using QoS 1
or QoS 2 will receive a PUBACK or PUBREC with the "implementation specific
error" reason code.</para>
<para>The default value is 0, which means that all valid MQTT
messages are accepted. MQTT imposes a maximum payload
size of 268435455 bytes.</para>
<para>This option applies globally.</para>
<para>Reloaded on reload signal.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>password_file</option> <replaceable>file path</replaceable></term>
<listitem>
<para>
<emphasis>Note:</emphasis> It is suggested that you use the
<option>mosquitto_password_file</option> plugin instead of this
option. Using plugins for authentication and authorisation
allows greater control of what listeners they are applied to,
without the need for the deprecated
<option>per_listener_settings</option> option.
</para>
<para>Set the path to a password file. If defined, the
contents of the file are used to control client access
to the broker. The file can be created using the
<citerefentry><refentrytitle><link xlink:href="mosquitto_passwd-1.html">mosquitto_passwd</link></refentrytitle><manvolnum>1</manvolnum></citerefentry>
utility. If mosquitto is compiled without TLS support
(it is recommended that TLS support is included), then
the password file should be a text file with each line
in the format "username:password", where the colon and
password are optional but recommended. If
<option>allow_anonymous</option> is set to
<replaceable>false</replaceable>, only users defined in
this file will be able to connect. Setting
<option>allow_anonymous</option> to
<replaceable>true</replaceable> when
<replaceable>password_file</replaceable>is defined is
valid and could be used with acl_file to have e.g. read
only guest/anonymous accounts and defined users that
can publish.</para>
<para>If <option>per_listener_settings</option> is
<replaceable>true</replaceable>, this option applies to
the current listener being configured only. If
<option>per_listener_settings</option> is
<replaceable>false</replaceable>, this option applies
to all listeners.</para>
<para>Reloaded on reload signal. The currently loaded
username and password data will be freed and reloaded.
Clients that are already connected will not be
affected.</para>
<para>See also
<citerefentry><refentrytitle><link xlink:href="mosquitto_passwd-1.html">mosquitto_passwd</link></refentrytitle><manvolnum>1</manvolnum></citerefentry> and
<ulink url="https://mosquitto.org/documentation/dynamic-security/"/>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>per_listener_settings</option> [ true | false ]</term>
<listitem>
<para>If <replaceable>true</replaceable>, then
authentication and access control settings will be
controlled on a per-listener basis. The following
options are affected:</para>
<para><option>password_file</option>,
<option>acl_file</option>, <option>psk_file</option>,
<option>allow_anonymous</option>,
<option>allow_zero_length_clientid</option>,
<option>auto_id_prefix</option>.</para>
<option>plugin</option>,
<option>plugin_opt_*</option>,
<para>Note that if set to true, then a durable client (i.e.
with clean session set to false) that has disconnected
will use the ACL settings defined for the listener that
it was most recently connected to.</para>
<para>The default behaviour is for this to be set to
<replaceable>false</replaceable>, which maintains the
settings behaviour from previous versions of
mosquitto.</para>
<para>Reloaded on reload signal.</para>
</listitem>
</varlistentry>
<varlistentry>