~ubuntu-branches/ubuntu/wily/dovecot/wily

« back to all changes in this revision

Viewing changes to src/config/all-settings.c

  • Committer: Package Import Robot
  • Author(s): Jaldhar H. Vyas
  • Date: 2013-09-09 00:57:32 UTC
  • mfrom: (1.13.11)
  • mto: (4.8.5 experimental) (1.16.1)
  • mto: This revision was merged to the branch mainline in revision 97.
  • Revision ID: package-import@ubuntu.com-20130909005732-dn1eell8srqbhh0e
Tags: upstream-2.2.5
ImportĀ upstreamĀ versionĀ 2.2.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
#include "file-lock.h"
6
6
#include "fsync-mode.h"
7
7
#include "hash-format.h"
8
 
#include "network.h"
 
8
#include "net.h"
9
9
#include "unichar.h"
10
10
#include "settings-parser.h"
11
11
#include "all-settings.h"
27
27
        const char *mail_attachment_dir;
28
28
        const char *mail_attachment_hash;
29
29
        uoff_t mail_attachment_min_size;
 
30
        const char *mail_attribute_dict;
30
31
        unsigned int mail_prefetch_count;
31
32
        const char *mail_cache_fields;
 
33
        const char *mail_always_cache_fields;
32
34
        const char *mail_never_cache_fields;
33
35
        unsigned int mail_cache_min_mail_count;
34
36
        unsigned int mailbox_idle_check_interval;
49
51
        const char *lock_method;
50
52
        const char *pop3_uidl_format;
51
53
 
 
54
        const char *ssl_client_ca_dir;
 
55
        const char *ssl_client_ca_file;
 
56
        const char *ssl_crypto_device;
 
57
 
52
58
        enum file_lock_method parsed_lock_method;
53
59
        enum fsync_mode parsed_fsync_mode;
54
60
};
67
73
        bool ignore_on_failure;
68
74
        bool disabled;
69
75
 
70
 
        ARRAY_DEFINE(mailboxes, struct mailbox_settings *);
 
76
        ARRAY(struct mailbox_settings *) mailboxes;
71
77
        struct mail_user_settings *user_set;
72
78
};
73
79
struct mailbox_settings {
74
80
        const char *name;
75
81
        const char *autocreate;
76
82
        const char *special_use;
 
83
        const char *driver;
77
84
};
78
85
struct mail_user_settings {
79
86
        const char *base_dir;
96
103
 
97
104
        const char *mail_log_prefix;
98
105
 
99
 
        ARRAY_DEFINE(namespaces, struct mail_namespace_settings *);
100
 
        ARRAY_DEFINE(plugin_envs, const char *);
 
106
        ARRAY(struct mail_namespace_settings *) namespaces;
 
107
        ARRAY(const char *) plugin_envs;
101
108
};
102
109
/* ../../src/lib-storage/index/pop3c/pop3c-settings.h */
103
110
struct pop3c_settings {
109
116
        const char *pop3c_password;
110
117
 
111
118
        const char *pop3c_ssl;
112
 
        const char *pop3c_ssl_ca_dir;
113
119
        bool pop3c_ssl_verify;
114
120
 
115
121
        const char *pop3c_rawlog_dir;
116
 
        const char *ssl_crypto_device;
117
122
};
118
123
/* ../../src/lib-storage/index/mbox/mbox-settings.h */
119
124
struct mbox_settings {
149
154
        const char *imapc_password;
150
155
 
151
156
        const char *imapc_ssl;
152
 
        const char *imapc_ssl_ca_dir;
153
157
        bool imapc_ssl_verify;
154
158
 
155
159
        const char *imapc_features;
157
161
        const char *imapc_list_prefix;
158
162
        unsigned int imapc_max_idle_time;
159
163
 
160
 
        const char *ssl_crypto_device;
161
 
 
162
164
        enum imapc_features parsed_features;
163
165
};
164
166
/* ../../src/lib-storage/index/dbox-multi/mdbox-settings.h */
247
249
        unsigned int process_limit_1:1;
248
250
};
249
251
ARRAY_DEFINE_TYPE(service_settings, struct service_settings *);
 
252
/* ../../src/lib-master/master-service-ssl-settings.h */
 
253
extern const struct setting_parser_info master_service_ssl_setting_parser_info;
 
254
struct master_service_ssl_settings {
 
255
        const char *ssl;
 
256
        const char *ssl_ca;
 
257
        const char *ssl_cert;
 
258
        const char *ssl_key;
 
259
        const char *ssl_key_password;
 
260
        const char *ssl_cipher_list;
 
261
        const char *ssl_protocols;
 
262
        const char *ssl_cert_username_field;
 
263
        const char *ssl_crypto_device;
 
264
        bool ssl_verify_client_cert;
 
265
        bool ssl_require_crl;
 
266
        bool verbose_ssl;
 
267
};
250
268
/* ../../src/lib-master/master-service-settings.h */
251
269
extern const struct setting_parser_info master_service_setting_parser_info;
252
270
struct master_service_settings {
 
271
        const char *base_dir;
 
272
        const char *state_dir;
253
273
        const char *log_path;
254
274
        const char *info_log_path;
255
275
        const char *debug_log_path;
282
302
        const char *connect;
283
303
 
284
304
        unsigned int max_field_count;
285
 
        ARRAY_DEFINE(maps, struct dict_sql_map);
 
305
        ARRAY(struct dict_sql_map) maps;
286
306
};
287
307
/* ../../src/lib-storage/mail-storage-settings.c */
288
308
extern const struct setting_parser_info mailbox_setting_parser_info;
297
317
        bool uidl_format_ok;
298
318
        char c;
299
319
 
 
320
        if (set->mailbox_idle_check_interval == 0) {
 
321
                *error_r = "mailbox_idle_check_interval must not be 0";
 
322
                return FALSE;
 
323
        }
 
324
 
300
325
        if (strcmp(set->mail_fsync, "optimized") == 0)
301
326
                set->parsed_fsync_mode = FSYNC_MODE_OPTIMIZED;
302
327
        else if (strcmp(set->mail_fsync, "never") == 0)
370
395
                return FALSE;
371
396
        }
372
397
        hash_format_deinit_free(&format);
 
398
#ifndef CONFIG_BINARY
 
399
        if (*set->ssl_client_ca_dir != '\0' &&
 
400
            access(set->ssl_client_ca_dir, X_OK) < 0) {
 
401
                *error_r = t_strdup_printf(
 
402
                        "ssl_client_ca_dir: access(%s) failed: %m",
 
403
                        set->ssl_client_ca_dir);
 
404
                return FALSE;
 
405
        }
 
406
#endif
373
407
        return TRUE;
374
408
}
375
409
 
516
550
        DEF(SET_STR_VARS, mail_attachment_dir),
517
551
        DEF(SET_STR, mail_attachment_hash),
518
552
        DEF(SET_SIZE, mail_attachment_min_size),
 
553
        DEF(SET_STR_VARS, mail_attribute_dict),
519
554
        DEF(SET_UINT, mail_prefetch_count),
520
555
        DEF(SET_STR, mail_cache_fields),
 
556
        DEF(SET_STR, mail_always_cache_fields),
521
557
        DEF(SET_STR, mail_never_cache_fields),
522
558
        DEF(SET_UINT, mail_cache_min_mail_count),
523
559
        DEF(SET_TIME, mailbox_idle_check_interval),
538
574
        DEF(SET_ENUM, lock_method),
539
575
        DEF(SET_STR, pop3_uidl_format),
540
576
 
 
577
        DEF(SET_STR, ssl_client_ca_dir),
 
578
        DEF(SET_STR, ssl_client_ca_file),
 
579
        DEF(SET_STR, ssl_crypto_device),
 
580
 
