]> granicus.if.org Git - neomutt/log
neomutt
5 years agokeybindings: restore nntp change-newsgroup keybindings
Naveen Nathan [Thu, 25 Apr 2019 13:38:25 +0000 (23:38 +1000)]
keybindings: restore nntp change-newsgroup keybindings

This restores a subset of the keybindings found in the original vvv.nntp
patch that don't clash with any of neomutt defaults.

Specifically:
  i to change-newsgroup
  ESC-i to change-newsgroup-readonly

5 years agoAdd RECURSIVEMATCH LIST-EXTENDED selection option to query
Kevin McCarthy [Wed, 24 Apr 2019 02:06:11 +0000 (19:06 -0700)]
Add RECURSIVEMATCH LIST-EXTENDED selection option to query

LSUB is required to include mailboxes with subscribed children, but
the just added "LIST (SUBSCRIBED)" by default does not do that.

To match previous behavior, add RECURSIVEMATCH to make sure the
children are included.  Fix the parser to trim off the CHILDINFO
suffix in the response.

Parse \NonExistent LIST attribute the same as \NoSelect.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoImprove hierarchy information accuracy in IMAP browser
Naveen Nathan [Tue, 23 Apr 2019 17:04:05 +0000 (03:04 +1000)]
Improve hierarchy information accuracy in IMAP browser

Currently the IMAP browser relies on LIST and LSUB (for listing subscribed
folders) which may not provide the required hierarchy information.

RFC3348 section 3 goes as far as stating that a client mustn't rely on LSUB
for hierarchy information.

This patch implements the LIST command extensions specified in RFC5258
requiring that a server must respond with hierarchy information for
listed folders (whether or not filtering on subscribed folders).

5 years agomerge: add string tests
Richard Russon [Thu, 25 Apr 2019 09:40:02 +0000 (10:40 +0100)]
merge: add string tests

 * test,tidy: mutt_str_sysexit()
 * test,tidy: mutt_str_atos()
 * test,tidy: mutt_str_atoi()
 * test,tidy: mutt_str_atol()
 * test,tidy: mutt_str_atoui()
 * test,tidy: mutt_str_atoul()
 * test,tidy: mutt_str_atoull()

5 years agotidy: mutt_str_atoull() 1677/head
Richard Russon [Tue, 23 Apr 2019 00:45:38 +0000 (01:45 +0100)]
tidy: mutt_str_atoull()

5 years agotest: mutt_str_atoull()
Richard Russon [Wed, 24 Apr 2019 19:42:17 +0000 (20:42 +0100)]
test: mutt_str_atoull()

5 years agotidy: mutt_str_atoul()
Richard Russon [Wed, 24 Apr 2019 18:22:01 +0000 (19:22 +0100)]
tidy: mutt_str_atoul()

5 years agotest: mutt_str_atoul()
Richard Russon [Wed, 24 Apr 2019 18:37:23 +0000 (19:37 +0100)]
test: mutt_str_atoul()

5 years agotidy: mutt_str_atoui()
Richard Russon [Wed, 24 Apr 2019 18:20:41 +0000 (19:20 +0100)]
tidy: mutt_str_atoui()

5 years agotest: mutt_str_atoui()
Richard Russon [Wed, 24 Apr 2019 14:56:48 +0000 (15:56 +0100)]
test: mutt_str_atoui()

5 years agotidy: mutt_str_atol()
Richard Russon [Wed, 24 Apr 2019 15:23:34 +0000 (16:23 +0100)]
tidy: mutt_str_atol()

5 years agotest: mutt_str_atol()
Richard Russon [Wed, 24 Apr 2019 14:26:04 +0000 (15:26 +0100)]
test: mutt_str_atol()

5 years agotidy: mutt_str_atoi()
Richard Russon [Mon, 22 Apr 2019 23:55:05 +0000 (00:55 +0100)]
tidy: mutt_str_atoi()

5 years agotest: mutt_str_atoi()
Richard Russon [Tue, 23 Apr 2019 01:26:55 +0000 (02:26 +0100)]
test: mutt_str_atoi()

