summaryrefslogtreecommitdiffstats
path: root/globals.h
AgeCommit message (Collapse)Author
2018-12-31Remove trailing whitespace.Kevin McCarthy
The result of find . -name "*.[ch]" -exec emacs -batch {} \ --eval="(progn (delete-trailing-whitespace) (and (buffer-modified-p) (save-buffer)))" \;
2018-12-29Color protected subject as a header in the pager.Kevin McCarthy
2018-12-25Add config and data structure for protected header write support.Kevin McCarthy
Add config vars $crypt_protected_headers_write (unset by default), and $crypt_protected_headers_subject. Store the protected headers during mime_protect().
2018-12-08Add $auto_subscribe variable.Kevin McCarthy
When set, it automatically subscribes to mailing lists found in List-Post headers. This commit is based on Michael Elkins's patch from the thread <https://marc.info/?l=mutt-users&m=127076105423565&w=2>. I've added an opt-in variable $auto_subscribe and a hash table cache to speed up reading headers when the variable is set.
2018-07-16Improve OAUTHBEARER support.Brandon Long
Move token refresh commands to their own config variables. Consolidate code for refreshing tokens and generating the SASL OAUTHBEARER argument in account.c. Add support for OAUTHBEARER to pop. Fix pop_auth_oauth() mutt_from_base64() call from 1.10.1 release.
2018-06-18Allow larger passphrase timeout valuesEike Rathke
This came up in the comp.mail.mutt newsgroup where a user wasn't satisfied with the SHORT_MAX seconds ~9 hours limit on passphrase timeouts. For the first time made it necessary for the options parser to be able to parse numbers as long values. Also, introduced mutt_add_timeout() to detect possible overflow before adding a timeout to a time_t value and truncate to TIME_T_MAX instead.
2018-04-22Add Error History function and config var.Kevin McCarthy
<error-history>, by default unbound, shows a list of the recent error messages displayed by Mutt via mutt_message() or mutt_error(). $error_history sets the size of the history ring. For now, I've decided to include mutt_message() messages too. If this is too chatty, we can restrict it to mutt_error() easily in the future.
2018-01-11Create pgp and s/mime default and sign_as key vars. (see #3983)Kevin McCarthy
The $postpone_encrypt and $(pgp/smime)_self_encrypt configuration variables have created a somewhat messier situation for users. Many of them now have to specify their keys across multiple configuration variables. (Trac) Ticket #3983 had a reasonable request: "if my encrypt and signing keys are the same, why can't I just specify my key once in my .muttrc?" The problem currently is that $smime_default_key and $pgp_sign_as are both used to specify signing keys, and are set by the "sign (a)s" security menu choice. So we can't store encryption keys there because some users have separate sign-only capability keys. Create $pgp_default_key to store the default encryption key. Change signing to use $pgp_default_key, unless overridden by $pgp_sign_as. The pgp "sign (a)s" will continue setting $pgp_sign_as. Create $smime_sign_as. Change signing to use $smime_default_key unless overridden by $smime_sign_as. Change s/mime "sign (a)s" menu to set $smime_sign_as instead. Change $postpone_encrypt and $(pgp/smime)_self_encrypt to use $(pgp/smime)_default_key by default. Mark $(pgp/smime)_self_encrypt_as deprecated. They are now aliases for the $(pgp/smime)_default_key config vars. Change $(pgp/smime)_self_encrypt default to set. The intent is that most users now need only set $(pgp/smime)_default_key. If they have a sign-only key, or have separate signing and encryption keys, they can put that in $(pgp/smime)_sign_as. This also enables to default self_encrypt on and solve a very common request. Thanks to Michele Marcionelli and Vincent Lefèvre for gently pushing me towards a solution.
2018-01-08NewMailCmd: optionally execute a command upon new mail arrivalYoshiki Vázquez Baeza
This setting allows to run any external program to e.g. produce a notification on the desktop when Mutt finds new mail. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
2017-08-19Add option to run command to query attachment mime type. (closes #2933) ↵Kevin McCarthy
(closes #3959) Add $mime_type_query_command to specify a command to run if the attachment extension is not in the mime.types file. Add $mime_type_query_first to allow the query command to be run before the mime.types lookup.
2017-07-22Add $imap_poll_timeout to allow mailbox polling to time out.Kevin McCarthy
Enable the polling flag for the NOOP in imap_check_mailbox(), the STATUS command in imap_buffy_check(), and the LOGOUT command. This is not intended to handle all blocking-IO related issues. However, the periodic NOOP and STATUS are the most frequent places for mutt to freeze up, especially after a laptop is sleep/woken. Since these are quick operations with little data, this is a good place to check if the connection is still working before hanging on a read.
2017-07-01Add config vars for forwarded message attribution intro/trailer.Kevin McCarthy
Add $forward_attribution_intro and $forward_attribution_trailer to allow the default strings to be overridden.
2017-05-29Add self-encrypt options for PGP and S/MIME.Kevin McCarthy
Add $pgp_self_encrypt, $pgp_self_encrypt_as, $smime_self_encrypt, $smime_self_encrypt_as. $pgp_sign_as and $smime_default_key are inappropriate to use, as they specify signing key/certs. In some cases, this is a different value than the encryption key/cert.
2017-03-31Remove SidebarNeedsRedraw.Kevin McCarthy
The menu stack can be used to flag a redraw of the sidebar window.
2017-01-28Improve the label completion hash table usage.Kevin McCarthy
Move the hash table inside the Context. Hook message arrival/deletion to update the label hash. Change the label hash to strdup keys. Use hash_find_elem when updating the counter, to reduce unnecessary add/delete operations.
2017-01-28Adds label completion.David Champion
A global label hash is added, to which labels are added as they're parsed from a mailbox file or edited manually by the user. Reference counts are kept in the hash table so that unused labels are removed from available completions. Completion is available in the label editor only, but it may be feasible to add for search expressions if the preceding text ends with '~y'.
2017-01-23Add subjectrx command to replace matching subjects with something else.David Champion
This lets you define regular expressions-replacement pairs for subject display. When a Subject: matches the regular expression, the replacement value will be displayed instead in the message index. Backreferences are supported. This is especially nice for simplifying subjects that are overly wordy, such as mailing list posts (with [Listname] tags, etc), mail from ticketing systems or bug trackers, etc. It lets you reduce clutter in your mutt display without altering the messages themselves.
2017-01-23Abstract the SPAM_LIST as a generic REPLACE_LISTDavid Champion
REPLACE_LIST can be used more generally as a list of pattern match-replace settings. SPAM_LIST was a special case of this, so spam handling has been been changed to use REPLACE_LIST instead, and SPAM_LIST was removed. A generic function for performing a REPLACE_LIST replacement has been added in mutt_apply_replace(). Commited by Kevin McCarthy with some buffer overflow fixes in mutt_apply_replace().
2016-12-27Make to_chars and status_chars accept mulitibyte characters. (closes #3024)Kevin McCarthy
Change Tochars and StChars to use the mbchars_table type introduced in the last commit.
2016-11-17Adds <mark-message> binding to create "hotkeys" for messages.David Champion
<mark-message>foo<enter> will create a new macro "'foo" which will return to the current message by searching for that message's message id. The initial character of the macro is defined by $mark_macro_prefix, and defaults to "'" for verisimilitude vs. vi. Pushed by Kevin McCarthy with a minor fix.
2016-08-22Add $attribution_locale configuration variable.Kevin McCarthy
$attribution_locale replaces the just removed $locale, but is only used for customizing the LC_TIME locale used for dates in $attribution. This could be useful in conjunction with folder or send-hooks for recipients in different locales.
2016-08-22Remove the $locale configuration variable.Kevin McCarthy
$locale was only used to set the LC_TIME locale. Unfortunately, Mutt previously defaulted to using "C". This overrode the user's locale setting and forced them to re-specify their locale inside their .muttrc. Remove $locale and instead use the locale specified by the environment. Mutt still allows "C locale" dates by using a leading "!" in $date_format, ${}, etc. Another use of $locale was to customize attribution dates using hooks. The next commit will introduce $attribution_locale, which can be used for this instead. Thanks to Derek Martin for the original patch!
2016-08-05Update copyright notices.Kevin McCarthy
2016-07-17Add the trash folder patch.Kevin McCarthy
This is based on the trash folder patch by Cedric Duval. Modifications to the original patch are: * Use a flag called M_PURGE instead of M_APPENDED. The same flag is then used in the following "purge" patch instead of adding a different flag. * Removed the counter in context. The existing context->deleted is all that's needed. * Removed the "auto unset M_PURGE" when M_DELETED is unset inside _mutt_set_flag(), although this is convenient, it easily leads to header->purge not being reset in a few situations. * Reset purge flag along with the deleted flag if $delete is answered no. * Set M_PURGE on an edited message. (edit_one_message()) * Preserve purge flag in mutt_reopen_mailbox() * Turn off OPTCONFIRMAPPEND when saving to the trash, rather than hardcoding it off in mutt_save_confirm(). That way, normal save to the folder will respect the option.
2016-06-07Make extended buffy independent of the sidebar.Kevin McCarthy
Add new boolean option $mail_check_stats (default off) and $mail_check_stats_interval. The first turns extended buffy on. The second sets the amount of time in between extended buffy checks (defaulting to 60 seconds). Remove the option $sidebar_refresh_time. Change mutt_buffy_check() to only notify the sidebar to redraw if a mailbox buffy value changes. Remove the #ifdefs around the extended buffy functions. The next patch will merge these functions with the basic functions and pass a parameter instead. Imap is a special case, because it sends out the status in one batch. Change this to perform the comparisons inside cmd_parse_status() and flag the sidebar there. It was previously directly assigning the status counters (unsigned int) to the buffy->new (short). Change this to assign 1/0.
2016-06-04Sidebar clean up: building and drawing logic.Kevin McCarthy
Fix the autoconf/makefile.am changes to be consistent. Create a global SidebarNeedsRedraw to indicate a redraw is needed, instead of putting sb_draw() everywhere in the code. Create a menu_redraw_sidebar() function and use the REDRAW_SIDEBAR flag instead of piggy-backing it inside the index loop. Fix curs_main.c and pager.c to be a bit cleaner by using the global and REDRAW_SIDEBAR. Start to clean up some of the buffy code, but this needs to refactored and fixed.
2016-06-04Add neomutt version of sidebar patch. (closes #3829)Richard Russon
This is the patch from neomutt; branch 'devel/win-sidebar'; commit c796fa85f9cacefb69b8f7d8545fc9ba71674180 with the following changes: - move the sample muttrc and vimrc to contrib. - remove the README.sidebar. - empty out the PATCHES file.
2016-03-10Restrict mailto header fields using mailto_allow.Michael Elkins
By default, only the body and subject fields are allowed. These can be changed with the mailto_allow and unmailto_allow commands.
2016-02-15Add $pgp_decryption_okay to verify multipart/encrypted are actually ↵Kevin McCarthy
encrypted. (closes #3770) In pgp classic mode, if the $pgp_decrypt_command generated output, it assumed the content was encrypted. However, gpg will generate output even if the block is simply signed and armored text. The problem is that mutt was then printing mime headers labelling the output as encrypted text in the ui. Add a new option, and suggested value of: set pgp_decryption_okay="^\\[GNUPG:\\] DECRYPTION_OKAY" If set, the output from the decrypt command will be scanned for this regexp to confirm an actual decryption occurred. Note that gpgme already correctly rejects this form of spoofed message.
2016-01-01Convert copyright years to all use 4 digit years.Kevin McCarthy
Vincent Lefèvre pointed out the common shortcut, e.g 1996-9, is actually not allowed for copyright years. Convert all the copyright years (for mutt files) to use 4 digits.
2015-11-30smime: allow signing message digest algorithm to be specified.Kevin McCarthy
Currently, Mutt hardcodes micalg=sha1 for signed messages. Unfortunately, the actual message digest algorithm used defaults to the value in the "Signature Algorithm" field in the signing key's certificate. Add a new configuration option $smime_sign_digest_alg, defaulting to sha256. Add a new printf format string, %d, to be used in the signing command to specify the digest algorithm. Modify the sample $smime_sign_command to include "-md %d". Note: This solution requires using the modified $smime_sign_command, or else the micalg parameter again may not match the algorithm used. An alternative solution would be to query the certificate "Signature Algorithm" field and try to change the micalg to match it, but this method is easier to implement and provides better control for the user to configure, in any case.
2015-05-03Provide SSL cipher selection option. (closes #3167)Kevin McCarthy
Creates a $ssl_ciphers option that allows direct selection of the ciphers for OpenSSL (via SSL_CTX_set_cipher_list) and GnuTLS (via gnutls_priority_set_direct). Thank you Sergio Gelato for the patch.
2013-11-06Add option to encrypt postponed messages. (closes #3665)Kevin McCarthy
This patch is based on Christian Brabandt's patch sent to mutt-users. Add two new configuration variables: $postpone_encrypt and $postpone_encrypt_as. When $postpone_encrypt is set and a message is marked for encryption, the message will be encrypted using the key specified in $postpone_encrypt_as before saving the message. In this patch, $postpone_encrypt_as must be specified. I experimented with passing safe_strdup( NONULL (PostponeEncryptAs)) when unspecified, but although gpg.conf has a default-key setting, I could not get it to work properly. (pgpclassic gave an error message and gpgme sefaulted.) Although not necessary, this patch turns off signing during encryption of the postponed message (and turns it back on before saving), since there is no need to sign the message yet.
2014-12-28Remove duplicate SmimeCryptAlg declaration in globals.hKevin McCarthy
Thank you Elias Diem for the patch.
2013-10-22Terminal status line support, based on the xterm title patch.David Champion
Christoph Berg took the xterm title patch from the mutt mailing list and maintained it for Debian: * Changes made: - 2007-01-27 myon: using %P caused a segfault, updated status.c to catch menu==NULL. - 2007-02-20 myon: make the note about the xterm_set_titles defaults a comment. - 2008-08-02 myon: move set_xterm_* prototypes into the proper header file (cleaner code, no functional change, evades conflict with sidebar patch) This update reworks the Debian version as generic support for tsl/fsl terminfo capability. It no longer depends on a static list of supported terminal types, although it will use default support for these terminal types *if* they do not advertise tsl/fsl or XT in terminfo. The generic terminal status line can be implemented in any fashion, and on hardware terminals it can be a special out-of-screen region of the display. Most modern terminal emulators appear to emulate the status line in the window title; thus the notion of the tsl escape as an xterm window title escape. Configuration variables have been renamed: $ts_status_format format string (using $status_format codes) for the terminal status line $ts_icon_format format string (using $status_format codes) for the xterm icon name $ts_enabled toggle for whether to issue status updates The old configuration names exist as synonyms. Logic flow: * If tsl (string) is set in terminfo, mutt will use that escape to switch to the status area, and will use fsl to switch back to the regular display area. * Otherwise, if XT (boolean) is set in terminfo, mutt will use the standard xterm-compatible escapes. * Otherwise, if $TERM matches a known terminal type, mutt will use the standard xterm-compatible escapes. * Otherwise, this feature is disabled. = NOTE = The XTerm icon escape sequence is not formalized in terminfo, so the egregious kludge of hardcoding the escape is necessary in this case. However, some terminal emulators (e.g. MacOS X Terminal.app) will set the status line (window title) when the icon sequence is received. Since there is no way to detect this behavior, the only solution is to write your configuration to take it into account. Rather than add a variable to control icon escapes separately, we just provide the advice: if you use such a terminal, you may wish to set ts_icon_format to an empty string. This will cause it not to be used.
2011-12-03Declare many structures const (closes #3552)Dan Fandrich
Many structs used in mutt are actually constant but are defined without the 'const' keyword. This can slow initialization (slightly) in some environments due to extra copying and increases the amount of writable RAM required at run-time, which can be significant on non-MMU systems. Using const can also increase the opportunities for compiler optimization. The attached patch marks many such structures as const. On my test x86 build, this reduces the size of .data by over 50%.
2010-09-29Add $reflow_text boolean, and $reflow_wrap variables to control display of ↵Michael Elkins
format=flowed text parts.
2009-07-07Add $wrap_headers. Closes #3135Rocco Rutte
2009-06-03Don't abuse $pager_context for searches, add $search_context. See #976.Rocco Rutte
2009-01-02Add support for intermediate certificates to openssl code.TAKAHASHI Tamotsu
Gnutls support is not included in this patch.
2008-09-17sorting efficiencyThomas Roessler
2008-08-25Introduce $imap_pipeline_depth.Brendan Cully
This lets users control the number of commands that mutt will queue up before sending them to the server. Setting this to 0 disables pipelining, which should close #2892.
2008-06-28Basic support for $ssl_client_cert when compiled with gnutls.Brendan Cully
The key must not be encrypted. Closes #2911.
2008-01-15Make formatting of query menu configurable via $query_format (closes #170).Rocco Rutte
2007-11-08Add $time_inc to control progress update frequency.Brendan Cully
I found 250ms to be noticeably different from the old behaviour, and it ruins the rounding of the other _inc variables.
2007-04-11Add $smtp_pass (closes #2116)Brendan Cully
2007-04-05Remove broken namespace supportBrendan Cully
2007-03-21Back out $umask.Brendan Cully
2007-03-02Add $umask for mailboxes and attachments.Brendan Cully
init.c could really use some refactoring.
2007-03-03Add $wrap, which supersedes $wrapmargin.Brendan Cully
When set to a positive number, wrap at that column. When set to a negative number, keep that many characters empty on the right.