541
581
        SETTING_DEFINE_LIST_END
542
582
};
543
583
const struct mail_storage_settings mail_storage_default_settings = {
546
586
        .mail_attachment_dir = "",
547
587
        .mail_attachment_hash = "%{sha1}",
548
588
        .mail_attachment_min_size = 1024*128,
 
589
        .mail_attribute_dict = "",
549
590
        .mail_prefetch_count = 0,
550
591
        .mail_cache_fields = "flags",
 
592
        .mail_always_cache_fields = "",
551
593
        .mail_never_cache_fields = "imap.envelope",
552
594
        .mail_cache_min_mail_count = 0,
553
595
        .mailbox_idle_check_interval = 30,
564
606
        .mail_debug = FALSE,
565
607
        .mail_full_filesystem_access = FALSE,
566
608
        .maildir_stat_dirs = FALSE,
567
 
        .mail_shared_explicit_inbox = TRUE,
 
609
        .mail_shared_explicit_inbox = FALSE,
568
610
        .lock_method = "fcntl:flock:dotlock",
569
 
        .pop3_uidl_format = "%08Xu%08Xv"
 
611
        .pop3_uidl_format = "%08Xu%08Xv",
 
612
 
 
613
        .ssl_client_ca_dir = "",
 
614
        .ssl_client_ca_file = "",
 
615
        .ssl_crypto_device = ""
570
616
};
571
617
const struct setting_parser_info mail_storage_setting_parser_info = {
572
618
        .module_name = "mail",
588
634
        DEF(SET_STR, name),
589
635
        { SET_ENUM, "auto", offsetof(struct mailbox_settings, autocreate), NULL } ,
590
636
        DEF(SET_STR, special_use),
 
637
        DEF(SET_STR, driver),
591
638
 
592
639
        SETTING_DEFINE_LIST_END
593
640
};
596
643
        .autocreate = MAILBOX_SET_AUTO_NO":"
597
644
                MAILBOX_SET_AUTO_CREATE":"
598
645
                MAILBOX_SET_AUTO_SUBSCRIBE,
599
 
        .special_use = ""
 
646
        .special_use = "",
 
647
        .driver = ""
600
648
};
601
649
const struct setting_parser_info mailbox_setting_parser_info = {
602
650
        .defines = mailbox_setting_defines,
751
799
                *error_r = "invalid pop3c_port";
752
800
                return FALSE;
753
801
        }
754
 
#ifndef CONFIG_BINARY
755
 
        if (*set->pop3c_ssl_ca_dir != '\0' &&
756
 
            access(set->pop3c_ssl_ca_dir, X_OK) < 0) {
757
 
                *error_r = t_strdup_printf(
758
 
                        "pop3c_ssl_ca_dir: access(%s) failed: %m",
759
 
                        set->pop3c_ssl_ca_dir);
760
 
                return FALSE;
761
 
        }
762
 
#endif
763
802
        return TRUE;
764
803
}
765
804
#undef DEF
774
813
        DEF(SET_STR, pop3c_password),
775
814
 
776
815
        DEF(SET_ENUM, pop3c_ssl),
777
 
        DEF(SET_STR, pop3c_ssl_ca_dir),
778
816
        DEF(SET_BOOL, pop3c_ssl_verify),
779
817
 
780
818
        DEF(SET_STR, pop3c_rawlog_dir),
781
 
        DEF(SET_STR, ssl_crypto_device),
782
819
 
783
820
        SETTING_DEFINE_LIST_END
784
821
};
791
828
        .pop3c_password = "",
792
829
 
793
830
        .pop3c_ssl = "no:pop3s:starttls",
794
 
        .pop3c_ssl_ca_dir = "",
795
831
        .pop3c_ssl_verify = TRUE,
796
832
 
797
 
        .pop3c_rawlog_dir = "",
798
 
        .ssl_crypto_device = ""
 
833
        .pop3c_rawlog_dir = ""
799
834
};
800
835
static const struct setting_parser_info pop3c_setting_parser_info = {
801
836
        .module_name = "pop3c",
925
960
                *error_r = "invalid imapc_port";
926
961
                return FALSE;
927
962
        }
928
 
#ifndef CONFIG_BINARY
929
 
        if (*set->imapc_ssl_ca_dir != '\0' &&
930
 
            access(set->imapc_ssl_ca_dir, X_OK) < 0) {
931
 
                *error_r = t_strdup_printf(
932
 
                        "imapc_ssl_ca_dir: access(%s) failed: %m",
933
 
                        set->imapc_ssl_ca_dir);
934
 
                return FALSE;
935
 
        }
936
 
#endif
937
963
        if (set->imapc_max_idle_time == 0) {
938
964
                *error_r = "imapc_max_idle_time must not be 0";
939
965
                return FALSE;
954
980
        DEF(SET_STR, imapc_password),
955
981
 
956
982
        DEF(SET_ENUM, imapc_ssl),
957
 
        DEF(SET_STR, imapc_ssl_ca_dir),
958
983
        DEF(SET_BOOL, imapc_ssl_verify),
959
984
 
960
985
        DEF(SET_STR, imapc_features),
962
987
        DEF(SET_STR, imapc_list_prefix),
963
988
        DEF(SET_TIME, imapc_max_idle_time),
964
989
 
965
 
        DEF(SET_STR, ssl_crypto_device),
966
 
 
967
990
        SETTING_DEFINE_LIST_END
968
991
};
969
992
static const struct imapc_settings imapc_default_settings = {
970
993
        .imapc_host = "",
971
994
        .imapc_port = 143,
972
995
 
973
 
        .imapc_user = "%u",
 
996
        .imapc_user = "",
974
997
        .imapc_master_user = "",
975
998
        .imapc_password = "",
976
999
 
977
1000
        .imapc_ssl = "no:imaps:starttls",
978
 
        .imapc_ssl_ca_dir = "",
979
1001
        .imapc_ssl_verify = TRUE,
980
1002
 
981
1003
        .imapc_features = "",
982
1004
        .imapc_rawlog_dir = "",
983
1005
        .imapc_list_prefix = "",
984
 
        .imapc_max_idle_time = 60*29,
985
 
 
986
 
        .ssl_crypto_device = ""
 
1006
        .imapc_max_idle_time = 60*29
987
1007
};
988
1008
static const struct setting_parser_info imapc_setting_parser_info = {
989
1009
        .module_name = "imapc",
1026
1046
        .parent = &mail_user_setting_parser_info
1027
1047
};
1028
1048
/* ../../src/lib-settings/settings.c */
1029
 
/* ../../src/lib-master/master-service-settings.c */
1030
 
/* <settings checks> */
1031
 
static bool
1032
 
master_service_settings_check(void *_set, pool_t pool ATTR_UNUSED,
1033
 
                              const char **error_r ATTR_UNUSED)
1034
 
{
1035
 
        struct master_service_settings *set = _set;
1036
 
 
1037
 
        if (*set->log_path == '\0') {
1038
 
                /* default to syslog logging */
1039
 
                set->log_path = "syslog";
1040
 
        }
1041
 
        return TRUE;
1042
 
}
1043
 
/* </settings checks> */
1044
 
#undef DEF
1045
 