5 years agotidy: mutt_str_atos()
Richard Russon [Mon, 22 Apr 2019 23:05:49 +0000 (00:05 +0100)]
tidy: mutt_str_atos()

5 years agotest: mutt_str_atos()
Richard Russon [Mon, 22 Apr 2019 23:05:39 +0000 (00:05 +0100)]
test: mutt_str_atos()

5 years agotidy: mutt_str_sysexit()
Richard Russon [Mon, 22 Apr 2019 23:36:58 +0000 (00:36 +0100)]
tidy: mutt_str_sysexit()

5 years agotest: mutt_str_sysexit()
Richard Russon [Mon, 22 Apr 2019 23:32:24 +0000 (00:32 +0100)]
test: mutt_str_sysexit()

5 years agoimap: fixing race when syncing mailbox
Mehdi Abaakouk [Wed, 24 Apr 2019 14:34:35 +0000 (16:34 +0200)]
imap: fixing race when syncing mailbox

imap_check_mailbox return an detailled state not only 0/-1.

imap_sync_mailbox assumes that the function was returning only 0/-1.

This change fixes that.

5 years agobrowser: show "Subscribed" in IMAP browser
Naveen Nathan [Wed, 24 Apr 2019 02:28:44 +0000 (12:28 +1000)]
browser: show "Subscribed" in IMAP browser

5 years agomerge: light tidying
Richard Russon [Wed, 24 Apr 2019 12:14:59 +0000 (13:14 +0100)]
merge: light tidying

 * clang-format
 * refactor mutt_str_append_item()
 * boolify retval of mutt_path_to_absolute()
 * boolify mutt_date_make_time()
 * boolify pattern functions
 * boolify patmatch()
 * flags: clear up HookFlags usage
 * pattern: create typedef for parse functions
 * tidy: add {}s

5 years agotidy: add {}s
Richard Russon [Mon, 22 Apr 2019 17:21:18 +0000 (18:21 +0100)]
tidy: add {}s

5 years agopattern: create typedef for parse functions
Richard Russon [Mon, 22 Apr 2019 00:18:15 +0000 (01:18 +0100)]
pattern: create typedef for parse functions

5 years agoflags: clear up HookFlags usage
Richard Russon [Sun, 21 Apr 2019 23:40:14 +0000 (00:40 +0100)]
flags: clear up HookFlags usage

5 years agoboolify patmatch()
Richard Russon [Sun, 21 Apr 2019 21:08:15 +0000 (22:08 +0100)]
boolify patmatch()

5 years agoboolify pattern functions
Richard Russon [Sun, 21 Apr 2019 21:08:05 +0000 (22:08 +0100)]
boolify pattern functions

5 years agoboolify mutt_date_make_time()
Richard Russon [Sun, 21 Apr 2019 18:15:44 +0000 (19:15 +0100)]
boolify mutt_date_make_time()

5 years agoboolify retval of mutt_path_to_absolute()
Richard Russon [Sat, 20 Apr 2019 01:34:13 +0000 (02:34 +0100)]
boolify retval of mutt_path_to_absolute()

5 years agorefactor mutt_str_append_item()
Richard Russon [Sat, 20 Apr 2019 01:43:54 +0000 (02:43 +0100)]
refactor mutt_str_append_item()

5 years agoclang-format
Richard Russon [Sun, 21 Apr 2019 23:17:00 +0000 (00:17 +0100)]
clang-format

5 years agomerge: upstream add index-format-hook
Richard Russon [Wed, 24 Apr 2019 11:23:03 +0000 (12:23 +0100)]
merge: upstream add index-format-hook

 * Add index-format-hook and expando
 * Add a flag for dynamic date range evaluation in patterns
 * Update the neomuttrc man page with added commands

5 years agoUpdate the neomuttrc man page with added commands 1665/head
Kevin McCarthy [Sat, 19 Jan 2019 04:46:07 +0000 (20:46 -0800)]
Update the neomuttrc man page with added commands

Add the "color compose", index-format-hook, and echo commands.

