]> code.citadel.org Git - citadel.git/blobdiff - citadel/commands.c
* Enable/disable encryption in client from command line and/or citadel.rc
[citadel.git] / citadel / commands.c
index 9c7883fc7c6af4f6661b823e3acde1c3d45c7b6e..c56bdd6ba9f622c40f57481824f9e63c60836fc6 100644 (file)
@@ -689,6 +689,7 @@ void load_command_set(void)
        rc_force_mail_prompts = 0;
        rc_ansi_color = 0;
        strcpy(rc_url_cmd, "");
+       rc_encrypt = RC_DEFAULT;
 
        /* now try to open the citadel.rc file */
 
@@ -715,6 +716,15 @@ void load_command_set(void)
                while ((strlen(buf) > 0) ? (isspace(buf[strlen(buf) - 1])) : 0)
                        buf[strlen(buf) - 1] = 0;
 
+               if (!strncasecmp(buf, "encrypt=", 8)) {
+                       if (!strcasecmp(&buf[8], "yes"))
+                               rc_encrypt = RC_YES;
+                       else if (!strcasecmp(&buf[8], "no"))
+                               rc_encrypt = RC_NO;
+                       else if (!strcasecmp(&buf[8], "default"))
+                               rc_encrypt = RC_DEFAULT;
+               }
+
                if (!strncasecmp(buf, "editor=", 7))
                        strcpy(editor_path, &buf[7]);