+int smime_send_menu (HEADER * msg, int *redraw)
+{
+ char *p;
+
+ if (!(WithCrypto & APPLICATION_SMIME))
+ return msg->security;
+
+ switch (mutt_multi_choice
+ (_
+ ("S/MIME (e)ncrypt, (s)ign, encrypt (w)ith, sign (a)s, (b)oth, or (c)lear? "),
+ _("eswabfc"))) {
+ case 1: /* (e)ncrypt */
+ msg->security |= ENCRYPT;
+ msg->security &= ~SIGN;
+ break;
+
+ case 3: /* encrypt (w)ith */
+ msg->security |= ENCRYPT;
+ switch (mutt_multi_choice (_("1: DES, 2: Triple-DES, 3: RC2-40,"
+ " 4: RC2-64, 5: RC2-128, or (f)orget it? "),
+ _("12345f"))) {
+ case 1:
+ str_replace (&SmimeCryptAlg, "des");
+ break;
+ case 2:
+ str_replace (&SmimeCryptAlg, "des3");
+ break;
+ case 3:
+ str_replace (&SmimeCryptAlg, "rc2-40");
+ break;
+ case 4:
+ str_replace (&SmimeCryptAlg, "rc2-64");
+ break;
+ case 5:
+ str_replace (&SmimeCryptAlg, "rc2-128");
+ break;
+ case 6: /* forget it */
+ break;
+ }
+ break;
+
+ case 2: /* (s)ign */
+
+ if (!SmimeDefaultKey)
+ mutt_message (_("Can't sign: No key specified. Use Sign As."));
+
+ else {
+ msg->security |= SIGN;
+ msg->security &= ~ENCRYPT;
+ }
+ break;
+
+ case 4: /* sign (a)s */
+
+ if ((p = smime_ask_for_key (_("Sign as: "), NULL, 0))) {
+ p[str_len (p) - 1] = '\0';
+ str_replace (&SmimeDefaultKey, p);
+
+ msg->security |= SIGN;
+
+ /* probably need a different passphrase */
+ crypt_smime_void_passphrase ();
+ }
+#if 0
+ else
+ msg->security &= ~SIGN;
+#endif
+
+ *redraw = REDRAW_FULL;
+ break;
+
+ case 5: /* (b)oth */
+ msg->security |= (ENCRYPT | SIGN);
+ break;
+
+ case 6: /* (f)orget it */
+ case 7: /* (c)lear */
+ msg->security = 0;
+ break;
+ }
+
+ if (msg->security && msg->security != APPLICATION_SMIME)
+ msg->security |= APPLICATION_SMIME;
+ else
+ msg->security = 0;
+
+ return (msg->security);