Add the HMS relative date units.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoAdd a flag for dynamic date range evaluation in patterns
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.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoAdd index-format-hook and expando
Kevin McCarthy [Mon, 29 Oct 2018 20:45:02 +0000 (13:45 -0700)]
Add index-format-hook and expando

index-format-hook is used to allow dynamic insertion/evaluation of
format strings into $index_format.

It can be used, for example, to implement date formatting based on the
age of the message.

Add a new %@name@ expando to $index_format, which evaluates the
matching index-format-hooks with "name".

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agomerge: improve test coverage
Richard Russon [Wed, 24 Apr 2019 11:19:00 +0000 (12:19 +0100)]
merge: improve test coverage

 * tests: add copyright blocks
 * coverage: show stats
 * test: templates for path functions
 * test: add path tests for degenerate cases
 * libmutt: fix path code for degenerate cases
 * test: merge existing path tests
 * config: don't exclude testable cases
 * test: add coverage of config dump functions
 * test: 100% config coverage

5 years agotest: 100% config coverage 1662/head
Richard Russon [Wed, 17 Apr 2019 02:21:16 +0000 (03:21 +0100)]
test: 100% config coverage

5 years agotest: add coverage of config dump functions
Richard Russon [Fri, 19 Apr 2019 16:49:29 +0000 (17:49 +0100)]
test: add coverage of config dump functions

5 years agoconfig: don't exclude testable cases
Richard Russon [Fri, 19 Apr 2019 14:11:59 +0000 (15:11 +0100)]
config: don't exclude testable cases

5 years agotest: merge existing path tests
Richard Russon [Fri, 19 Apr 2019 08:31:42 +0000 (09:31 +0100)]
test: merge existing path tests

5 years agolibmutt: fix path code for degenerate cases
Richard Russon [Fri, 19 Apr 2019 13:59:45 +0000 (14:59 +0100)]
libmutt: fix path code for degenerate cases

5 years agotest: add path tests for degenerate cases
Richard Russon [Fri, 19 Apr 2019 00:07:37 +0000 (01:07 +0100)]
test: add path tests for degenerate cases

5 years agotest: templates for path functions
Richard Russon [Thu, 18 Apr 2019 22:26:39 +0000 (23:26 +0100)]
test: templates for path functions

5 years agocoverage: show stats
Richard Russon [Thu, 18 Apr 2019 12:15:34 +0000 (13:15 +0100)]
coverage: show stats

5 years agotests: add copyright blocks
Richard Russon [Wed, 17 Apr 2019 11:40:40 +0000 (12:40 +0100)]
tests: add copyright blocks

5 years agodocs: add note about line continuation
Richard Russon [Tue, 23 Apr 2019 12:42:45 +0000 (13:42 +0100)]
docs: add note about line continuation

Closes: #1668
[ci skip]

5 years agoFix uninitialized variable
Pietro Cerutti [Tue, 23 Apr 2019 11:08:30 +0000 (11:08 +0000)]
Fix uninitialized variable

Reported on https://mailman.neomutt.org/pipermail/neomutt-devel-neomutt.org/2019-April/000654.html

5 years agoimap: fix auth login
Mehdi Abaakouk [Sun, 21 Apr 2019 14:50:00 +0000 (16:50 +0200)]
imap: fix auth login

The auth_login returns an error when it succesfully logins.

This was introduced by 04892a48ea76b37f6aa9b369b5bc4f5cc362878c

This change fixes that.

5 years agoimap: fix oauth
Mehdi Abaakouk [Sun, 21 Apr 2019 13:43:03 +0000 (15:43 +0200)]
imap: fix oauth

Currently when oauth success, we got this and neomutt UI got stuck:

