Kevin McCarthy [Tue, 30 Oct 2018 18:53:37 +0000 (11:53 -0700)]
Add a flag for dynamic date range evaluation in patterns
By default, Mutt evaluates relative date patterns, such as "~d<1d"
against the date when the pattern is compiled.
For index-format-hook, we need to pattern match against a message
based on the current date/time, so that for example, conditional date
format patterns correctly match after Mutt has been open for many
days/weeks.
Add a flag, MUTT_PATTERN_DYNAMIC, that changes ~d and ~r evaluation to
reevaluate the min/max range with each match.
This will of course be slower, but for the index, where a screenful of
messages at a time are evaluated, is an acceptable tradeoff against
accurate pattern matching.
Pietro Cerutti [Wed, 17 Apr 2019 09:29:31 +0000 (09:29 +0000)]
Make buffer pool initialization lazy
This fixes an issue in the startup sequence where a buffer is requested
from the buffer pool before mutt_buffer_pool_init is called. The latter
doubles up the number of buffers even though there are free ones.
Richard Russon [Sun, 14 Apr 2019 14:30:23 +0000 (15:30 +0100)]
fix Mailbox->append,changed flags
Replying to an email caused some unwanted side-effects:
- Updating the Context left `m->changed == false`
- `mutt_write_fcc()` left `m->append == true`
Richard Russon [Tue, 2 Apr 2019 12:50:16 +0000 (12:50 +0000)]
fix trash_append()
Prevent a crash when reopening a Mailbox.
> How exactly do these changes prevent the crash from occurring?
It's all about how mx_mbox_open() handles flags. These four examples
are where we have a Mailbox open in 'normal' mode and try to open it
again in 'append' mode.
'Append' mode only makes sense for 'mbox' and 'compress', but the flag
affects mx_mbox_open(). It causes the function to create a duplicate
Mailbox, which is then used and discarded. The original Mailbox is now
out of sync.
The workaround, simply hides the flag for mx_mbox_open(), but
temporarily sets the internal bool append. This means that we work with
one Mailbox.
Richard Russon [Tue, 2 Apr 2019 12:47:27 +0000 (12:47 +0000)]
fix pop_fetch_mail()
Prevent a crash when reopening a Mailbox.
> How exactly do these changes prevent the crash from occurring?
It's all about how mx_mbox_open() handles flags. These four examples
are where we have a Mailbox open in 'normal' mode and try to open it
again in 'append' mode.
'Append' mode only makes sense for 'mbox' and 'compress', but the flag
affects mx_mbox_open(). It causes the function to create a duplicate
Mailbox, which is then used and discarded. The original Mailbox is now
out of sync.
The workaround, simply hides the flag for mx_mbox_open(), but
temporarily sets the internal bool append. This means that we work with
one Mailbox.
Richard Russon [Tue, 2 Apr 2019 12:39:06 +0000 (12:39 +0000)]
fix save_message()
Prevent a crash when reopening a Mailbox.
> How exactly do these changes prevent the crash from occurring?
It's all about how mx_mbox_open() handles flags. These four examples
are where we have a Mailbox open in 'normal' mode and try to open it
again in 'append' mode.
'Append' mode only makes sense for 'mbox' and 'compress', but the flag
affects mx_mbox_open(). It causes the function to create a duplicate
Mailbox, which is then used and discarded. The original Mailbox is now
out of sync.
The workaround, simply hides the flag for mx_mbox_open(), but
temporarily sets the internal bool append. This means that we work with
one Mailbox.
Richard Russon [Mon, 1 Apr 2019 14:09:14 +0000 (14:09 +0000)]
fix ev_message()
Prevent a crash when reopening a Mailbox.
> How exactly do these changes prevent the crash from occurring?
It's all about how mx_mbox_open() handles flags. These four examples
are where we have a Mailbox open in 'normal' mode and try to open it
again in 'append' mode.
'Append' mode only makes sense for 'mbox' and 'compress', but the flag
affects mx_mbox_open(). It causes the function to create a duplicate
Mailbox, which is then used and discarded. The original Mailbox is now
out of sync.
The workaround, simply hides the flag for mx_mbox_open(), but
temporarily sets the internal bool append. This means that we work with
one Mailbox.
Richard Russon [Tue, 9 Apr 2019 13:09:00 +0000 (14:09 +0100)]
merge: upstream changes
* browser.c: Convert LastDir and LastDirBackup to Buffer
* browser.c: Convert prefix to Buffer
* browser.c: Convert buf to Buffer
* browser.c: Convert other browser local variables to Buffer
* browser.c: Convert f parameter to Buffer
* Create mutt_buffer_mailbox() buffer function
* Change main() folder to be Buffer
Richard Russon [Tue, 9 Apr 2019 12:02:28 +0000 (13:02 +0100)]
merge: upstream changes
* Fix raw socket read/write to follow expected behavior
* Fix truncation of long filenames in attachments
* Add $include_encrypted config to prevent reply-decryption attack
* Use gpgme recipient strings for encryption when available
* Fix mailcap %{charset} expansion in send mode
* Check noconv for mailcap %{charset} send mode expansion
* Expand a couple of the comments about charset
* Add "Message Composition Flow" section to manual
* Minor buffer handling code cleanup
* Improve imap uid seqset hcache buffer usage
* Fix imap_pretty_mailbox() call to url_ciss_tostring()
* Add mutt_buffer_expand_path()
* Fixes to mutt_buffer_expand_path()
* Add mutt_buffer_strcpy_n()
* Add mutt_getcwd()
* Add documentation on thread tree characters and config vars
* Fail oauth quietly if it was not configured
* Change IMAP to try oauthbearer first
* Remove h->active hack in imap_sync_message_for_copy()
* Restore active flag in imap_fetch_message() on error
* Add a note about spam and the header cache in the manual
Kevin McCarthy [Fri, 29 Mar 2019 22:21:02 +0000 (15:21 -0700)]
Change IMAP to try oauthbearer first
$imap_authenticators says if it is unset, the authenticators from
most-secure to secure will be tried. It makes sense for oauthbearer
to come first, like with POP.
To make this change backwards compatible, it depends on the previous
commit, which changed imap_auth_oauth() to return IMAP_AUTH_UNAVAIL if
oauth is not configured or explictily requested.