2 %%% ejabberd configuration file
6 %%% The parameters used in this configuration file are explained in more detail
7 %%% in the ejabberd Installation and Operation Guide.
8 %%% Please consult the Guide in case of doubts, it is included with
9 %%% your copy of ejabberd, and is also available online at
10 %%% http://www.process-one.net/en/ejabberd/docs/
12 %%% This configuration file contains Erlang terms.
13 %%% In case you want to understand the syntax, here are the concepts:
15 %%% - The character to comment a line is %
17 %%% - Each term ends in a dot, for example:
20 %%% - A tuple has a fixed definition, its elements are
21 %%% enclosed in {}, and separated with commas:
24 %%% - A list can have as many elements as you want,
25 %%% and is enclosed in [], for example:
26 %%% [http_poll, web_admin, tls]
28 %%% - A keyword of ejabberd is a word in lowercase.
29 %%% Strings are enclosed in "" and can contain spaces, dots, ...
31 %%% {ldap_rootdn, "dc=example,dc=com"}.
33 %%% - This term includes a tuple, a keyword, a list, and two strings:
34 %%% {hosts, ["jabber.example.net", "im.example.com"]}.
38 %%%. =======================
39 %%%' OVERRIDE STORED OPTIONS
42 %% Override the old values stored in the database.
46 %% Override global options (shared by all ejabberd nodes in a cluster).
51 %% Override local options (specific for this particular ejabberd node).
56 %% Remove the Access Control Lists before new ones are added.
65 %% loglevel: Verbosity of log files generated by ejabberd.
66 %% 0: No ejabberd log at all (not recommended)
76 %% watchdog_admins: Only useful for developers: if an ejabberd process
77 %% consumes a lot of memory, send live notifications to these XMPP
80 %%{watchdog_admins, ["bob@example.com"]}.
87 %% hosts: Domains served by ejabberd.
88 %% You can define one or several, for example:
89 %% {hosts, ["example.net", "example.com", "example.org"]}.
91 {hosts, ["localhost"]}.
94 %% route_subdomains: Delegate subdomains to other XMPP servers.
95 %% For example, if this ejabberd serves example.org and you want
96 %% to allow communication with an XMPP server called im.example.org.
98 %%{route_subdomains, s2s}.
105 %% listen: The ports ejabberd will listen on, which service each is handled
106 %% by and what options to start it with.
111 {5222, ejabberd_c2s, [
114 %% If TLS is compiled in and you installed a SSL
115 %% certificate, specify the full path to the
116 %% file and uncomment this line:
118 %%{certfile, "/path/to/ssl.pem"}, starttls,
121 {shaper, c2s_shaper},
122 {max_stanza_size, 65536},
125 {certfile, "/etc/ejabberd/ejabberd.pem"}
129 %% To enable the old SSL connection method on port 5223:
131 %%{5223, ejabberd_c2s, [
133 %% {shaper, c2s_shaper},
134 %% {certfile, "/path/to/ssl.pem"}, tls,
135 %% {max_stanza_size, 65536}
138 {5269, ejabberd_s2s_in, [
139 {shaper, s2s_shaper},
140 {max_stanza_size, 131072}
144 %% ejabberd_service: Interact with external components (transports, ...)
146 %%{8888, ejabberd_service, [
148 %% {shaper_rule, fast},
149 %% {ip, {127, 0, 0, 1}},
150 %% {hosts, ["icq.example.org", "sms.example.org"],
151 %% [{password, "secret"}]
156 %% ejabberd_stun: Handles STUN Binding requests
158 %%{{3478, udp}, ejabberd_stun, []},
160 {5280, ejabberd_http, [
163 %% {["pub", "archive"], mod_http_fileserver}
175 %% s2s_use_starttls: Enable STARTTLS + Dialback for S2S connections.
176 %% Allowed values are: false optional required required_trusted
177 %% You must specify a certificate file.
179 {s2s_use_starttls, required_trusted}.
182 %% s2s_certfile: Specify a certificate file.
184 {s2s_certfile, "/etc/ejabberd/ejabberd.pem"}.
187 %% domain_certfile: Specify a different certificate for each served hostname.
189 %%{domain_certfile, "example.org", "/path/to/example_org.pem"}.
190 %%{domain_certfile, "example.com", "/path/to/example_com.pem"}.
193 %% S2S whitelist or blacklist
195 %% Default s2s policy for undefined hosts.
197 %%{s2s_default_policy, allow}.
200 %% Allow or deny communication with specific servers.
202 %%{{s2s_host, "goodhost.org"}, allow}.
203 %%{{s2s_host, "badhost.org"}, deny}.
206 %% Outgoing S2S options
208 %% Preferred address families (which to try first) and connect timeout
211 %%{outgoing_s2s_options, [ipv4, ipv6], 10000}.
218 %% auth_method: Method used to authenticate the users.
219 %% The default method is the internal.
220 %% If you want to use a different method,
221 %% comment this line and enable the correct ones.
223 {auth_method, internal}.
225 %% Store the plain passwords or hashed for SCRAM:
226 %%{auth_password_format, plain}.
227 %%{auth_password_format, scram}.
229 %% Define the FQDN if ejabberd doesn't detect it:
230 %%{fqdn, "server3.example.com"}.
233 %% Authentication using external script
234 %% Make sure the script is executable by ejabberd.
236 %%{auth_method, external}.
237 %%{extauth_program, "/path/to/authentication/script"}.
240 %% Authentication using ODBC
241 %% Remember to setup a database in the next section.
243 %%{auth_method, odbc}.
246 %% Authentication using PAM
248 %%{auth_method, pam}.
249 %%{pam_service, "pamservicename"}.
252 %% Authentication using LDAP
254 %%{auth_method, ldap}.
256 %% List of LDAP servers:
257 %%{ldap_servers, ["localhost"]}.
259 %% Encryption of connection to LDAP servers:
260 %%{ldap_encrypt, none}.
261 %%{ldap_encrypt, tls}.
263 %% Port to connect to on LDAP servers:
268 %%{ldap_rootdn, "dc=example,dc=com"}.
270 %% Password of LDAP manager:
271 %%{ldap_password, "******"}.
273 %% Search base of LDAP directory:
274 %%{ldap_base, "dc=example,dc=com"}.
276 %% LDAP attribute that holds user ID:
277 %%{ldap_uids, [{"mail", "%u@mail.example.org"}]}.
280 %%{ldap_filter, "(objectClass=shadowAccount)"}.
283 %% Anonymous login support:
284 %% auth_method: anonymous
285 %% anonymous_protocol: sasl_anon | login_anon | both
286 %% allow_multiple_connections: true | false
288 %%{host_config, "public.example.org", [{auth_method, anonymous},
289 %% {allow_multiple_connections, false},
290 %% {anonymous_protocol, sasl_anon}]}.
292 %% To use both anonymous and internal authentication:
294 %%{host_config, "public.example.org", [{auth_method, [internal, anonymous]}]}.
300 %% ejabberd by default uses the internal Mnesia database,
301 %% so you do not necessarily need this section.
302 %% This section provides configuration examples in case
303 %% you want to use other database backends.
304 %% Please consult the ejabberd Guide for details on database creation.
309 %%{odbc_server, {mysql, "server", "database", "username", "password"}}.
311 %% If you want to specify the port:
312 %%{odbc_server, {mysql, "server", 1234, "database", "username", "password"}}.
315 %% PostgreSQL server:
317 %%{odbc_server, {pgsql, "server", "database", "username", "password"}}.
319 %% If you want to specify the port:
320 %%{odbc_server, {pgsql, "server", 1234, "database", "username", "password"}}.
322 %% If you use PostgreSQL, have a large database, and need a
323 %% faster but inexact replacement for "select count(*) from users"
325 %%{pgsql_users_number_estimate, true}.
328 %% ODBC compatible or MSSQL server:
330 %%{odbc_server, "DSN=ejabberd;UID=ejabberd;PWD=ejabberd"}.
333 %% Number of connections to open to the database for each virtual host
335 %%{odbc_pool_size, 10}.
338 %% Interval to make a dummy SQL request to keep the connections to the
339 %% database alive. Specify in seconds: for example 28800 means 8 hours
341 %%{odbc_keepalive_interval, undefined}.
348 %% The "normal" shaper limits traffic speed to 1000 B/s
350 {shaper, normal, {maxrate, 1000}}.
353 %% The "fast" shaper limits traffic speed to 50000 B/s
355 {shaper, fast, {maxrate, 50000}}.
358 %% This option specifies the maximum number of elements in the queue
359 %% of the FSM. Refer to the documentation for details.
361 {max_fsm_queue, 1000}.
364 %%%. ====================
365 %%%' ACCESS CONTROL LISTS
368 %% The 'admin' ACL grants administrative privileges to XMPP accounts.
369 %% You can put here as many accounts as you want.
371 %%{acl, admin, {user, "aleksey", "localhost"}}.
372 %%{acl, admin, {user, "ermine", "example.org"}}.
377 %%{acl, blocked, {user, "baduser", "example.org"}}.
378 %%{acl, blocked, {user, "test"}}.
381 %% Local users: don't modify this line.
383 {acl, local, {user_regexp, ""}}.
386 %% More examples of ACLs
388 %%{acl, jabberorg, {server, "jabber.org"}}.
389 %%{acl, aleksey, {user, "aleksey", "jabber.ru"}}.
390 %%{acl, test, {user_regexp, "^test"}}.
391 %%{acl, test, {user_glob, "test*"}}.
394 %% Define specific ACLs in a virtual host.
396 %%{host_config, "localhost",
398 %% {acl, admin, {user, "bob-local", "localhost"}}
406 %% Maximum number of simultaneous sessions allowed for a single user:
407 {access, max_user_sessions, [{10, all}]}.
409 %% Maximum number of offline messages that users can have:
410 {access, max_user_offline_messages, [{5000, admin}, {100, all}]}.
412 %% This rule allows access only for local users:
413 {access, local, [{allow, local}]}.
415 %% Only non-blocked users can use c2s connections:
416 {access, c2s, [{deny, blocked},
419 %% For C2S connections, all users except admins use the "normal" shaper
420 {access, c2s_shaper, [{none, admin},
423 %% All S2S connections use the "fast" shaper
424 {access, s2s_shaper, [{fast, all}]}.
426 %% Only admins can send announcement messages:
427 {access, announce, [{allow, admin}]}.
429 %% Only admins can use the configuration interface:
430 {access, configure, [{allow, admin}]}.
432 %% Admins of this server are also admins of the MUC service:
433 {access, muc_admin, [{allow, admin}]}.
435 %% Only accounts of the local ejabberd server can create rooms:
436 {access, muc_create, [{allow, local}]}.
438 %% All users are allowed to use the MUC service:
439 {access, muc, [{allow, all}]}.
441 %% Only accounts on the local ejabberd server can create Pubsub nodes:
442 {access, pubsub_createnode, [{allow, local}]}.
444 %% In-band registration allows registration of any possible username.
445 %% To disable in-band registration, replace 'allow' with 'deny'.
446 {access, register, [{allow, all}]}.
448 %% By default the frequency of account registrations from the same IP
449 %% is limited to 1 account every 10 minutes. To disable, specify: infinity
450 %%{registration_timeout, 600}.
453 %% Define specific Access Rules in a virtual host.
455 %%{host_config, "localhost",
457 %% {access, c2s, [{allow, admin}, {deny, all}]},
458 %% {access, register, [{deny, all}]}
463 %%%. ================
464 %%%' DEFAULT LANGUAGE
467 %% language: Default language used for server messages.
472 %% Set a different default language in a virtual host.
474 %%{host_config, "localhost",
475 %% [{language, "ru"}]
483 %% Full path to a script that generates the image.
485 %%{captcha_cmd, "/lib/ejabberd/priv/bin/captcha.sh"}.
488 %% Host for the URL and port where ejabberd listens for CAPTCHA requests.
490 %%{captcha_host, "example.org:5280"}.
493 %% Limit CAPTCHA calls per minute for JID/IP to avoid DoS.
495 %%{captcha_limit, 5}.
501 %% Modules enabled in all ejabberd virtual hosts.
506 {mod_announce, [{access, announce}]}, % recommends mod_adhoc
507 {mod_blocking,[]}, % requires mod_privacy
509 {mod_configure,[]}, % requires mod_adhoc
511 %%{mod_echo, [{host, "echo.localhost"}]},
514 %%{mod_http_fileserver, [
515 %% {docroot, "/var/www"},
516 %% {accesslog, "/var/log/ejabberd/access.log"}
520 %%{host, "conference.@HOST@"},
522 {access_create, muc_create},
523 {access_persistent, muc_create},
524 {access_admin, muc_admin}
527 {mod_offline, [{access_max_user_messages, max_user_offline_messages}]},
529 %%{mod_pres_counter,[{count, 5}, {interval, 60}]},
534 {access_createnode, pubsub_createnode},
535 {ignore_pep_from_offline, true}, % reduces resource comsumption, but XEP incompliant
536 %%{ignore_pep_from_offline, false}, % XEP compliant, but increases resource comsumption
537 {last_item_cache, false},
538 {plugins, ["flat", "hometree", "pep"]} % pep requires mod_caps
542 %% Protect In-Band account registrations with CAPTCHA.
544 %%{captcha_protected, true},
547 %% Set the minimum informational entropy for passwords.
549 %%{password_strength, 32},
552 %% After successful registration, the user receives
553 %% a message with this subject and body.
555 {welcome_message, {"Welcome!",
556 "Hi.\nWelcome to this XMPP server."}},
559 %% When a user registers, send a notification to
560 %% these XMPP accounts.
562 %%{registration_watchers, ["admin1@example.org"]},
565 %% Only clients in the server machine can register accounts
567 {ip_access, [{allow, "127.0.0.0/8"},
568 {deny, "0.0.0.0/0"}]},
571 %% Local c2s or remote s2s users cannot register accounts
573 %%{access_from, deny},
577 %%{mod_register_web, [
579 %% When a user registers, send a notification to
580 %% these XMPP accounts.
582 %%{registration_watchers, ["admin1@example.org"]}
585 %%{mod_service_log,[]},
586 {mod_shared_roster,[]},
594 %% Enable modules with custom options in a specific virtual host
596 %%{host_config, "localhost",
599 %% {mod_echo, [{host, "mirror.localhost"}]}
613 %%% vim: set filetype=erlang tabstop=8 foldmarker=%%%',%%%. foldmethod=marker: