bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch/* Copyright (c) 2011-2018 Dovecot authors, see the included COPYING file */
c5d6b453eccc0962eae967abc10e028a740e1256Timo Sirainen { type, #name, offsetof(struct imapc_settings, name), NULL }
c5d6b453eccc0962eae967abc10e028a740e1256Timo Sirainenstatic bool imapc_settings_check(void *_set, pool_t pool, const char **error_r);
c5d6b453eccc0962eae967abc10e028a740e1256Timo Sirainenstatic const struct setting_define imapc_setting_defines[] = {
efd4de737ee4febffced006511f357959234a6caTimo Sirainen DEF(SET_TIME_MSECS, imapc_connection_retry_interval),
c5d6b453eccc0962eae967abc10e028a740e1256Timo Sirainenstatic const struct imapc_settings imapc_default_settings = {
c5d6b453eccc0962eae967abc10e028a740e1256Timo Sirainenstatic const struct setting_parser_info imapc_setting_parser_info = {
c5d6b453eccc0962eae967abc10e028a740e1256Timo Sirainenconst struct setting_parser_info *imapc_get_setting_parser_info(void)
c5d6b453eccc0962eae967abc10e028a740e1256Timo Sirainen/* <settings checks> */
adcb46fe2c6d1139dfbd8ab08a8fbe96e53f8fd6Timo Sirainenstatic const struct imapc_feature_list imapc_feature_list[] = {
b8eb60a9ba83e2f3f6d969e810553eb937be2128Timo Sirainen { "fetch-headers", IMAPC_FEATURE_FETCH_HEADERS },
f424c157faae226f153578442fab1512275889fcTimo Sirainen { "gmail-migration", IMAPC_FEATURE_GMAIL_MIGRATION },
eb1365e61674c54c7c453143356a891fb2e2b3d6Timo Sirainen { "zimbra-workarounds", IMAPC_FEATURE_ZIMBRA_WORKAROUNDS },
53841bd6c67a24b60b64cec41b72eb8b474cfbc7Timo Sirainen { "fetch-msn-workarounds", IMAPC_FEATURE_FETCH_MSN_WORKAROUNDS },
2ddc5efd47452644be369fa86e978cc05a508217Timo Sirainen { "fetch-fix-broken-mails", IMAPC_FEATURE_FETCH_FIX_BROKEN_MAILS },
e1005f8bf9190e1778010032dbd20c64acb53610Timo Sirainen { "fetch-bodystructure", IMAPC_FEATURE_FETCH_BODYSTRUCTURE },
e01ebd51ac369430ec81945e3c5317d6d6244138Timo Sirainen { "fetch-empty-is-expunged", IMAPC_FEATURE_FETCH_EMPTY_IS_EXPUNGED },
7484b1b01bee9b767f8b67396e1f4af4b0ea1dd3Timo Sirainen { "no-msn-updates", IMAPC_FEATURE_NO_MSN_UPDATES },
de26c21cfadf24c1fa59f06414854d58b3d8baadTimo Sirainenimapc_settings_parse_throttle(struct imapc_settings *set,
de26c21cfadf24c1fa59f06414854d58b3d8baadTimo Sirainen const char *throttle_str, const char **error_r)
de26c21cfadf24c1fa59f06414854d58b3d8baadTimo Sirainen str_to_uint(tmp[0], &set->throttle_init_msecs) < 0 ||
de26c21cfadf24c1fa59f06414854d58b3d8baadTimo Sirainen str_to_uint(tmp[1], &set->throttle_max_msecs) < 0 ||
de26c21cfadf24c1fa59f06414854d58b3d8baadTimo Sirainen str_to_uint(tmp[2], &set->throttle_shrink_min_msecs) < 0) {
de26c21cfadf24c1fa59f06414854d58b3d8baadTimo Sirainen *error_r = "imapc_features: Invalid throttle settings";
adcb46fe2c6d1139dfbd8ab08a8fbe96e53f8fd6Timo Sirainenimapc_settings_parse_features(struct imapc_settings *set,
adcb46fe2c6d1139dfbd8ab08a8fbe96e53f8fd6Timo Sirainen const char **error_r)
adcb46fe2c6d1139dfbd8ab08a8fbe96e53f8fd6Timo Sirainen str = t_strsplit_spaces(set->imapc_features, " ,");
de26c21cfadf24c1fa59f06414854d58b3d8baadTimo Sirainen if (imapc_settings_parse_throttle(set, *str + 9, error_r) < 0)
c5d6b453eccc0962eae967abc10e028a740e1256Timo Sirainenstatic bool imapc_settings_check(void *_set, pool_t pool ATTR_UNUSED,
c5d6b453eccc0962eae967abc10e028a740e1256Timo Sirainen const char **error_r)
bf5a238894b81b0719c60d6a9fdb66aafd5171dbTimo Sirainen *error_r = "imapc_max_idle_time must not be 0";