#define DEF(type, name) \
1046
 
        { type, #name, offsetof(struct master_service_settings, name), NULL }
1047
 
static const struct setting_define master_service_setting_defines[] = {
1048
 
        DEF(SET_STR, log_path),
1049
 
        DEF(SET_STR, info_log_path),
1050
 
        DEF(SET_STR, debug_log_path),
1051
 
        DEF(SET_STR, log_timestamp),
1052
 
        DEF(SET_STR, syslog_facility),
1053
 
        DEF(SET_SIZE, config_cache_size),
1054
 
        DEF(SET_BOOL, version_ignore),
1055
 
        DEF(SET_BOOL, shutdown_clients),
1056
 
        DEF(SET_BOOL, verbose_proctitle),
1057
 
 
1058
 
        SETTING_DEFINE_LIST_END
1059
 
};
1060
 
static const struct master_service_settings master_service_default_settings = {
1061
 
        .log_path = "syslog",
1062
 
        .info_log_path = "",
1063
 
        .debug_log_path = "",
1064
 
        .log_timestamp = DEFAULT_FAILURE_STAMP_FORMAT,
1065
 
        .syslog_facility = "mail",
1066
 
        .config_cache_size = 1024*1024,
1067
 
        .version_ignore = FALSE,
1068
 
        .shutdown_clients = TRUE,
1069
 
        .verbose_proctitle = FALSE
1070
 
};
1071
 
const struct setting_parser_info master_service_setting_parser_info = {
1072
 
        .module_name = "master",
1073
 
        .defines = master_service_setting_defines,
1074
 
        .defaults = &master_service_default_settings,
1075
 
 
1076
 
        .type_offset = (size_t)-1,
1077
 
        .struct_size = sizeof(struct master_service_settings),
1078
 
 
1079
 
        .parent_offset = (size_t)-1,
1080
 
        .check_func = master_service_settings_check
1081
 
};
1082
1049
/* ../../src/lib-lda/lda-settings.c */
1083
1050
#undef DEF
1084
1051
#undef DEFLIST
1087
1054
#define DEFLIST(field, name, defines) \
1088
1055
        { SET_DEFLIST, name, offsetof(struct lda_settings, field), defines }
1089
1056
static const struct setting_define lda_setting_defines[] = {
1090
 
        DEF(SET_STR, postmaster_address),
 
1057
        DEF(SET_STR_VARS, postmaster_address),
1091
1058
        DEF(SET_STR, hostname),
1092
1059
        DEF(SET_STR, submission_host),
1093
1060
        DEF(SET_STR, sendmail_path),
1189
1156
        const char *pop3_client_workarounds;
1190
1157
        const char *pop3_logout_format;
1191
1158
        const char *pop3_uidl_duplicates;
 
1159
        const char *pop3_deleted_flag;
1192
1160
 
1193
1161
        enum pop3_client_workarounds parsed_workarounds;
1194
1162
};
1198
1166
extern const struct setting_parser_info master_setting_parser_info;
1199
1167
struct master_settings {
1200
1168
        const char *base_dir;
 
1169
        const char *state_dir;
1201
1170
        const char *libexec_dir;
1202
1171
        const char *instance_name;
1203
1172
        const char *import_environment;
1229
1198
        const char *login_access_sockets;
1230
1199
        const char *director_username_hash;
1231
1200
 
1232
 
        const char *ssl;
1233
 
        const char *ssl_ca;
1234
 
        const char *ssl_cert;
1235
 
        const char *ssl_key;
1236
 
        const char *ssl_key_password;
1237
 
        const char *ssl_cipher_list;
1238
 
        const char *ssl_protocols;
1239
 
        const char *ssl_cert_username_field;
1240
1201
        const char *ssl_client_cert;
1241
1202
        const char *ssl_client_key;
1242
 
        const char *ssl_crypto_device;
1243
 
        bool ssl_verify_client_cert;
1244
1203
        bool ssl_require_crl;
1245
1204
        bool auth_ssl_require_client_cert;
1246
1205
        bool auth_ssl_username_from_cert;
1247
 
        bool verbose_ssl;
1248
1206
 
1249
1207
        bool disable_plaintext_auth;
1250
1208
        bool auth_verbose;
1263
1221
        bool lmtp_proxy;
1264
1222
        bool lmtp_save_to_detail_mailbox;
1265
1223
        bool lmtp_rcpt_check_quota;
1266
 
        const char *login_greeting;
1267
1224
        const char *lmtp_address_translate;
 
1225
        const char *login_greeting;
 
1226
        const char *login_trusted_networks;
1268
1227
};
1269
1228
/* ../../src/imap/imap-settings.h */
1270
1229
extern const struct setting_parser_info imap_setting_parser_info;
1287
1246
        const char *imap_id_send;
1288
1247
        const char *imap_id_log;
1289
1248
 
 
1249
        /* imap urlauth: */
 
1250
        const char *imap_urlauth_host;
 
1251
        unsigned int imap_urlauth_port;
 
1252
 
1290
1253
        enum imap_client_workarounds parsed_workarounds;
1291
1254
};
 
1255
/* ../../src/imap-urlauth/imap-urlauth-worker-settings.h */
 
1256
extern const struct setting_parser_info imap_urlauth_worker_setting_parser_info;
 
1257
struct imap_urlauth_worker_settings {
 
1258
        bool verbose_proctitle;
 
1259
 
 
1260
        /* imap_urlauth: */
 
1261
        const char *imap_urlauth_host;
 
1262
        unsigned int imap_urlauth_port;
 
1263
};
 
1264
/* ../../src/imap-urlauth/imap-urlauth-settings.h */
 
1265
extern const struct setting_parser_info imap_urlauth_setting_parser_info;
 
1266
struct imap_urlauth_settings {
 
1267
        const char *base_dir;
 
1268
 
 
1269
        bool mail_debug;
 
1270
 
 
1271
        bool verbose_proctitle;
 
1272
 
 
1273
        /* imap_urlauth: */
 
1274
        const char *imap_urlauth_logout_format;
 
1275
 
 
1276
        const char *imap_urlauth_submit_user;
 
1277
        const char *imap_urlauth_stream_user;
 
1278
};
 
1279
/* ../../src/imap-urlauth/imap-urlauth-login-settings.h */
 
1280
extern const struct setting_parser_info *imap_urlauth_login_setting_roots[];
1292
1281
/* ../../src/imap-login/imap-login-settings.h */
1293
1282
extern const struct setting_parser_info *imap_login_setting_roots[];
1294
1283
struct imap_login_settings {
1305
1294
        const char *mail_plugin_dir;
1306
1295
        const char *doveadm_socket_path;
1307
1296
        unsigned int doveadm_worker_count;
1308
 
        unsigned int doveadm_proxy_port;
 
1297
        unsigned int doveadm_port;
1309
1298
        const char *doveadm_password;
1310
1299
        const char *doveadm_allowed_commands;
1311
1300
        const char *dsync_alt_char;
1312
1301
        const char *dsync_remote_cmd;
 
1302
        const char *ssl_client_ca_dir;
 
1303
        const char *ssl_client_ca_file;
1313
1304
 
1314
 
        ARRAY_DEFINE(plugin_envs, const char *);
 
1305
        ARRAY(const char *) plugin_envs;
1315
1306
};
1316
1307
/* ../../src/director/director-settings.h */
1317
1308
extern const struct setting_parser_info director_setting_parser_info;
1329
1320
struct dict_settings {
1330
1321
        const char *base_dir;
1331
1322
        const char *dict_db_config;
1332
 
        ARRAY_DEFINE(dicts, const char *);
 
1323
        ARRAY(const char *) dicts;
1333
1324
};
1334
1325
/* ../../src/auth/auth-settings.h */
1335
1326
extern const struct setting_parser_info auth_setting_parser_info;
1338
1329
        const char *args;
1339
1330
        const char *default_fields;
1340
1331
        const char *override_fields;
 
1332
        const char *skip;
 
1333
        const char *result_success;
 
1334
        const char *result_failure;
 
1335
        const char *result_internalfail;
1341
1336
        bool deny;
1342
1337
        bool pass;
1343
1338
        bool master;
1365
1360
        const char *winbind_helper_path;
1366
1361
        const char *proxy_self;
1367
1362
        unsigned int failure_delay;
1368
 
        unsigned int first_valid_uid;