[2019-04-21 15:35:38]<5> mutt_socket_readln_d() 5< a0001 OK xxxxxxxxxxxxx@xxxxxxxxx authenticated (Success)
[2019-04-21 15:35:38]<2> mutt_socket_write_d() 5> [2019-04-21 15:35:38]<2> imap_login() Communication encrypted at 256 bits
[2019-04-21 15:35:38]<3> imap_mdata_new() hcache uidvalidity 1, uidnext 228, modseq 0
[2019-04-21 15:35:38]<M> mx_mbox_open() Reading imaps://imap.gmail.com/INBOX...
[2019-04-21 15:35:38]<M> imap_mbox_open() Selecting INBOX...
[2019-04-21 15:35:38]<2> mutt_socket_write_d() 5> a0002 SELECT "INBOX"
[2019-04-21 15:35:38]<5> mutt_socket_readln_d() 5< * BAD [CLIENTBUG] Invalid tag

In fact neomutt send ^A to the server, but this should occurs only if
the authentication fails.

This changes fixes that.

5 years agoDemote more 'first' and 'last' errors to messages
Pietro Cerutti [Fri, 19 Apr 2019 08:33:23 +0000 (08:33 +0000)]
Demote more 'first' and 'last' errors to messages

This should finish the job done in 8e8344.

Fixes #1311

5 years agoupdate credits
Richard Russon [Wed, 17 Apr 2019 22:40:13 +0000 (23:40 +0100)]
update credits

5 years agofix release build
Richard Russon [Tue, 16 Apr 2019 23:05:47 +0000 (00:05 +0100)]
fix release build

5 years agoFix capitalization (now consistent with the respective code in pager.c)
Pietro Cerutti [Wed, 17 Apr 2019 12:03:22 +0000 (12:03 +0000)]
Fix capitalization (now consistent with the respective code in pager.c)

5 years agoSupport group-chat-reply in the index
Pietro Cerutti [Wed, 17 Apr 2019 09:40:45 +0000 (09:40 +0000)]
Support group-chat-reply in the index

Fixes #1654

5 years agoMake buffer pool initialization lazy
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.

5 years agotidy: config variables and comments
Richard Russon [Tue, 16 Apr 2019 17:07:32 +0000 (18:07 +0100)]
tidy: config variables and comments

Rename global variables to match their config:

- `C_ImapCondStore`       -> `C_ImapCondstore`
- `C_ImapOauthRefreshCmd` -> `C_ImapOauthRefreshCommand`
- `C_ImapQResync`         -> `C_ImapQresync`
- `C_PopOauthRefreshCmd`  -> `C_PopOauthRefreshCommand`
- `C_SidebarNonEmptyOnly` -> `C_SidebarNonEmptyMailboxOnly`
- `C_SmtpOauthRefreshCmd` -> `C_SmtpOauthRefreshCommand`

5 years agosplit Address into a separate library
Richard Russon [Tue, 16 Apr 2019 14:34:33 +0000 (15:34 +0100)]
split Address into a separate library

Closes: #1619
5 years agoMake buffer pool parameters (compile-time) configurable
Pietro Cerutti [Tue, 16 Apr 2019 13:00:27 +0000 (13:00 +0000)]
Make buffer pool parameters (compile-time) configurable

5 years agoremove unnecesary test in mutt_str_asprintf()
Richard Russon [Tue, 16 Apr 2019 12:48:13 +0000 (13:48 +0100)]
remove unnecesary test in mutt_str_asprintf()

Temporarily remove a valid test condition to match.

5 years agomerge: promote two functions to libmutt
Richard Russon [Tue, 16 Apr 2019 11:52:02 +0000 (12:52 +0100)]
merge: promote two functions to libmutt

 * libmutt: promote getcwd to the library
 * libmutt: promote mutt_buffer_concat_path to the library
 * add basic tests

5 years agoadd basic tests 1651/head
Richard Russon [Tue, 16 Apr 2019 11:29:42 +0000 (12:29 +0100)]
add basic tests

5 years agolibmutt: promote mutt_buffer_concat_path to the library
Richard Russon [Thu, 11 Apr 2019 01:59:24 +0000 (02:59 +0100)]
libmutt: promote mutt_buffer_concat_path to the library

5 years agolibmutt: promote getcwd to the library
Richard Russon [Thu, 11 Apr 2019 01:52:59 +0000 (02:52 +0100)]
libmutt: promote getcwd to the library

