+int pgp_send_menu (HEADER *msg, int *redraw)
+{
+ pgp_key_t p;
+ char input_signas[SHORT_STRING];
+
+ char prompt[LONG_STRING];
+
+ if (!(WithCrypto & APPLICATION_PGP))
+ return msg->security;
+
+ /* If autoinline and no crypto options set, then set inline. */
+ if (option (OPTPGPAUTOINLINE) &&
+ !((msg->security & APPLICATION_PGP) && (msg->security & (SIGN|ENCRYPT))))
+ msg->security |= INLINE;
+
+ snprintf (prompt, sizeof (prompt),
+ _("PGP (e)ncrypt, (s)ign, sign (a)s, (b)oth, %s, or (c)lear? "),
+ (msg->security & INLINE) ? _("PGP/M(i)ME") : _("(i)nline"));
+
+ switch (mutt_multi_choice (prompt, _("esabifc")))
+ {
+ case 1: /* (e)ncrypt */
+ msg->security |= ENCRYPT;
+ msg->security &= ~SIGN;
+ break;
+
+ case 2: /* (s)ign */
+ msg->security |= SIGN;
+ msg->security &= ~ENCRYPT;
+ break;
+
+ case 3: /* sign (a)s */
+ unset_option(OPTPGPCHECKTRUST);
+
+ if ((p = pgp_ask_for_key (_("Sign as: "), NULL, KEYFLAG_CANSIGN, PGP_PUBRING)))
+ {
+ snprintf (input_signas, sizeof (input_signas), "0x%s",
+ pgp_keyid (p));
+ mutt_str_replace (&PgpSignAs, input_signas);
+ pgp_free_key (&p);
+
+ msg->security |= SIGN;
+
+ crypt_pgp_void_passphrase (); /* probably need a different passphrase */
+ }
+#if 0
+ else
+ {
+ msg->security &= ~SIGN;
+ }
+#endif
+
+ *redraw = REDRAW_FULL;
+ break;
+
+ case 4: /* (b)oth */
+ msg->security |= (ENCRYPT | SIGN);
+ break;
+
+ case 5: /* (i)nline */
+ if ((msg->security & (ENCRYPT | SIGN)))
+ msg->security ^= INLINE;
+ else
+ msg->security &= ~INLINE;
+ break;
+
+ case 6: /* (f)orget it */
+ case 7: /* (c)lear */
+ msg->security = 0;
+ break;
+ }
+
+ if (msg->security)
+ {
+ if (! (msg->security & (ENCRYPT | SIGN)))
+ msg->security = 0;
+ else
+ msg->security |= APPLICATION_PGP;
+ }
+
+ return (msg->security);
+}
+
+