1369
 
        unsigned int last_valid_uid;
1370
1363
 
1371
1364
        bool verbose, debug, debug_passwords;
1372
1365
        const char *verbose_passwords;
1376
1369
 
1377
1370
        unsigned int worker_max_count;
1378
1371
 
1379
 
        ARRAY_DEFINE(passdbs, struct auth_passdb_settings *);
1380
 
        ARRAY_DEFINE(userdbs, struct auth_userdb_settings *);
 
1372
        /* settings that don't have auth_ prefix: */
 
1373
        ARRAY(struct auth_passdb_settings *) passdbs;
 
1374
        ARRAY(struct auth_userdb_settings *) userdbs;
1381
1375
 
1382
1376
        const char *base_dir;
1383
1377
        bool verbose_proctitle;
 
1378
        unsigned int first_valid_uid;
 
1379
        unsigned int last_valid_uid;
1384
1380
 
1385
1381
        /* generated: */
1386
1382
        char username_chars_map[256];
1454
1450
        .process_limit = 1,
1455
1451
        .client_limit = 0,
1456
1452
        .service_count = 0,
1457
 
        .idle_kill = -1U,
 
1453
        .idle_kill = UINT_MAX,
1458
1454
        .vsz_limit = (uoff_t)-1,
1459
1455
 
