# HG changeset patch # User Aki Tuomi # Date 1481292080 -7200 # Node ID e48ccffc781577d55cf4c3d50dfff79c938c2fb3 # Parent f677d31a8211c23a161e63382b21b27c496d4e52 mail-crypt: Treat empty values correctly If mail_crypt_curve or mail_crypt_save_version is left empty, disable the plugin. Don't error out. diff -r f677d31a8211 -r e48ccffc7815 src/plugins/mail-crypt/mail-crypt-plugin.c --- a/src/plugins/mail-crypt/mail-crypt-plugin.c Wed Dec 14 17:39:04 2016 +0200 +++ b/src/plugins/mail-crypt/mail-crypt-plugin.c Fri Dec 09 16:01:20 2016 +0200 @@ -392,7 +392,7 @@ const char *curve = mail_user_plugin_getenv(user, "mail_crypt_curve"); buffer_t *tmp = t_str_new(64); - if (curve == NULL) { + if (curve == NULL || *curve == '\0') { if (user->mail_debug) { i_debug("mail_crypt_plugin: mail_crypt_curve setting " "missing - generating EC keys disabled"); @@ -410,7 +410,7 @@ const char *version = mail_user_plugin_getenv(user, "mail_crypt_save_version"); - if (version == NULL) { + if (version == NULL || *version == '\0') { user->error = p_strdup_printf(user->pool, "mail_crypt_plugin: " "mail_crypt_save_version setting missing "