summaryrefslogtreecommitdiffstats
path: root/globals.h
AgeCommit message (Collapse)Author
2022-01-15Revert "Add $reply_prefix."Kevin McCarthy
This reverts commit 9c1ce59874ce1c8e97d0c5bd71847596dafb1d50. The change is controversial, and probably ill-advised. Thanks to everyone for the feedback.
2022-01-13Add $reply_prefix.Kevin McCarthy
Allow the user to modify the subject prefix used in a reply. Hopefully this would be used sparingly, but nothing prevented a user from manually modifying the prefix themselves before.
2021-06-17Add $pager_skip_quoted_context option.Rene Kita
Using <skip-quoted> the first unquoted line becomes the new top line displayed in the pager. This leaves the user with no context to know what the answer refers to. Add an option to keep some lines of context when using <skip-quoted>. With $pager_skip_quoted_context set to 5, <skip-quoted> will show at most 5 lines of the previous quote. If the previous quote is shorter than 5 lines the whole quote will be displayed. This option defaults to 0 to remain backwards compatible.
2021-01-17Add $message_id_format for customizing generated Message-IDs.Kevin McCarthy
Provide expandos for the new (2.0+) format and the old format. Add %r and %R to generate fixed size 4-char Base64 blocks from the pseudo-random generator, or from /dev/urandom. The format string allows external filters, for complete control.
2020-12-15Create $ssl_verify_host_override.Kevin McCarthy
This allows manually specifying the host name to verify a server certificate against. I'm not sure I like the idea, but since Mutt already allows turning hostname verification off, it's not any worse to leave it on but manually set the expected hostname in the certificate. Thanks to eudyptes-pachyrynchus for the merge request, which prompted me to take another look at the ticket.
2020-10-13Create $attach_save_dir.Kevin McCarthy
This will be used when saving attachments via mutt_save_attachment_list(). Try to create the directory if it doesn't exist. If we're unable to chdir or create the directory just continue on, using cwd.
2020-06-25Add tab-completion menu for patterns.Kevin McCarthy
This is based upon the patch from TAKAHASHI Tamotsu, maintained by Vincent Lefèvre. The push/pop menu operations take care of most redraw operations, so remove those from the patch. Change post-search to '|= REDRAW_MOTION' instead of assigning so it doesn't overwrite a full redraw. Add L10N for the new help strings. Add a format string and configuration variable for the menu. Add the multi-character thread patterns. Doing the above required some structural changes to the menu, so I rewrote it in a more common style used elsewhere in Mutt.
2020-04-03Add "root" disposition to attachments command.Kevin McCarthy
An initial inline part was previously always skipped, for the good reasons outlined by @dgc in #217. Unfortunately, some mail clients have started sending "attachments" as the root (and only) part, more and more lately. Although this may be bad practice, Mutt should support counting these as "attachments". To do so without breaking existing configs, add a "root" disposition argument to the attachments command. This will count an initial inline part in a message or multipart container. The existing code skipped counting for the "top-level" and recursive calls, so group both of these cases under "root".
2020-03-21Add $fcc_delimiter, to allow multiple Fcc mailboxes.Kevin McCarthy
The variable defaults unset, to prevent breaking anyone's configuration. If set to a value, such as ",", $record and fcc-hook may list multiple mailboxes separated by the delimiter. Mutt will tokenize and expand/prettify each separate mailbox. At Fcc time, it will loop through trying to save to each mailbox. This patch introduces a bit more uglyness into init.c, which has to special-process for $record in a few places. I don't like that, but I believe the feature is important enough to allow for the one-off behavior hack, because we are constrained by backwards compatibility. Add documentation notes about the resulting issues with '<' mailbox shortcut expansion, and with fcc-save-hook processing. It is recommended to use fcc-hook to set multiple mailboxes in those cases instead.
2020-02-29Add background compose menu and $background_format config var.Kevin McCarthy
List the backgrounded sessions. Allow the user to resume one, or exit the menu. Bind to 'B' by default in the index and pager menus. Remove the "<mail>" function autoresuming functionality, instead invoke the menu to resume backgrounded sessions.
2019-11-01Add ability to generate multipart/alternative using a filter script.Kevin McCarthy
Create config variables $send_multipart_alternative (a quadoption) and $send_multipart_alternative_filter. The filter script expects output to be the mime type, a blank line, then the content. Add ability to preview alternative from compose menu. <view-alt-text> forces viewing as text. <view-alt-mailcap> forces using the mailcap. Bind them to 'v' and 'V', respectively. Improve <resend-message> so a multipart/alternative is stripped out, which would just confuse the compose menu. Currently this preserves the first alternative. Allow alternative generation in batch mode, as long as the quadoption is set to 'yes'.
2019-08-03Basic autocrypt account menu.Kevin McCarthy
Provide ability to create, delete, and toggle the prefer-encrypt and enabled flag for an account. Hook into the index via 'A' <autocrypt-acct-menu>.
2019-08-03Autocrypt outgoing emails.Kevin McCarthy
Change crypt_get_keys() to query autocrypt. When oppenc_mode is set, we still query the original keyring regardless, because the compose menu can still run oppenc even if autocrypt is on. Since mutt_autocrypt_ui_recommendation() checks each key as part of making the recommendation, add a keylist parameter and use that function. Add gpgme changes to use the autocrypt context for encryption. Postpone work: * Change mutt_protect() to have a postpone parameter. Remove the manual toggling of the SIGN bit outside the call when postponing. * Since autocrypt doesn't set the SIGN bit, this allows us to turn off signing inside mutt_protect() for both normal and autocrypt mode. * Set the autocrypt postpone key in AutocryptDefaultKey. Write autocrypt and gossip headers in outgoing emails.
2019-08-03Add autocrypt config vars.Kevin McCarthy
2019-06-27Convert $header_cache_pagesize to type DT_LNUM.Kevin McCarthy
Prior to commit 4bc76c2f there was no LNUM type, and so the workaround was to store it as a string, converting in the hcache_open_gdbm() call. This will not affect the user interface or config file, because DT_NUM and DT_LNUM read in a string from the config file and convert to a number. Quotes are used for escaping style, not passed through to the variable setter. So essentially this simply moves the conversion to parse_set(), and provides feedback for a non-numeric type immediately.
2019-06-21Remove NULL and 0 INITVAL declarataions.Kevin McCarthy
The C standard says static storage duration variables will be initialized to NULL/0.
2019-04-22Add $imap_fetch_chunk_size to allow FETCHing new headers in chunks.Kevin McCarthy
For extremely large mailboxes, some implementations will time out just while fetching the new headers, because the client doesn't send any commands for 30 minutes while downloading the large number of headers. Rewrite imap_fetch_msn_seqset() to return chunks of size $imap_fetch_chunk_size. The change requires trusting the server will follow the RFC and not send an EXPUNGE during or between the FETCH chunks; otherwise we'll miss MSNs between the chunks because the shift. We could in theory continue to set "msn_begin = idata->max_msn + 1", but that makes the assumption there are no holes in the header cache that we are filling in during a chunk. Personally I am dubious about "header cache holes", but the IMAP code has explicitly mentioned and handled them since prior to my involvement. Since the RFC forbids the interleaving EXPUNGE I believe it's safe enough to set "msn_begin = fetch_msn_end + 1" until proven otherwise.
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.