1460
1456
        .unix_listeners = { { &stats_unix_listeners_buf,
1498
1494
/* ../../src/ssl-params/ssl-params-settings.c */
1499
1495
/* <settings checks> */
1500
1496
static struct file_listener_settings ssl_params_unix_listeners_array[] = {
 
1497
        { "ssl-params", 0666, "", "" },
1501
1498
        { "login/ssl-params", 0666, "", "" }
1502
1499
};
1503
1500
static struct file_listener_settings *ssl_params_unix_listeners[] = {
1504
 
        &ssl_params_unix_listeners_array[0]
 
1501
        &ssl_params_unix_listeners_array[0],
 
1502
        &ssl_params_unix_listeners_array[1]
1505
1503
};
1506
1504
static buffer_t ssl_params_unix_listeners_buf = {
1507
1505
        ssl_params_unix_listeners, sizeof(ssl_params_unix_listeners), { 0, }
1560
1558
/* ../../src/replication/replicator/replicator-settings.c */
1561
1559
/* <settings checks> */
1562
1560
static struct file_listener_settings replicator_unix_listeners_array[] = {
1563
 
        { "replicator", 0600, "$default_internal_user", "" }
 
1561
        { "replicator", 0600, "$default_internal_user", "" },
 
1562
        { "replicator-doveadm", 0, "$default_internal_user", "" }
1564
1563
};
1565
1564
static struct file_listener_settings *replicator_unix_listeners[] = {
1566
 
        &replicator_unix_listeners_array[0]
 
1565
        &replicator_unix_listeners_array[0],
 
1566
        &replicator_unix_listeners_array[1]
1567
1567
};
1568
1568
static buffer_t replicator_unix_listeners_buf = {
1569
1569
        replicator_unix_listeners, sizeof(replicator_unix_listeners), { 0, }
1586
1586
        .process_limit = 1,
1587
1587
        .client_limit = 0,
1588
1588
        .service_count = 0,
1589
 
        .idle_kill = -1U,
 
1589
        .idle_kill = UINT_MAX,
1590
1590
        .vsz_limit = (uoff_t)-1,
1591
1591
 
1592
1592
        .unix_listeners = { { &replicator_unix_listeners_buf,
1610
1610
        .auth_socket_path = "auth-userdb",
1611
1611
        .doveadm_socket_path = "doveadm-server",
1612
1612
 
1613
 
        .replication_full_sync_interval = 60*60*12,
 
1613
        .replication_full_sync_interval = 60*60*24,
1614
1614
        .replication_max_conns = 10
1615
1615
};
1616
1616
const struct setting_parser_info replicator_setting_parser_info = {
1798
1798
        DEF(SET_STR, pop3_client_workarounds),
1799
1799
        DEF(SET_STR, pop3_logout_format),
1800
1800
        DEF(SET_ENUM, pop3_uidl_duplicates),
 
1801
        DEF(SET_STR, pop3_deleted_flag),
1801
1802
 
1802
1803
        SETTING_DEFINE_LIST_END
1803
1804
};
1812
1813
        .pop3_fast_size_lookups = FALSE,
1813
1814
        .pop3_client_workarounds = "",
1814
1815
        .pop3_logout_format = "top=%t/%p, retr=%r/%b, del=%d/%m, size=%s",
1815
 
        .pop3_uidl_duplicates = "allow:rename"
 
1816
        .pop3_uidl_duplicates = "allow:rename",
 
1817
        .pop3_deleted_flag = ""
1816
1818
};
1817
1819
static const struct setting_parser_info *pop3_setting_dependencies[] = {
1818
1820
        &mail_user_setting_parser_info,
2158
2160
                        continue;
2159
2161
                }
2160
2162
 
2161
 
                if (*service->executable == '\0') {
2162
 
                        *error_r = t_strdup_printf("service(%s): "
2163
 
                                "executable is empty", service->name);
2164
 
                        return FALSE;
2165
 
                }
2166
 
                if (*service->executable != '/') {
 
2163
                if (*service->executable != '/' &&
 
2164
                    *service->executable != '\0') {
2167
2165
                        service->executable =
2168
2166
                                p_strconcat(pool, set->libexec_dir, "/",
2169
2167
                                            service->executable, NULL);
2402
2400
        { SET_DEFLIST_UNIQUE, name, offsetof(struct master_settings, field), defines }
2403
2401
static const struct setting_define master_setting_defines[] = {
2404
2402
        DEF(SET_STR, base_dir),
 
2403
        DEF(SET_STR, state_dir),
2405
2404
        DEF(SET_STR, libexec_dir),
2406
2405
        DEF(SET_STR, instance_name),
2407
2406
        DEF(SET_STR, import_environment),
2428
2427
};
2429
2428
struct master_settings master_default_settings = {
2430
2429
        .base_dir = PKG_RUNDIR,
 
2430
        .state_dir = PKG_STATEDIR,
2431
2431
        .libexec_dir = PKG_LIBEXECDIR,
2432
2432
        .instance_name = PACKAGE,
2433
2433
        .import_environment = "TZ" ENV_SYSTEMD ENV_GDB,
2469
2469
};
2470
2470
/* ../../src/login-common/login-settings.c */
2471
2471
/* <settings checks> */
2472
 
static int ssl_settings_check(void *_set ATTR_UNUSED, const char **error_r)
2473
 
{
2474
 
        struct login_settings *set = _set;
2475
 
 
2476
 
#ifndef HAVE_SSL
2477
 
        *error_r = t_strdup_printf("SSL support not compiled in but ssl=%s",
2478
 
                                   set->ssl);
2479
 
        return FALSE;
2480
 
#else
2481
 
        if (*set->ssl_cert == '\0') {
2482
 
                *error_r = "ssl enabled, but ssl_cert not set";
2483
 
                return FALSE;
2484
 
        }
2485
 
        if (*set->ssl_key == '\0') {
2486
 
                *error_r = "ssl enabled, but ssl_key not set";
2487
 
                return FALSE;
2488
 
        }
2489
 
        if (set->ssl_verify_client_cert && *set->ssl_ca == '\0') {
2490
 
                *error_r = "ssl_verify_client_cert set, but ssl_ca not";
2491
 
                return FALSE;
2492
 
        }
2493
 
        return TRUE;
2494
 
#endif
2495
 
}
2496
 
 
2497
 
static bool login_settings_check(void *_set, pool_t pool, const char **error_r)
 
2472
static bool login_settings_check(void *_set, pool_t pool,
 
2473
                                 const char **error_r ATTR_UNUSED)
2498
2474
{
2499
2475
        struct login_settings *set = _set;
2500
2476
 
2501
2477
        set->log_format_elements_split =
2502
2478
                p_strsplit(pool, set->login_log_format_elements, " ");
2503
2479
 
2504
 
        if (set->auth_ssl_require_client_cert ||
2505
 
            set->auth_ssl_username_from_cert) {
2506
 
                /* if we require valid cert, make sure we also ask for it */
2507
 
                set->ssl_verify_client_cert = TRUE;
2508
 
        }
2509
 
 
2510
2480
        if (set->auth_debug_passwords)
2511
2481
                set->auth_debug = TRUE;
2512
2482
        if (set->auth_debug)
2513
2483
                set->auth_verbose = TRUE;
2514
 
 
2515
 
        if (strcmp(set->ssl, "no") == 0) {
2516
 
                /* disabled */
2517
 
        } else if (strcmp(set->ssl, "yes") == 0) {
2518
 
                if (!ssl_settings_check(set, error_r))
2519
 
                        return FALSE;
2520
 
        } else if (strcmp(set->ssl, "required") == 0) {
2521
 
                if (!ssl_settings_check(set, error_r))
2522
 
                        return FALSE;
2523
 
                set->disable_plaintext_auth = TRUE;
2524
 
        } else {
2525
 
                *error_r = t_strdup_printf("Unknown ssl setting value: %s",
2526
 
                                           set->ssl);
2527
 
                return FALSE;
2528
 
        }
2529
2484
        return TRUE;
2530
2485
}
2531
2486
/* </settings checks> */
2540
2495
        DEF(SET_STR, login_access_sockets),
2541
2496
        DEF(SET_STR, director_username_hash),
2542
2497
 
2543
 
        DEF(SET_ENUM, ssl),
2544
 
        DEF(SET_STR, ssl_ca),
2545
 
        DEF(SET_STR, ssl_cert),
2546
 
        DEF(SET_STR, ssl_key),
2547
 
        DEF(SET_STR, ssl_key_password),
2548
 
        DEF(SET_STR, ssl_cipher_list),
2549
 
        DEF(SET_STR, ssl_protocols),
2550
 
        DEF(SET_STR, ssl_cert_username_field),
2551
2498
        DEF(SET_STR, ssl_client_cert),
2552
2499
        DEF(SET_STR, ssl_client_key),
2553
 
        DEF(SET_STR, ssl_crypto_device),
2554
 
        DEF(SET_BOOL, ssl_verify_client_cert),
2555
2500
        DEF(SET_BOOL, ssl_require_crl),
2556
2501
        DEF(SET_BOOL, auth_ssl_require_client_cert),
2557
2502
        DEF(SET_BOOL, auth_ssl_username_from_cert),
2558
 
        DEF(SET_BOOL, verbose_ssl),
2559
2503
 
2560
2504
        DEF(SET_BOOL, disable_plaintext_auth),
2561
2505
        DEF(SET_BOOL, auth_verbose),
2574
2518
        .login_access_sockets = "",
2575
2519
        .director_username_hash = "%u",
2576
2520
 
2577
 
        .ssl = "yes:no:required",
2578
 
        .ssl_ca = "",
2579
 
        .ssl_cert = "",
2580
 
        .ssl_key = "",
2581
 
        .ssl_key_password = "",
2582
 
        .ssl_cipher_list = "ALL:!LOW:!SSLv2:!EXP:!aNULL",
2583
 
        .ssl_protocols = "!SSLv2",
2584
 
        .ssl_cert_username_field = "commonName",
2585
2521
        .ssl_client_cert = "",
2586
2522
        .ssl_client_key = "",
2587
 
        .ssl_crypto_device = "",
2588
 
        .ssl_verify_client_cert = FALSE,
2589
2523
        .ssl_require_crl = TRUE,
2590
2524
        .auth_ssl_require_client_cert = FALSE,
2591
2525
        .auth_ssl_username_from_cert = FALSE,
2592
 
        .verbose_ssl = FALSE,
2593
2526
 
2594
2527
        .disable_plaintext_auth = TRUE,
2595
2528
        .auth_verbose = FALSE,
2640
2573
        .process_limit = 1,
2641
2574
        .client_limit = 0,
2642
2575
        .service_count = 0,
2643
 
        .idle_kill = -1U,
 
2576
        .idle_kill = UINT_MAX,
2644
2577
        .vsz_limit = (uoff_t)-1,
2645
2578
 
2646
2579
        .unix_listeners = { { &log_unix_listeners_buf,
2694
2627
        DEF(SET_BOOL, lmtp_proxy),
2695
2628
        DEF(SET_BOOL, lmtp_save_to_detail_mailbox),
2696
2629
        DEF(SET_BOOL, lmtp_rcpt_check_quota),
2697
 
        DEF(SET_STR_VARS, login_greeting),
2698
2630
        DEF(SET_STR, lmtp_address_translate),
 
2631
        DEF(SET_STR_VARS, login_greeting),
 
2632
        DEF(SET_STR, login_trusted_networks),
2699
2633
 
2700
2634
        SETTING_DEFINE_LIST_END
2701
2635
};
2703
2637
        .lmtp_proxy = FALSE,
2704
2638
        .lmtp_save_to_detail_mailbox = FALSE,
2705
2639
        .lmtp_rcpt_check_quota = FALSE,
 
2640
        .lmtp_address_translate = "",
2706
2641
        .login_greeting = PACKAGE_NAME" ready.",
2707
 
        .lmtp_address_translate = ""
 
2642
        .login_trusted_networks = ""
2708
2643
};
2709
2644
static const struct setting_parser_info *lmtp_setting_dependencies[] = {
2710
2645
        &lda_setting_parser_info,
2941
2876
        DEF(SET_STR, imap_id_send),
2942
2877
        DEF(SET_STR, imap_id_log),
2943
2878
 
 
2879
        DEF(SET_STR, imap_urlauth_host),
 
2880
        DEF(SET_UINT, imap_urlauth_port),
 
2881
 
2944
2882
        SETTING_DEFINE_LIST_END
2945
2883
};
2946
2884
static const struct imap_settings imap_default_settings = {
2954
2892
        .imap_capability = "",
2955
2893
        .imap_client_workarounds = "",
2956
2894
        .imap_logout_format = "in=%i out=%o",
2957
 
        .imap_id_send = "",
2958
 
        .imap_id_log = ""
 
2895
        .imap_id_send = "name *",
 
2896
        .imap_id_log = "",
 
2897
 
 
2898
        .imap_urlauth_host = "",
 
2899
        .imap_urlauth_port = 143
2959
2900
};
2960
2901
static const struct setting_parser_info *imap_setting_dependencies[] = {
2961
2902
        &mail_user_setting_parser_info,
2974
2915
        .check_func = imap_settings_verify,
2975
2916
        .dependencies = imap_setting_dependencies
2976
2917
};
 
2918
/* ../../src/imap-urlauth/imap-urlauth-worker-settings.c */
 
2919
/* <settings checks> */
 
2920
static struct file_listener_settings imap_urlauth_worker_unix_listeners_array[] = {
 
2921
        { "imap-urlauth-worker", 0600, "$default_internal_user", "" }
 
2922
};
 
2923
static struct file_listener_settings *imap_urlauth_worker_unix_listeners[] = {
 
2924
        &imap_urlauth_worker_unix_listeners_array[0]
 
2925
};
 
2926
static buffer_t imap_urlauth_worker_unix_listeners_buf = {
 
2927
        imap_urlauth_worker_unix_listeners, sizeof(imap_urlauth_worker_unix_listeners), { 0, }
 
2928
};
 
2929
/* </settings checks> */
 
2930
struct service_settings imap_urlauth_worker_service_settings = {
 
2931
        .name = "imap-urlauth-worker",
 
2932
        .protocol = "imap",
 
2933
        .type = "",
 
2934
        .executable = "imap-urlauth-worker",
 
2935
        .user = "",
 
2936
        .group = "",
 
2937
        .privileged_group = "",
 
2938
        .extra_groups = "",
 
2939
        .chroot = "",
 
2940
 
 
2941
        .drop_priv_before_exec = FALSE,
 
2942
 
 
2943
        .process_min_avail = 0,
 
2944
        .process_limit = 1024,
 
2945
        .client_limit = 1,
 
2946
        .service_count = 1,
 
2947
        .idle_kill = 0,
 
2948
        .vsz_limit = (uoff_t)-1,
 
2949
 
 
2950
        .unix_listeners = { { &imap_urlauth_worker_unix_listeners_buf,
 
2951
                              sizeof(imap_urlauth_worker_unix_listeners[0]) } },
 
2952
        .fifo_listeners = ARRAY_INIT,
 
2953
        .inet_listeners = ARRAY_INIT
 
2954
};
 
2955
#undef DEF
 
2956
#define DEF(type, name) \
 
2957
        { type, #name, offsetof(struct imap_urlauth_worker_settings, name), NULL }
 
2958
static const struct setting_define imap_urlauth_worker_setting_defines[] = {
 
2959
        DEF(SET_BOOL, verbose_proctitle),
 
2960
 
 
2961
        DEF(SET_STR, imap_urlauth_host),
 
2962
        DEF(SET_UINT, imap_urlauth_port),
 
2963
 
 
2964
        SETTING_DEFINE_LIST_END
 
2965
};
 
2966
const struct imap_urlauth_worker_settings imap_urlauth_worker_default_settings = {
 
2967
        .verbose_proctitle = FALSE,
 
2968
 
 
2969
        .imap_urlauth_host = "",
 
2970
        .imap_urlauth_port = 143
 
2971
};
 
2972
static const struct setting_parser_info *imap_urlauth_worker_setting_dependencies[] = {
 
2973
        &mail_user_setting_parser_info,
 
2974
        NULL
 
2975
};
 
2976
const struct setting_parser_info imap_urlauth_worker_setting_parser_info = {
 
2977
        .module_name = "imap-urlauth-worker",
 
2978
        .defines = imap_urlauth_worker_setting_defines,
 
2979
        .defaults = &imap_urlauth_worker_default_settings,
 
2980
 
 
2981
        .type_offset = (size_t)-1,
 
2982
        .struct_size = sizeof(struct imap_urlauth_worker_settings),
 
2983
 
 
2984
        .parent_offset = (size_t)-1,
 
2985
 
 
2986
        .dependencies = imap_urlauth_worker_setting_dependencies
 
2987
};
 
2988
/* ../../src/imap-urlauth/imap-urlauth-settings.c */
 
2989
/* <settings checks> */
 
2990
static struct file_listener_settings imap_urlauth_unix_listeners_array[] = {
 
2991
        { "token-login/imap-urlauth", 0666, "", "" }
 
2992
};
 
2993
static struct file_listener_settings *imap_urlauth_unix_listeners[] = {
 
2994
        &imap_urlauth_unix_listeners_array[0]
 
2995
};
 
2996
static buffer_t imap_urlauth_unix_listeners_buf = {
 
2997
        imap_urlauth_unix_listeners, sizeof(imap_urlauth_unix_listeners), { 0, }
 
2998
};
 
2999
/* </settings checks> */
 
3000
struct service_settings imap_urlauth_service_settings = {
 
3001
        .name = "imap-urlauth",
 
3002
        .protocol = "imap",
 
3003
        .type = "",
 
3004
        .executable = "imap-urlauth",
 
3005
        .user = "$default_internal_user",
 
3006
        .group = "",
 
3007
        .privileged_group = "",
 
3008
        .extra_groups = "",
 
3009
        .chroot = "",
 
3010
 
 
3011
        .drop_priv_before_exec = FALSE,
 
3012
 
 
3013
        .process_min_avail = 0,
 
3014
        .process_limit = 1024,
 
3015
        .client_limit = 1,
 
3016
        .service_count = 1,
 
3017
        .idle_kill = 0,
 
3018
        .vsz_limit = (uoff_t)-1,
 
3019
 
 
3020
        .unix_listeners = { { &imap_urlauth_unix_listeners_buf,
 
3021
                              sizeof(imap_urlauth_unix_listeners[0]) } },
 
3022
        .fifo_listeners = ARRAY_INIT,
 
3023
        .inet_listeners = ARRAY_INIT
 
3024
};
 
3025
#undef DEF
 
3026
#define DEF(type, name) \
 
3027
        { type, #name, offsetof(struct imap_urlauth_settings, name), NULL }
 
3028
static const struct setting_define imap_urlauth_setting_defines[] = {
 
3029
        DEF(SET_STR, base_dir),
 
3030
 
 
3031
        DEF(SET_BOOL, mail_debug),
 
3032
 
 
3033
        DEF(SET_BOOL, verbose_proctitle),
 
3034
 
 
3035
        DEF(SET_STR, imap_urlauth_logout_format),
 
3036
        DEF(SET_STR, imap_urlauth_submit_user),
 
3037
        DEF(SET_STR, imap_urlauth_stream_user),
 
3038
 
 
3039
        SETTING_DEFINE_LIST_END
 
3040
};
 
3041
const struct imap_urlauth_settings imap_urlauth_default_settings = {
 
3042
        .base_dir = PKG_RUNDIR,
 
3043
  .mail_debug = FALSE,
 
3044
 
 
3045
        .verbose_proctitle = FALSE,
 
3046
 
 
3047
        .imap_urlauth_logout_format = "in=%i out=%o",
 
3048
        .imap_urlauth_submit_user = NULL,
 
3049
        .imap_urlauth_stream_user = NULL
 
3050
};
 
3051
static const struct setting_parser_info *imap_urlauth_setting_dependencies[] = {
 
3052
        NULL
 
3053
};
 
3054
const struct setting_parser_info imap_urlauth_setting_parser_info = {
 
3055
        .module_name = "imap-urlauth",
 
3056
        .defines = imap_urlauth_setting_defines,
 
3057
        .defaults = &imap_urlauth_default_settings,
 
3058
 
 
3059
        .type_offset = (size_t)-1,
 
3060
        .struct_size = sizeof(struct imap_urlauth_settings),
 
3061
 
 
3062
        .parent_offset = (size_t)-1,
 
3063
 
 
3064
        .dependencies = imap_urlauth_setting_dependencies
 
3065
};
 
3066
/* ../../src/imap-urlauth/imap-urlauth-login-settings.c */
 
3067
/* <settings checks> */
 
3068
static struct file_listener_settings
 
3069
imap_urlauth_login_unix_listeners_array[] = {
 
3070
        { "imap-urlauth", 0666, "", "" }
 
3071
};
 
3072
static struct file_listener_settings *imap_urlauth_login_unix_listeners[] = {
 
3073
        &imap_urlauth_login_unix_listeners_array[0]
 
3074
};
 
3075
static buffer_t imap_urlauth_login_unix_listeners_buf = {
 
3076
        imap_urlauth_login_unix_listeners,
 
3077
                sizeof(imap_urlauth_login_unix_listeners), { 0, }
 
3078
};
 
3079
/* </settings checks> */
 
3080
struct service_settings imap_urlauth_login_service_settings = {
 
3081
        .name = "imap-urlauth-login",
 
3082
        .protocol = "imap",
 
3083
        .type = "login",
 
3084
        .executable = "imap-urlauth-login",
 
3085
        .user = "$default_login_user",
 
3086
        .group = "",
 
3087
        .privileged_group = "",
 
3088
        .extra_groups = "",
 
3089
        .chroot = "token-login",
 
3090
 
 
3091
        .drop_priv_before_exec = FALSE,
 
3092
 
 
3093
        .process_min_avail = 0,
 
3094
        .process_limit = 0,
 
3095
        .client_limit = 0,
 
3096
        .service_count = 1,
 
3097
        .idle_kill = 0,
 
3098
        .vsz_limit = (uoff_t)-1,
 
3099
 
 
3100
        .unix_listeners = { { &imap_urlauth_login_unix_listeners_buf,
 
3101
                              sizeof(imap_urlauth_login_unix_listeners[0]) } },
 
3102
        .fifo_listeners = ARRAY_INIT,
 
3103
        .inet_listeners = ARRAY_INIT
 
3104
};
 
3105
static const struct setting_define imap_urlauth_login_setting_defines[] = {
 
3106
        SETTING_DEFINE_LIST_END
 
3107
};
 
3108
static const struct setting_parser_info *imap_urlauth_login_setting_dependencies[] = {
 
3109
        &login_setting_parser_info,
 
3110
        NULL
 
3111
};
 
3112
const struct setting_parser_info imap_urlauth_login_setting_parser_info = {
 
3113
        .module_name = "imap-urlauth-login",
 
3114
        .defines = imap_urlauth_login_setting_defines,
 
3115
 
 
3116
        .type_offset = (size_t)-1,
 
3117
        .parent_offset = (size_t)-1,
 
3118
 
 
3119
        .dependencies = imap_urlauth_login_setting_dependencies
 
3120
};
 
3121
const struct setting_parser_info *imap_urlauth_login_setting_roots[] = {
 
3122
        &login_setting_parser_info,
 
3123
        &imap_urlauth_login_setting_parser_info,
 
3124
        NULL
 
3125
};
2977
3126
/* ../../src/imap-login/imap-login-settings.c */
2978
3127
/* <settings checks> */
2979
3128
static struct inet_listener_settings imap_login_inet_listeners_array[] = {
3025
3174
};
3026
3175
static const struct imap_login_settings imap_login_default_settings = {
3027
3176
        .imap_capability = "",
3028
 
        .imap_id_send = "",
 
3177
        .imap_id_send = "name *",
3029
3178
        .imap_id_log = ""
3030
3179
};
3031
3180
static const struct setting_parser_info *imap_login_setting_dependencies[] = {
3061
3210
};
3062
3211
/* </settings checks> */
3063
3212
/* <settings checks> */
3064
 
static bool doveadm_settings_check(void *_set ATTR_UNUSED,
3065
 
                                   pool_t pool ATTR_UNUSED,
3066
 
                                   const char **error_r ATTR_UNUSED)
 
3213
static bool doveadm_settings_check(void *_set, pool_t pool ATTR_UNUSED,
 
3214
                                   const char **error_r)
3067
3215
{
3068
 
#ifndef CONFIG_BINARY
3069
3216
        struct doveadm_settings *set = _set;
3070
3217
 
 
3218
#ifndef CONFIG_BINARY
3071
3219
        fix_base_path(set, pool, &set->doveadm_socket_path);
3072
3220
#endif
 
3221
        if (*set->dsync_alt_char == '\0') {
 
3222
                *error_r = "dsync_alt_char must not be empty";
 
3223
                return FALSE;
 
3224
        }
3073
3225
        return TRUE;
3074
3226
}
3075
3227
/* </settings checks> */
3108
3260
        DEF(SET_STR, mail_plugin_dir),
3109
3261
        DEF(SET_STR, doveadm_socket_path),
3110
3262
        DEF(SET_UINT, doveadm_worker_count),
3111
 
        DEF(SET_UINT, doveadm_proxy_port),
 
3263
        DEF(SET_UINT, doveadm_port),
 
3264
        { SET_ALIAS, "doveadm_proxy_port", 0, NULL },
3112
3265
        DEF(SET_STR, doveadm_password),
3113
3266
        DEF(SET_STR, doveadm_allowed_commands),
3114
3267
        DEF(SET_STR, dsync_alt_char),
3115
3268
        DEF(SET_STR, dsync_remote_cmd),
 
3269
        DEF(SET_STR, ssl_client_ca_dir),
 
3270
        DEF(SET_STR, ssl_client_ca_file),
3116
3271
 
3117
3272
        { SET_STRLIST, "plugin", offsetof(struct doveadm_settings, plugin_envs), NULL },
3118
3273
 
3125
3280
        .mail_plugin_dir = MODULEDIR,
3126
3281
        .doveadm_socket_path = "doveadm-server",
3127
3282
        .doveadm_worker_count = 0,
3128
 
        .doveadm_proxy_port = 0,
 
3283
        .doveadm_port = 0,
3129
3284
        .doveadm_password = "",
3130
3285
        .doveadm_allowed_commands = "",
3131
3286
        .dsync_alt_char = "_",
3132
 
        .dsync_remote_cmd = "ssh -l%{login} %{host} doveadm dsync-server -u%u -l%{lock_timeout} -n%{namespace}",
 
3287
        .dsync_remote_cmd = "ssh -l%{login} %{host} doveadm dsync-server -u%u -U",
 
3288
        .ssl_client_ca_dir = "",
 
3289
        .ssl_client_ca_file = "",
3133
3290
 
3134
3291
        .plugin_envs = ARRAY_INIT
3135
3292
};
3152
3309
/* ../../src/dns/dns-client-settings.c */
3153
3310
/* <settings checks> */
3154
3311
static struct file_listener_settings dns_client_unix_listeners_array[] = {
3155
 
        { "dns-client", 0666, "", "" },
3156
 
        { "login/dns-client", 0666, "", "" }
 
3312
        { "dns-client", 0666, "", "" }
3157
3313
};
3158
3314
static struct file_listener_settings *dns_client_unix_listeners[] = {
3159
 
        &dns_client_unix_listeners_array[0],
3160
 
        &dns_client_unix_listeners_array[1]
 
3315
        &dns_client_unix_listeners_array[0]
3161
3316
};
3162
3317
static buffer_t dns_client_unix_listeners_buf = {
3163
3318
        dns_client_unix_listeners, sizeof(dns_client_unix_listeners), { 0, }
3190
3345
};
3191
3346
/* ../../src/director/director-settings.c */
3192
3347
/* <settings checks> */
 
3348
static bool director_settings_verify(void *_set, pool_t pool, const char **error_r);
 
3349
 
3193
3350
static struct file_listener_settings director_unix_listeners_array[] = {
3194
3351
        { "login/director", 0, "", "" },
3195
3352
        { "director-admin", 0600, "", "" }
3213
3370
        sizeof(director_fifo_listeners), { 0, }
3214
3371
};
3215
3372
/* </settings checks> */
 
3373
/* <settings checks> */
 
3374
static bool
 
3375
director_settings_verify(void *_set, pool_t pool ATTR_UNUSED, const char **error_r)
 
3376
{
 
3377
        struct director_settings *set = _set;
 
3378
 
 
3379
        if (set->director_user_expire < 10) {
 
3380
                *error_r = "director_user_expire is too low";
 
3381
                return FALSE;
 
3382
        }
 
3383
        return TRUE;
 
3384
}
 
3385
/* </settings checks> */
3216
3386
struct service_settings director_service_settings = {
3217
3387
        .name = "director",
3218
3388
        .protocol = "",
3230
3400
        .process_limit = 1,
3231
3401
        .client_limit = 0,
3232
3402
        .service_count = 0,
3233
 
        .idle_kill = -1U,
 
3403
        .idle_kill = UINT_MAX,
3234
3404
        .vsz_limit = (uoff_t)-1,
3235
3405
 
3236
3406
        .unix_listeners = { { &director_unix_listeners_buf,
3272
3442
        .type_offset = (size_t)-1,
3273
3443
        .struct_size = sizeof(struct director_settings),
3274
3444
 
3275
 
        .parent_offset = (size_t)-1
 
3445
        .parent_offset = (size_t)-1,
 
3446
 
 
3447
        .check_func = director_settings_verify
3276
3448
};
3277
3449
/* ../../src/dict/dict-settings.c */
3278
3450
/* <settings checks> */
3379
3551
/* <settings checks> */
3380
3552
static struct file_listener_settings auth_unix_listeners_array[] = {
3381
3553
        { "login/login", 0666, "", "" },
 
3554
        { "token-login/tokenlogin", 0666, "", "" },
3382
3555
        { "auth-login", 0600, "$default_internal_user", "" },
3383
3556
        { "auth-client", 0600, "", "" },
3384
3557
        { "auth-userdb", 0666, "$default_internal_user", "" },
3389
3562
        &auth_unix_listeners_array[1],
3390
3563
        &auth_unix_listeners_array[2],
3391
3564
        &auth_unix_listeners_array[3],
3392
 
        &auth_unix_listeners_array[4]
 
3565
        &auth_unix_listeners_array[4],
 
3566
        &auth_unix_listeners_array[5]
3393
3567
};
3394
3568
static buffer_t auth_unix_listeners_buf = {
3395
3569
        auth_unix_listeners, sizeof(auth_unix_listeners), { 0, }
3412
3586
                           const char **error_r)
3413
3587
{
3414
3588
        const char *const *tmp;
3415
 
        ARRAY_DEFINE(ips_array, struct ip_addr);
 
3589
        ARRAY(struct ip_addr) ips_array;
3416
3590
        struct ip_addr *ips;
3417
3591
        unsigned int ips_count;
3418
3592
        int ret;
3433
3607
                }
3434
3608
                array_append(&ips_array, ips, ips_count);
3435
3609
        }
3436
 
        (void)array_append_space(&ips_array);
 
3610
        array_append_zero(&ips_array);
3437
3611
        set->proxy_self_ips = array_idx(&ips_array, 0);
3438
3612
        return TRUE;
3439
3613
}
3495
3669
                *error_r = "passdb is missing driver";
3496
3670
                return FALSE;
3497
3671
        }
 
3672
        if (set->pass && strcmp(set->result_success, "return-ok") != 0) {
 
3673
                *error_r = "Obsolete pass=yes setting mixed with non-default result_success";
 
3674
                return FALSE;
 
3675
        }
3498
3676
        return TRUE;
3499
3677
}
3500
3678
 
3571
3749
        DEF(SET_STR, args),
3572
3750
        DEF(SET_STR, default_fields),
3573
3751
        DEF(SET_STR, override_fields),
 
3752
        DEF(SET_ENUM, skip),
 
3753
        DEF(SET_ENUM, result_success),
 
3754
        DEF(SET_ENUM, result_failure),
 
3755
        DEF(SET_ENUM, result_internalfail),
3574
3756
        DEF(SET_BOOL, deny),
3575
3757
        DEF(SET_BOOL, pass),
3576
3758
        DEF(SET_BOOL, master),
3582
3764
        .args = "",
3583
3765
        .default_fields = "",
3584
3766
        .override_fields = "",
 
3767
        .skip = "never:authenticated:unauthenticated",
 
3768
        .result_success = "return-ok:return:return-fail:continue:continue-ok:continue-fail",
 
3769
        .result_failure = "continue:return:return-ok:return-fail:continue-ok:continue-fail",
 
3770
        .result_internalfail = "continue:return:return-ok:return-fail:continue-ok:continue-fail",
3585
3771
        .deny = FALSE,
3586
3772
        .pass = FALSE,
3587
3773
        .master = FALSE
3653
3839
        DEF(SET_STR, winbind_helper_path),
3654
3840
        DEF(SET_STR, proxy_self),
3655
3841
        DEF(SET_TIME, failure_delay),
3656
 
        DEF(SET_UINT, first_valid_uid),
3657
 
        DEF(SET_UINT, last_valid_uid),
3658
3842
 
3659
3843
        DEF(SET_BOOL, verbose),
3660
3844
        DEF(SET_BOOL, debug),
3671
3855
 
3672
3856
        DEF_NOPREFIX(SET_STR, base_dir),
3673
3857
        DEF_NOPREFIX(SET_BOOL, verbose_proctitle),
 
3858
        DEF_NOPREFIX(SET_UINT, first_valid_uid),
 
3859
        DEF_NOPREFIX(SET_UINT, last_valid_uid),
3674
3860
 
3675
3861
        SETTING_DEFINE_LIST_END
3676
3862
};
3691
3877
        .winbind_helper_path = "/usr/bin/ntlm_auth",
3692
3878
        .proxy_self = "",
3693
3879
        .failure_delay = 2,
3694
 
        .first_valid_uid = 500,
3695
 
        .last_valid_uid = 0,
3696
3880
 
3697
3881
        .verbose = FALSE,
3698
3882
        .debug = FALSE,
3708
3892
        .userdbs = ARRAY_INIT,
3709
3893
 
3710
3894
        .base_dir = PKG_RUNDIR,
3711
 
        .verbose_proctitle = FALSE
 
3895
        .verbose_proctitle = FALSE,
 
3896
        .first_valid_uid = 500,
 
3897
        .last_valid_uid = 0,
3712
3898
};
3713
3899
const struct setting_parser_info auth_setting_parser_info = {
3714
3900
        .module_name = "auth",
3753
3939
        .process_limit = 1,
3754
3940
        .client_limit = 0,
3755
3941
        .service_count = 0,
3756
 
        .idle_kill = -1U,
 
3942
        .idle_kill = UINT_MAX,
3757
3943
        .vsz_limit = (uoff_t)-1,
3758
3944
 
3759
3945
        .unix_listeners = { { &anvil_unix_listeners_buf,
3779
3965
        &indexer_worker_service_settings,
3780
3966
        &indexer_service_settings,
3781
3967
        &imap_service_settings,
 
3968
        &imap_urlauth_worker_service_settings,
 
3969
        &imap_urlauth_service_settings,
 
3970
        &imap_urlauth_login_service_settings,
3782
3971
        &imap_login_service_settings,
3783
3972
        &doveadm_service_settings,
3784
3973
        &dns_client_service_settings,
3793
3982
        config_all_services, sizeof(config_all_services), { 0, }
3794
3983
};
3795
3984
const struct setting_parser_info *all_default_roots[] = {
 
3985
        &master_service_setting_parser_info,
 
3986
        &master_service_ssl_setting_parser_info,
3796
3987
        &dict_setting_parser_info, 
3797
3988
        &master_setting_parser_info, 
3798
3989
        &pop3_login_setting_parser_info, 
3799
3990
        &pop3_setting_parser_info, 
 
3991
        &imap_urlauth_login_setting_parser_info, 
3800
3992
        &replicator_setting_parser_info, 
3801
3993
        &lda_setting_parser_info, 
 
3994
        &imap_urlauth_setting_parser_info, 
3802
3995
        &aggregator_setting_parser_info, 
3803
3996
        &ssl_params_setting_parser_info, 
3804
3997
        &mdbox_setting_parser_info, 
3811
4004
        &imapc_setting_parser_info, 
3812
4005
        &maildir_setting_parser_info, 
3813
4006
        &lmtp_setting_parser_info, 
3814
 
        &master_service_setting_parser_info, 
 
4007
        &imap_urlauth_worker_setting_parser_info, 
3815
4008
        &login_setting_parser_info, 
3816
4009
        &auth_setting_parser_info, 
3817
4010
        &mbox_setting_parser_info,