5 years agofix Mailbox->append,changed flags
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`

5 years agofix setting the 'replied' flag
Richard Russon [Fri, 12 Apr 2019 16:17:54 +0000 (17:17 +0100)]
fix setting the 'replied' flag

When replying to an email, mark the original as 'replied'.

Fixes: #1647
5 years agomerge: convert Buffers to use the pool
Richard Russon [Tue, 16 Apr 2019 10:45:07 +0000 (11:45 +0100)]
merge: convert Buffers to use the pool

 * remove unused Buffer in cs_inherit_variable()
 * allocate Buffer in ac_free()
 * allocate Buffer in cs_register_variables()
 * allocate Buffer in mutt_folder_hook()
 * allocate Buffer in lua_mutt_call()
 * allocate Buffer in lua_mutt_enter()
 * allocate Buffer in mutt_find_hook()
 * allocate Buffer in mutt_account_hook()
 * allocate Buffer in execute_commands()
 * allocate Buffer in mutt_dump_variables()

5 years agoallocate Buffer in mutt_dump_variables() 1649/head
Richard Russon [Fri, 12 Apr 2019 10:37:43 +0000 (11:37 +0100)]
allocate Buffer in mutt_dump_variables()

5 years agoallocate Buffer in execute_commands()
Richard Russon [Fri, 12 Apr 2019 10:37:16 +0000 (11:37 +0100)]
allocate Buffer in execute_commands()

5 years agoallocate Buffer in mutt_account_hook()
Richard Russon [Fri, 12 Apr 2019 10:37:04 +0000 (11:37 +0100)]
allocate Buffer in mutt_account_hook()

5 years agoallocate Buffer in mutt_find_hook()
Richard Russon [Fri, 12 Apr 2019 10:36:52 +0000 (11:36 +0100)]
allocate Buffer in mutt_find_hook()

5 years agoallocate Buffer in lua_mutt_enter()
Richard Russon [Fri, 12 Apr 2019 10:38:15 +0000 (11:38 +0100)]
allocate Buffer in lua_mutt_enter()

5 years agoallocate Buffer in lua_mutt_call()
Richard Russon [Fri, 12 Apr 2019 10:37:56 +0000 (11:37 +0100)]
allocate Buffer in lua_mutt_call()

5 years agoallocate Buffer in mutt_folder_hook()
Richard Russon [Fri, 12 Apr 2019 10:36:37 +0000 (11:36 +0100)]
allocate Buffer in mutt_folder_hook()

5 years agoallocate Buffer in cs_register_variables()
Richard Russon [Fri, 12 Apr 2019 10:36:07 +0000 (11:36 +0100)]
allocate Buffer in cs_register_variables()

5 years agoallocate Buffer in ac_free()
Richard Russon [Fri, 12 Apr 2019 10:35:58 +0000 (11:35 +0100)]
allocate Buffer in ac_free()

5 years agoremove unused Buffer in cs_inherit_variable()
Richard Russon [Fri, 12 Apr 2019 10:36:26 +0000 (11:36 +0100)]
remove unused Buffer in cs_inherit_variable()

5 years agomerge: add framework for testing string functions
Richard Russon [Tue, 16 Apr 2019 09:49:35 +0000 (10:49 +0100)]
merge: add framework for testing string functions

 * test: templates for string functions
 * test: add string tests for degenerate cases
 * libmutt: fix code for degenerate cases
 * test: merge existing string tests
 * build: add coverage testing

5 years agobuild: add coverage testing 1655/head
Richard Russon [Tue, 16 Apr 2019 00:47:40 +0000 (01:47 +0100)]
build: add coverage testing

5 years agotest: merge existing string tests
Richard Russon [Tue, 16 Apr 2019 00:10:05 +0000 (01:10 +0100)]
test: merge existing string tests

5 years agolibmutt: fix code for degenerate cases
Richard Russon [Mon, 15 Apr 2019 23:49:25 +0000 (00:49 +0100)]
libmutt: fix code for degenerate cases

5 years agotest: add string tests for degenerate cases
Richard Russon [Mon, 15 Apr 2019 23:48:39 +0000 (00:48 +0100)]
test: add string tests for degenerate cases

5 years agotest: templates for string functions
Richard Russon [Mon, 15 Apr 2019 15:55:45 +0000 (16:55 +0100)]
test: templates for string functions

5 years agomerge: trivial fixes
Richard Russon [Mon, 15 Apr 2019 12:40:53 +0000 (13:40 +0100)]
merge: trivial fixes

 * refactor: light tidying
 * tidy macros
 * comment escape sequences
 * add: PatternExecFlags for mutt_pattern_exec()
 * tidy: mutt_copy_hdr()
 * tidy calls to mutt_copy_hdr()
 * boolify: mutt_parse_crypt_hdr()
 * boolify: mutt_enter_fname()
 * boolify: valid_passphrase()

5 years agoboolify: valid_passphrase() 1652/head
Richard Russon [Sun, 14 Apr 2019 16:30:08 +0000 (17:30 +0100)]
boolify: valid_passphrase()

5 years agoboolify: mutt_enter_fname()
Richard Russon [Fri, 12 Apr 2019 13:35:41 +0000 (14:35 +0100)]
boolify: mutt_enter_fname()

5 years agoboolify: mutt_parse_crypt_hdr()
Richard Russon [Wed, 10 Apr 2019 17:13:36 +0000 (18:13 +0100)]
boolify: mutt_parse_crypt_hdr()

5 years agotidy calls to mutt_copy_hdr()
Richard Russon [Fri, 12 Apr 2019 14:03:20 +0000 (15:03 +0100)]
tidy calls to mutt_copy_hdr()

5 years agotidy: mutt_copy_hdr()
Richard Russon [Fri, 12 Apr 2019 13:41:28 +0000 (14:41 +0100)]
tidy: mutt_copy_hdr()

5 years agoadd: PatternExecFlags for mutt_pattern_exec()
Richard Russon [Wed, 10 Apr 2019 18:06:40 +0000 (19:06 +0100)]
add: PatternExecFlags for mutt_pattern_exec()

The flags were an enum, which wasn't really suitable.

5 years agocomment escape sequences
Richard Russon [Fri, 12 Apr 2019 19:32:09 +0000 (20:32 +0100)]
comment escape sequences

5 years agotidy macros
Richard Russon [Thu, 11 Apr 2019 22:56:22 +0000 (23:56 +0100)]
tidy macros

- add underscores
- remove unused

5 years agorefactor: light tidying
Richard Russon [Thu, 11 Apr 2019 02:06:02 +0000 (03:06 +0100)]
refactor: light tidying

- clang-format
- remove unused declaration
- use bools in config definitions
- fix doxygen comments
- remove unnecessary check
- tidy list/queue definitions

5 years agoFix save_message() - set the append flag to the correct mailbox
Pietro Cerutti [Fri, 12 Apr 2019 08:57:17 +0000 (08:57 +0000)]
Fix save_message() - set the append flag to the correct mailbox

Fixes #1645

5 years agomark oauth config variables as sensitive
Jakub Jindra [Tue, 9 Apr 2019 13:50:45 +0000 (15:50 +0200)]
mark oauth config variables as sensitive

5 years agotidy: delete trailing whitespace
Richard Russon [Tue, 9 Apr 2019 14:05:23 +0000 (15:05 +0100)]
tidy: delete trailing whitespace

5 years agofix crash on startup
Richard Russon [Tue, 9 Apr 2019 13:44:15 +0000 (14:44 +0100)]
fix crash on startup

Allocate the 'folder' earlier.
Our code paths seem to differ from upstream's.

5 years agomerge: Allow reopening of Maiboxes (workaround)
Richard Russon [Tue, 9 Apr 2019 13:18:23 +0000 (14:18 +0100)]
merge: Allow reopening of Maiboxes (workaround)

 * fix ev_message()
 * fix save_message()
 * fix pop_fetch_mail()
 * fix trash_append()

5 years agofix trash_append() 1630/head
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.

5 years agofix pop_fetch_mail()
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.

5 years agofix save_message()
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.

5 years agofix ev_message()
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.