From: Pierre Habouzit Date: Mon, 14 May 2007 13:36:30 +0000 (+0200) Subject: more setupts in cfg.lua X-Git-Url: http://git.madism.org/?a=commitdiff_plain;h=91acd32003fb8eb9b3b05b35c1aa32a6c07aad43;p=apps%2Fmadmutt.git more setupts in cfg.lua Signed-off-by: Pierre Habouzit --- diff --git a/crypt.cpkg b/crypt.cpkg index 1350166..819adae 100644 --- a/crypt.cpkg +++ b/crypt.cpkg @@ -98,6 +98,19 @@ ** to find out whether an encrypted message is also signed. ** (Crypto only) */ + bool smime_is_default = 0; + /* + ** .pp + ** The default behaviour of Madmutt is to use PGP on all auto-sign/encryption + ** operations. To override and to use OpenSSL instead this must be \fIset\fP. + ** .pp + ** However, this has no effect while replying, since Madmutt will automatically + ** select the same application that was used to sign/encrypt the original + ** message. + ** .pp + ** (Note that this variable can be overridden by unsetting $$crypt_autosmime.) + ** (S/MIME only) + */ quadopt_t verify_sig = M_YES; /* ** .pp @@ -106,6 +119,28 @@ ** If ``\fIno\fP'', never attempt to verify cryptographic signatures. ** (Crypto only) */ + + string_t pgp_entry_format = m_strdup("%4n %t%f %4l/0x%k %-4a %2c %u"); + /* + ** .pp + ** This variable allows you to customize the PGP key selection menu to + ** your personal taste. This string is similar to ``$$index_format'', but + ** has its own set of \fTprintf(3)\fP-like sequences: + ** .pp + ** .dl + ** .dt %n .dd number + ** .dt %k .dd key id + ** .dt %u .dd user id + ** .dt %a .dd algorithm + ** .dt %l .dd key length + ** .dt %f .dd flags + ** .dt %c .dd capabilities + ** .dt %t .dd trust/validity of the key-uid association + ** .dt %[] .dd date of the key where is an \fTstrftime(3)\fP expression + ** .de + ** .pp + ** (PGP only) + */ }; /* Values used for comparing addresses. */ @@ -2234,8 +2269,8 @@ static void crypt_entry (char *s, ssize_t l, MUTTMENU * menu, int num) entry.key = cryptkey_table[num]; entry.num = num + 1; - m_strformat(s, l, COLS - SW, PgpEntryFormat, crypt_entry_fmt, &entry, - option(OPTARROWCURSOR) ? M_FORMAT_ARROWCURSOR : 0); + m_strformat(s, l, COLS - SW, mod_crypt.pgp_entry_format, crypt_entry_fmt, + &entry, option(OPTARROWCURSOR) ? M_FORMAT_ARROWCURSOR : 0); } /* Compare two addresses and the keyid to be used for sorting. */ diff --git a/globals.h b/globals.h index 7e59c1e..22723ed 100644 --- a/globals.h +++ b/globals.h @@ -174,7 +174,6 @@ WHERE string_list_t *UserHeader INITVAL (0); /*-- formerly in pgp.h --*/ WHERE char *PgpSignAs; -WHERE char *PgpEntryFormat; /*-- formerly in smime.h --*/ WHERE char *SmimeDefaultKey; diff --git a/init.h b/init.h index a20f7e1..895bc0a 100644 --- a/init.h +++ b/init.h @@ -1503,40 +1503,6 @@ struct option_t MuttVars[] = { ** when you are at the end of a message and invoke the \fInext-page\fP ** function. */ - {"smime_is_default", DT_BOOL, R_NONE, OPTSMIMEISDEFAULT, "no" }, - /* - ** .pp - ** The default behaviour of Madmutt is to use PGP on all auto-sign/encryption - ** operations. To override and to use OpenSSL instead this must be \fIset\fP. - ** .pp - ** However, this has no effect while replying, since Madmutt will automatically - ** select the same application that was used to sign/encrypt the original - ** message. - ** .pp - ** (Note that this variable can be overridden by unsetting $$crypt_autosmime.) - ** (S/MIME only) - */ - {"pgp_entry_format", DT_STR, R_NONE, UL &PgpEntryFormat, "%4n %t%f %4l/0x%k %-4a %2c %u"}, - /* - ** .pp - ** This variable allows you to customize the PGP key selection menu to - ** your personal taste. This string is similar to ``$$index_format'', but - ** has its own set of \fTprintf(3)\fP-like sequences: - ** .pp - ** .dl - ** .dt %n .dd number - ** .dt %k .dd key id - ** .dt %u .dd user id - ** .dt %a .dd algorithm - ** .dt %l .dd key length - ** .dt %f .dd flags - ** .dt %c .dd capabilities - ** .dt %t .dd trust/validity of the key-uid association - ** .dt %[] .dd date of the key where is an \fTstrftime(3)\fP expression - ** .de - ** .pp - ** (PGP only) - */ {"pgp_retainable_sigs", DT_BOOL, R_NONE, OPTPGPRETAINABLESIG, "no" }, /* ** .pp diff --git a/lib-lua/lua-token.sh b/lib-lua/lua-token.sh index aac0da7..73c6594 100644 --- a/lib-lua/lua-token.sh +++ b/lib-lua/lua-token.sh @@ -144,6 +144,7 @@ exit 0 ## min_dh_prime_bits ## no ## operating_system +## pgp_entry_format ## quit ## record ## replyencrypt @@ -155,6 +156,7 @@ exit 0 ## shell ## shorthost ## signature +## smime_is_default ## spam_separator ## starttls ## sysconfdir diff --git a/mutt.h b/mutt.h index fca80e6..310c012 100644 --- a/mutt.h +++ b/mutt.h @@ -309,7 +309,6 @@ enum { /* PGP options */ - OPTSMIMEISDEFAULT, OPTPGPAUTODEC, OPTPGPRETAINABLESIG, OPTFORWDECRYPT, diff --git a/postpone.c b/postpone.c index 1145bf6..4e0f869 100644 --- a/postpone.c +++ b/postpone.c @@ -633,7 +633,7 @@ int mutt_prepare_template (FILE * fp, CONTEXT * ctx, HEADER * newhdr, /* Theoretically, both could be set. Take the one the user wants to set by default. */ if ((newhdr->security & APPLICATION_PGP) && (newhdr->security & APPLICATION_SMIME)) { - if (option (OPTSMIMEISDEFAULT)) + if (mod_crypt.smime_is_default) newhdr->security &= ~APPLICATION_PGP; else newhdr->security &= ~APPLICATION_SMIME; diff --git a/send.c b/send.c index 0d25bc1..e40d3da 100644 --- a/send.c +++ b/send.c @@ -1360,7 +1360,7 @@ int ci_send_message (int flags, /* send mode */ * for the decision. */ if (!(msg->security & (APPLICATION_SMIME | APPLICATION_PGP))) { - if (mod_crypt.autosmime && option(OPTSMIMEISDEFAULT)) + if (mod_crypt.autosmime && mod_crypt.smime_is_default) msg->security |= APPLICATION_SMIME; else if (mod_crypt.autopgp) msg->security |= APPLICATION_PGP;