#define MUTT_SET_UNSET (1<<1) /* default is to unset all vars */
#define MUTT_SET_RESET (1<<2) /* default is to reset all vars to default */
-/* forced redraw/resort types */
+/* forced redraw/resort types + other flags */
#define R_NONE 0
#define R_INDEX (1<<0)
#define R_PAGER (1<<1)
#define R_BOTH (R_INDEX | R_PAGER)
#define R_RESORT_BOTH (R_RESORT | R_RESORT_SUB)
+/* general flags, to be OR'd with the R_ flags above (so keep shifting..) */
+#define F_SENSITIVE (1<<8)
+
+#define IS_SENSITIVE(x) (((x).flags & F_SENSITIVE) == F_SENSITIVE)
+
struct option_t
{
char *option;
** only subscribed folders or all folders. This can be toggled in the
** IMAP browser with the \fC<toggle-subscribed>\fP function.
*/
- { "imap_login", DT_STR, R_NONE, UL &ImapLogin, UL 0 },
+ { "imap_login", DT_STR, R_NONE|F_SENSITIVE, UL &ImapLogin, UL 0 },
/*
** .pp
** Your login name on the IMAP server.
** .pp
** This variable defaults to the value of $$imap_user.
*/
- { "imap_pass", DT_STR, R_NONE, UL &ImapPass, UL 0 },
+ { "imap_pass", DT_STR, R_NONE|F_SENSITIVE, UL &ImapPass, UL 0 },
/*
** .pp
** Specifies the password for your IMAP account. If \fIunset\fP, Mutt will
** server which are out of the users' hands, you may wish to suppress
** them at some point.
*/
- { "imap_user", DT_STR, R_NONE, UL &ImapUser, UL 0 },
+ { "imap_user", DT_STR, R_NONE|F_SENSITIVE, UL &ImapUser, UL 0 },
/*
** .pp
** The name of the user whose mail you intend to access on the IMAP
** must be loaded when newsgroup is added to list (first time list
** loading or new newsgroup adding).
*/
- { "nntp_user", DT_STR, R_NONE, UL &NntpUser, UL "" },
+ { "nntp_user", DT_STR, R_NONE|F_SENSITIVE, UL &NntpUser, UL "" },
/*
** .pp
** Your login name on the NNTP server. If \fIunset\fP and NNTP server requires
** authentication, Mutt will prompt you for your account name when you
** connect to news server.
*/
- { "nntp_pass", DT_STR, R_NONE, UL &NntpPass, UL "" },
+ { "nntp_pass", DT_STR, R_NONE|F_SENSITIVE, UL &NntpPass, UL "" },
/*
** .pp
** Your password for NNTP account.
** for retrieving only unread messages from the POP server when using
** the \fC$<fetch-mail>\fP function.
*/
- { "pop_pass", DT_STR, R_NONE, UL &PopPass, UL "" },
+ { "pop_pass", DT_STR, R_NONE|F_SENSITIVE, UL &PopPass, UL "" },
/*
** .pp
** Specifies the password for your POP account. If \fIunset\fP, Mutt will
** Controls whether or not Mutt will try to reconnect to the POP server if
** the connection is lost.
*/
- { "pop_user", DT_STR, R_NONE, UL &PopUser, 0 },
+ { "pop_user", DT_STR, R_NONE|F_SENSITIVE, UL &PopUser, 0 },
/*
** .pp
** Your login name on the POP server.
** .te
*/
# endif /* USE_SASL */
- { "smtp_pass", DT_STR, R_NONE, UL &SmtpPass, UL 0 },
+ { "smtp_pass", DT_STR, R_NONE|F_SENSITIVE, UL &SmtpPass, UL 0 },
/*
** .pp
** Specifies the password for your SMTP account. If \fIunset\fP, Mutt will
** fairly secure machine, because the superuser can read your muttrc even
** if you are the only one who can read the file.
*/
- { "smtp_url", DT_STR, R_NONE, UL &SmtpUrl, UL 0 },
+ { "smtp_url", DT_STR, R_NONE|F_SENSITIVE, UL &SmtpUrl, UL 0 },
/*
** .pp
** Defines the SMTP smarthost where sent messages should relayed for
mutt [<options>] -p\n\
mutt [<options>] -A <alias> [...]\n\
mutt [<options>] -Q <query> [...]\n\
- mutt [<options>] -D\n\
+ mutt [<options>] -D [-S]\n\
mutt -v[v]\n");
puts _("\
\t\tthe list of files must be terminated with the \"--\" sequence\n\
-b <address>\tspecify a blind carbon-copy (BCC) address\n\
-c <address>\tspecify a carbon-copy (CC) address\n\
- -D\t\tprint the value of all variables to stdout");
+ -D\t\tprint the value of all variables to stdout\n\
+ -D -S\t\tlike -D, but hide the value of sensitive variables");
#if DEBUG
puts _(" -d <level>\tlog debugging output to ~/.muttdebug0");
#endif
int i;
int explicit_folder = 0;
int dump_variables = 0;
+ int hide_sensitive = 0;
int edit_infile = 0;
extern char *optarg;
extern int optind;
}
#ifdef USE_NNTP
- if ((i = getopt (argc, argv, "+A:a:b:F:f:c:Dd:Ee:g:GH:s:i:hm:npQ:RvxyzZ")) != EOF)
+ if ((i = getopt (argc, argv, "+A:a:b:F:f:c:Dd:Ee:g:GH:s:i:hm:npQ:RSvxyzZ")) != EOF)
#else
- if ((i = getopt (argc, argv, "+A:a:b:F:f:c:Dd:Ee:H:s:i:hm:npQ:RvxyzZ")) != EOF)
+ if ((i = getopt (argc, argv, "+A:a:b:F:f:c:Dd:Ee:H:s:i:hm:npQ:RSvxyzZ")) != EOF)
#endif
switch (i)
{
flags |= MUTT_RO; /* read-only mode */
break;
+ case 'S':
+ hide_sensitive = 1;
+ break;
+
case 's':
subject = optarg;
break;
return mutt_query_variables (queries);
}
if (dump_variables)
- return mutt_dump_variables();
+ return mutt_dump_variables(hide_sensitive);
if (alias_queries)
{