]> granicus.if.org Git - neomutt/log
neomutt
6 years agomutt_make_string: separate Context from Mailbox
Richard Russon [Fri, 11 Jan 2019 14:09:58 +0000 (14:09 +0000)]
mutt_make_string: separate Context from Mailbox

6 years agodoxy: fix headers
Richard Russon [Thu, 10 Jan 2019 23:15:37 +0000 (23:15 +0000)]
doxy: fix headers

6 years agonotmuch: remove Context in nm_read_entire_thread() 1387/head
Austin Ray [Wed, 9 Jan 2019 22:28:08 +0000 (17:28 -0500)]
notmuch: remove Context in nm_read_entire_thread()

Removed the coupling between `nm_read_entire_thread()` and `struct
Context` by replacing it with `struct Mailbox`.

`Context` had two uses: `Mailbox` reference source and `ctx_update()`.

The introduction of mailbox notification code allows mailbox events to
trigger `ctx_update()`, which removes the hard dependency on `Context`.

Passing a `Mailbox` reference removes the remaining soft dependency on
`Context`.

6 years agoRelax non-empty requirement on compose_format, pager_format, and status_format (...
Pietro Cerutti [Wed, 9 Jan 2019 14:31:07 +0000 (14:31 +0000)]
Relax non-empty requirement on compose_format, pager_format, and status_format (#1531)

Fixes #1530

6 years agoRevert "Don't override ndata with temporary context"
Pietro Cerutti [Wed, 9 Jan 2019 09:20:35 +0000 (09:20 +0000)]
Revert "Don't override ndata with temporary context"

This reverts commit c128c131185fb076476991f477565ba115352faa.

6 years agoDon't override ndata with temporary context 1528/head
Mehdi Abaakouk [Tue, 8 Jan 2019 14:56:53 +0000 (15:56 +0100)]
Don't override ndata with temporary context

postponed/sendlib code can reopen an already opened mailbox.

This overrides m->ndata with a temporary context but never revert it back to
the previous one.

At first glance, when postponed/sendlib code open the mailbox they don't care
to have their context updated with the notification system. It should be
the Context used for the UI that should be updated instead.

So until we don't open a mailbox twice anymore, just set ndata when it
looks accurate to workaround the issue.

6 years agofix: check for mailbox for folder-hook
Richard Russon [Tue, 8 Jan 2019 12:02:47 +0000 (12:02 +0000)]
fix: check for mailbox for folder-hook

Fixes #1527

6 years agofix: saving email to fcc
Richard Russon [Tue, 8 Jan 2019 11:55:35 +0000 (11:55 +0000)]
fix: saving email to fcc

6 years agoSort by UID so sequence ranges in UID STORE make sense
Pietro Cerutti [Tue, 8 Jan 2019 10:22:31 +0000 (10:22 +0000)]
Sort by UID so sequence ranges in UID STORE make sense

This fixes the use case where a bunch of messages are tagged, removed,
then the mailbox is sync'd in a thread view. In this case, the sequence
number given by email->index is not monotonic, which results in weird
sequence sets being passed to UID STORE.

6 years agofix crash in ci_send_message()
Richard Russon [Mon, 7 Jan 2019 23:08:49 +0000 (23:08 +0000)]
fix crash in ci_send_message()

Fixes #1525

6 years agofix crash in mutt_parse_unmailboxes()
Richard Russon [Mon, 7 Jan 2019 15:46:46 +0000 (15:46 +0000)]
fix crash in mutt_parse_unmailboxes()

Fixes #1523

6 years agoclose command prompt when deleting the colon
Pablo Ovelleiro Corral [Sun, 23 Dec 2018 17:06:47 +0000 (18:06 +0100)]
close command prompt when deleting the colon

Fixes #1505

6 years agomerge: upstream changes
Richard Russon [Mon, 7 Jan 2019 15:10:46 +0000 (15:10 +0000)]
merge: upstream changes

 * Factor out rfc2047_decode_envelope()
 * Parse and store mime headers in the BODY
 * Add mx operation save_to_header_cache
 * Add protected header received email support
 * Add rfc2047_encode_envelope helper
 * Refactor save_fcc() function
 * Move fcc after send
 * Prompt when mutt_write_fcc() fails
 * Refactor postpone_message()
 * When postponing, encode descriptions before encrypting
 * More postpone cleanup
 * Fix flags if mutt_get_postponed() has no messages
 * Display mail sent message after Fcc finishes
 * Handle improperly encoded pgp/mime octetstream part
 * Add config and data structure for protected header write support
 * Add a new mode for mutt_write_rfc822_header()
 * Finish protected header write support
 * Read in protected headers when resuming a postponed message
 * Free pgpkeylist if the send fails
 * Rfc2047 encode and fold X-Label when writing updates
 * Restore the xlabel_changed reset
 * Make a copy of x_label before encoding it for updates
 * spelling consistency
 * Updated French translation
 * Added support for the "light" color prefix (in addition to "bright")
 * Light colors: do not do the + 8 on negative values, such as COLOR_DEFAULT
 * Create envelope->changed to mark all field changes
 * Change x-label editing flag to be in the envelope
 * Add $crypt_protected_headers_save
 * Color protected subject as a header in the pager
 * Respect ignore for the protected subject display
 * fix config order
 * Remove unused MUTT_FORMAT_MAKEPRINT flag
 * Sleep $sleep_time after displaying "mail sent" message
 * Update copyright for the next stable release

6 years agoUpdate copyright for the next stable release
Kevin McCarthy [Sat, 5 Jan 2019 21:25:38 +0000 (13:25 -0800)]
Update copyright for the next stable release

Co-authored-by: Richard Russon <rich@flatcap.org>
6 years agoSleep $sleep_time after displaying "mail sent" message
Kevin McCarthy [Tue, 1 Jan 2019 19:24:11 +0000 (11:24 -0800)]
Sleep $sleep_time after displaying "mail sent" message

In case returning the index displays some kind of error right away, to
give time to see the success message.

Co-authored-by: Richard Russon <rich@flatcap.org>
6 years agoRemove unused MUTT_FORMAT_MAKEPRINT flag
Kevin McCarthy [Mon, 31 Dec 2018 23:39:04 +0000 (15:39 -0800)]
Remove unused MUTT_FORMAT_MAKEPRINT flag

The code in mutt_FormatString() that was using it was commented out 19
years ago.

Co-authored-by: Richard Russon <rich@flatcap.org>
6 years agofix config order
Richard Russon [Mon, 7 Jan 2019 11:29:52 +0000 (11:29 +0000)]
fix config order

Co-authored-by: Richard Russon <rich@flatcap.org>
6 years agoRespect ignore for the protected subject display
Kevin McCarthy [Sat, 29 Dec 2018 21:50:00 +0000 (13:50 -0800)]
Respect ignore for the protected subject display

Co-authored-by: Richard Russon <rich@flatcap.org>
6 years agoColor protected subject as a header in the pager
Kevin McCarthy [Sat, 29 Dec 2018 21:20:03 +0000 (13:20 -0800)]
Color protected subject as a header in the pager

Co-authored-by: Richard Russon <rich@flatcap.org>
6 years agoAdd $crypt_protected_headers_save
Kevin McCarthy [Thu, 27 Dec 2018 20:05:43 +0000 (12:05 -0800)]
Add $crypt_protected_headers_save

Setting this option will save the protected header back into the
clear-text message headers.  This improves
usability (searching/limiting/replying) when reopening a mailbox
without header cache.  However, it is a security trade-off, so
defaults off and strongly warns about what it is doing in the documentation.

Co-authored-by: Richard Russon <rich@flatcap.org>
6 years agoChange x-label editing flag to be in the envelope
Kevin McCarthy [Wed, 26 Dec 2018 03:52:53 +0000 (19:52 -0800)]
Change x-label editing flag to be in the envelope

Handle like In-Reply-To and References editing.  Change the flag
setting to be inside mutt_copy_header().

The resetting of the changed flag occurs explicitly in the imap and
maildir/mh sync_mailbox code.  It occurs for mbox in the
mx_update_tables() call in mx_sync_mailbox().

Co-authored-by: Richard Russon <rich@flatcap.org>
6 years agoCreate envelope->changed to mark all field changes
Kevin McCarthy [Wed, 26 Dec 2018 03:24:08 +0000 (19:24 -0800)]
Create envelope->changed to mark all field changes

In subsequent commits, we're going to add the x-label and subject
headers changed flags into the envelope.  To avoid the list of checks
exploding everywhere, just use a single field to check and reset those
values.

Several places in the code are checking for a null header->env.  I
wasn't aware this was possible, so I've added todo notes to track down
when this occurs.

Co-authored-by: Richard Russon <rich@flatcap.org>
6 years agoLight colors: do not do the + 8 on negative values, such as COLOR_DEFAULT
Vincent Lefevre [Sat, 29 Dec 2018 19:08:26 +0000 (20:08 +0100)]
Light colors: do not do the + 8 on negative values, such as COLOR_DEFAULT

Co-authored-by: Richard Russon <rich@flatcap.org>
6 years agoAdded support for the "light" color prefix (in addition to "bright")
Vincent Lefevre [Sat, 29 Dec 2018 18:37:57 +0000 (19:37 +0100)]
Added support for the "light" color prefix (in addition to "bright")

At the same time, restrict the advance by 8 to colors in the range 0-7
and no longer use the blink attribute to emulate light background colors
in some terminals (e.g. linux console and rxvt), as this is really blink
in other terminals (e.g. xterm); light background colors can still be
obtained by choosing a proper $TERM value (tested with linux console,
using TERM=linux-16color, and rxvt).

Co-authored-by: Richard Russon <rich@flatcap.org>
6 years agoUpdated French translation
Vincent Lefevre [Sat, 29 Dec 2018 17:17:43 +0000 (18:17 +0100)]
Updated French translation

Co-authored-by: Richard Russon <rich@flatcap.org>
6 years agospelling consistency
Vincent Lefevre [Sat, 29 Dec 2018 17:03:27 +0000 (18:03 +0100)]
spelling consistency

Co-authored-by: Richard Russon <rich@flatcap.org>
6 years agoMake a copy of x_label before encoding it for updates
Kevin McCarthy [Fri, 28 Dec 2018 23:43:51 +0000 (15:43 -0800)]
Make a copy of x_label before encoding it for updates

This isn't actually a bug.  Context->label_hash strdups the keys, so
we are safe from dangling references.  However, the subj_hash uses
direct references, so to keep things consistent and safe, make a copy
and encode that.

Co-authored-by: Richard Russon <rich@flatcap.org>
6 years agoRestore the xlabel_changed reset
Kevin McCarthy [Fri, 28 Dec 2018 00:24:27 +0000 (16:24 -0800)]
Restore the xlabel_changed reset

The cherry pick accidentally obliterated the reset.  That flag is now
located in hdr->env->changed in the branch and is reset properly
elsewhere.  Keep it in place in the stable branch.

Co-authored-by: Richard Russon <rich@flatcap.org>
6 years agoRfc2047 encode and fold X-Label when writing updates
Kevin McCarthy [Fri, 28 Dec 2018 00:08:36 +0000 (16:08 -0800)]
Rfc2047 encode and fold X-Label when writing updates

Also, add a missing "skip" in mutt_copy_hdr() for the non-simple case.

These fixes were backported from the kevin/mutt_protected_header branch.

Co-authored-by: Richard Russon <rich@flatcap.org>
6 years agoFree pgpkeylist if the send fails
Kevin McCarthy [Tue, 25 Dec 2018 00:22:07 +0000 (16:22 -0800)]
Free pgpkeylist if the send fails

Co-authored-by: Richard Russon <rich@flatcap.org>
6 years agoRead in protected headers when resuming a postponed message
Kevin McCarthy [Mon, 24 Dec 2018 23:11:09 +0000 (15:11 -0800)]
Read in protected headers when resuming a postponed message

Co-authored-by: Richard Russon <rich@flatcap.org>
6 years agoFinish protected header write support
Kevin McCarthy [Mon, 24 Dec 2018 00:32:52 +0000 (16:32 -0800)]
Finish protected header write support

Write out the protected headers when writing the mime header part.

Hide protected subjects with $crypt_protected_headers_subject, for
outgoing, postponed, and fcc'ed messages.

Don't hide in postponed and fcc'ed if $crypt_protected_headers_read
isn't set.

Add a few missing cases where mime_headers needed to be cleaned up on
error.

Remove the protected headers for $fcc_clear.

Co-authored-by: Richard Russon <rich@flatcap.org>
6 years agoAdd a new mode for mutt_write_rfc822_header()
Kevin McCarthy [Mon, 24 Dec 2018 00:23:02 +0000 (16:23 -0800)]
Add a new mode for mutt_write_rfc822_header()

Convert the mode parameter to an enum, to make the code a bit more readable.

Co-authored-by: Richard Russon <rich@flatcap.org>
6 years agoAdd config and data structure for protected header write support
Kevin McCarthy [Sun, 16 Dec 2018 21:15:05 +0000 (13:15 -0800)]
Add config and data structure for protected header write support

Add config vars $crypt_protected_headers_write (unset by default),
and $crypt_protected_headers_subject.

Store the protected headers during mime_protect().

Co-authored-by: Richard Russon <rich@flatcap.org>
6 years agoHandle improperly encoded pgp/mime octetstream part
Kevin McCarthy [Fri, 21 Dec 2018 18:13:17 +0000 (10:13 -0800)]
Handle improperly encoded pgp/mime octetstream part

Some clients (or even mail servers) improperly encode the octetstream
part.

Thanks to Riccardo Schirone for the original merge request patch.
This commit also handles the attachment menu, and makes the decoding
conditional so it's not done if it isn't necessary.

Co-authored-by: Richard Russon <rich@flatcap.org>
6 years agoDisplay mail sent message after Fcc finishes
Kevin McCarthy [Fri, 21 Dec 2018 17:42:26 +0000 (09:42 -0800)]
Display mail sent message after Fcc finishes

For the case of IMAP, the uploading message would otherwise stay on
the screen.  In any case, it's best to show that message as the last
thing before returning to the index.

Thanks to chdiza for reporting the issue!

Co-authored-by: Richard Russon <rich@flatcap.org>
6 years agoFix flags if mutt_get_postponed() has no messages
Kevin McCarthy [Thu, 20 Dec 2018 02:48:04 +0000 (18:48 -0800)]
Fix flags if mutt_get_postponed() has no messages

Flags needs to be reset so memory cleanup is done at the end.

Co-authored-by: Richard Russon <rich@flatcap.org>
6 years agoMore postpone cleanup
Kevin McCarthy [Thu, 20 Dec 2018 02:36:19 +0000 (18:36 -0800)]
More postpone cleanup

Provide an error message if $postponed is not set.

Make sure the clear content is freed for encrypted messages.

If the write_fcc() fails, make sure to restore the clear content.

Co-authored-by: Richard Russon <rich@flatcap.org>
6 years agoWhen postponing, encode descriptions before encrypting
Kevin McCarthy [Thu, 20 Dec 2018 01:43:26 +0000 (17:43 -0800)]
When postponing, encode descriptions before encrypting

This matches the behavior of the normal send process.  I don't think
there is actually an issue here since nothing is sent, but it makes
sense to be consistent.

Co-authored-by: Richard Russon <rich@flatcap.org>
6 years agoRefactor postpone_message()
Kevin McCarthy [Thu, 20 Dec 2018 00:20:23 +0000 (16:20 -0800)]
Refactor postpone_message()

Co-authored-by: Richard Russon <rich@flatcap.org>
6 years agoPrompt when mutt_write_fcc() fails
Kevin McCarthy [Wed, 19 Dec 2018 23:42:24 +0000 (15:42 -0800)]
Prompt when mutt_write_fcc() fails

Allow the user to retry, specify an alternate mailbox, or skip.

Co-authored-by: Richard Russon <rich@flatcap.org>
6 years agoMove fcc after send
Kevin McCarthy [Wed, 19 Dec 2018 22:35:22 +0000 (14:35 -0800)]
Move fcc after send

Co-authored-by: Richard Russon <rich@flatcap.org>
6 years agoRefactor save_fcc() function
Kevin McCarthy [Wed, 19 Dec 2018 22:24:46 +0000 (14:24 -0800)]
Refactor save_fcc() function

Co-authored-by: Richard Russon <rich@flatcap.org>
6 years agoAdd rfc2047_encode_envelope helper
Kevin McCarthy [Sun, 16 Dec 2018 22:23:54 +0000 (14:23 -0800)]
Add rfc2047_encode_envelope helper

Co-authored-by: Richard Russon <rich@flatcap.org>
6 years agoAdd protected header received email support
Kevin McCarthy [Tue, 11 Dec 2018 22:11:30 +0000 (14:11 -0800)]
Add protected header received email support

Add $crypt_protected_headers_read config variable to enable reading
and updating the index/header cache.

Print protected Subject header in the pager as parts are rendered.

Once opened, update the index, subject hash, and header cache.

Co-authored-by: Richard Russon <rich@flatcap.org>
6 years agoAdd mx operation save_to_header_cache
Kevin McCarthy [Sat, 15 Dec 2018 22:49:55 +0000 (14:49 -0800)]
Add mx operation save_to_header_cache

This will be used when reading protected headers, to store the
encrypted subject in the header cache so it can be searched with.

Co-authored-by: Richard Russon <rich@flatcap.org>
6 years agoParse and store mime headers in the BODY
Kevin McCarthy [Mon, 10 Dec 2018 01:41:58 +0000 (17:41 -0800)]
Parse and store mime headers in the BODY

Don't store the field in the header cache though.

Co-authored-by: Richard Russon <rich@flatcap.org>
6 years agoFactor out rfc2047_decode_envelope()
Kevin McCarthy [Mon, 10 Dec 2018 03:52:21 +0000 (19:52 -0800)]
Factor out rfc2047_decode_envelope()

Co-authored-by: Richard Russon <rich@flatcap.org>
6 years agoclang-format
Richard Russon [Mon, 7 Jan 2019 11:49:12 +0000 (11:49 +0000)]
clang-format

6 years agoacutest: sync to upstream
Pietro Cerutti [Mon, 7 Jan 2019 14:54:47 +0000 (14:54 +0000)]
acutest: sync to upstream

6 years agomerge: factor Context out of mailbox functions
Richard Russon [Sat, 5 Jan 2019 14:46:13 +0000 (14:46 +0000)]
merge: factor Context out of mailbox functions

 * imap: drop Context from imap_copy_messages()
 * tidy mbox_close
 * mailbox: add notify callback
 * mx_fastclose_mailbox: use mailbox notifications
 * mx_fastclose_mailbox: factor out Context
 * imap_expunge_mailbox: use mailbox notifications
 * imap: drop mdata->ctx
 * mbox_open: factor out Context
 * mbox_check: use mailbox notifications
 * mbox_check: factor out Context
 * mbox_sync: use mailbox notifications
 * mbox_sync: factor out Context
 * split out context functions
 * mx_mbox_close drop index_hint
 * imap tidy

6 years agoimap tidy
Richard Russon [Fri, 28 Dec 2018 14:16:29 +0000 (14:16 +0000)]
imap tidy

6 years agomx_mbox_close drop index_hint
Richard Russon [Sun, 30 Dec 2018 02:29:04 +0000 (02:29 +0000)]
mx_mbox_close drop index_hint

6 years agosplit out context functions
Richard Russon [Fri, 28 Dec 2018 11:08:37 +0000 (11:08 +0000)]
split out context functions

6 years agombox_sync: factor out Context
Richard Russon [Wed, 26 Dec 2018 18:14:46 +0000 (18:14 +0000)]
mbox_sync: factor out Context

6 years agombox_sync: use mailbox notifications
Richard Russon [Wed, 26 Dec 2018 18:10:36 +0000 (18:10 +0000)]
mbox_sync: use mailbox notifications

6 years agombox_check: factor out Context
Richard Russon [Mon, 24 Dec 2018 11:57:57 +0000 (11:57 +0000)]
mbox_check: factor out Context

6 years agombox_check: use mailbox notifications
Richard Russon [Mon, 24 Dec 2018 11:50:31 +0000 (11:50 +0000)]
mbox_check: use mailbox notifications

6 years agombox_open: factor out Context
Richard Russon [Mon, 24 Dec 2018 11:23:23 +0000 (11:23 +0000)]
mbox_open: factor out Context

6 years agoimap: drop mdata->ctx
Richard Russon [Sun, 23 Dec 2018 00:14:10 +0000 (00:14 +0000)]
imap: drop mdata->ctx

6 years agoimap_expunge_mailbox: use mailbox notifications
Richard Russon [Sun, 23 Dec 2018 00:11:20 +0000 (00:11 +0000)]
imap_expunge_mailbox: use mailbox notifications

6 years agomx_fastclose_mailbox: factor out Context
Richard Russon [Sun, 23 Dec 2018 00:06:32 +0000 (00:06 +0000)]
mx_fastclose_mailbox: factor out Context

6 years agomx_fastclose_mailbox: use mailbox notifications
Richard Russon [Thu, 20 Dec 2018 13:37:38 +0000 (13:37 +0000)]
mx_fastclose_mailbox: use mailbox notifications

6 years agomailbox: add notify callback
Richard Russon [Wed, 19 Dec 2018 13:24:17 +0000 (13:24 +0000)]
mailbox: add notify callback

6 years agotidy mbox_close
Richard Russon [Mon, 31 Dec 2018 02:05:20 +0000 (02:05 +0000)]
tidy mbox_close

6 years agoimap: drop Context from imap_copy_messages()
Richard Russon [Mon, 31 Dec 2018 18:03:15 +0000 (18:03 +0000)]
imap: drop Context from imap_copy_messages()

6 years agofolder-hook: try matching on description
Austin Ray [Fri, 4 Jan 2019 02:20:21 +0000 (21:20 -0500)]
folder-hook: try matching on description

Use the description, in addition to the path, when determining to
execute a `folder-hook`. Since `named-mailboxes` and `virtual-mailboxes`
use descriptions to hide ugliness of raw paths, the description may
differ from the path and/or contain information not included in the
path.

The inclusion of description checking makes `folder-hook`s improves its
ergonomics. `notmuch` users were particularly affect by poor
`folder-hook` ergonomics since `virtual-mailboxes` paths often had large
overlap, making it hard to craft a good regex. A workaround was to add a
unique dummy key.

6 years agomerge: add summary pages
Richard Russon [Fri, 4 Jan 2019 01:19:40 +0000 (01:19 +0000)]
merge: add summary pages

 * add ICommand for new :ex-style commands
 * Implement :set [all] commands
 * Implement :version command

6 years agoImplement :version command
ryt [Mon, 12 Nov 2018 21:26:44 +0000 (22:26 +0100)]
Implement :version command

6 years agoImplement :set [all] commands
ryt [Mon, 12 Nov 2018 19:49:57 +0000 (20:49 +0100)]
Implement :set [all] commands

6 years agoadd ICommand for new :ex-style commands
Christopher John CZETTEL [Sun, 25 Sep 2016 19:50:17 +0000 (21:50 +0200)]
add ICommand for new :ex-style commands

These are needed for the new summary tables feature
(and inspired by the Command lookup table in init.c)

added: ICommand wrapper / lookup table allowing easy addition of new
informational commands that will not be parsed in .muttrc files and
override any existing rc-line commands when executed in mutt.

added: hook in mutt_enter_command in command.c to integrate new
ICommands facility

Issue #162

6 years agombox: quieten probing
Richard Russon [Fri, 4 Jan 2019 00:36:38 +0000 (00:36 +0000)]
mbox: quieten probing

6 years agomerge: Tidy the command parsing functions
Richard Russon [Thu, 3 Jan 2019 17:18:52 +0000 (17:18 +0000)]
merge: Tidy the command parsing functions

 * Created enum to group command_t return codes
 * Change errors to warnings where applicable

6 years agoChange errors to warnings where applicable
Victor Fernandes [Tue, 1 Jan 2019 18:42:26 +0000 (19:42 +0100)]
Change errors to warnings where applicable

6 years agoCreated enum to group command_t return codes
Victor Fernandes [Mon, 24 Dec 2018 00:18:04 +0000 (01:18 +0100)]
Created enum to group command_t return codes

Old return codes have been replaced by the enum ones
in init.c, but other files have functions that must be
changed too.

6 years agoclang-format
Richard Russon [Thu, 3 Jan 2019 13:36:30 +0000 (13:36 +0000)]
clang-format

6 years agofix: mutt/charset.c: only include libintl.h if ENABLE_NLS is defined
Naveen Nathan [Thu, 3 Jan 2019 02:21:59 +0000 (13:21 +1100)]
fix: mutt/charset.c: only include libintl.h if ENABLE_NLS is defined

6 years agonotmuch: make sure nm_db_longrun_done() release DB
Karel Zak [Thu, 3 Jan 2019 10:51:49 +0000 (11:51 +0100)]
notmuch: make sure nm_db_longrun_done() release DB

Since commit 1cdfc0da08e09b1756a7b4d422996e907c4390d0 the function
nm_db_release() does not release DB if long-run state is enabled.
This change make code more readable and shorter.

Unfortunately, nm_db_release() is called from nm_db_longrun_done(), so
after the change the function nm_db_longrun_done() is no-op and long
transaction never finish. It means:

 - changes are not committed the database
 - after mutt restart old state (tags) is read from DB
 - mismatch between notmuch tags and maildir filenames

This commit disables long-run state in nm_db_longrun_done() before
nm_db_release() is called.

6 years agoIndex: try description when changing mailboxes 1516/head
Austin Ray [Tue, 1 Jan 2019 20:59:48 +0000 (15:59 -0500)]
Index: try description when changing mailboxes

Mailbox: find mailbox by description

Introduce `mutt_find_mailbox_desc()`, which takes a pointer to a
description, and tries to find a mailbox that corresponds to it.

With the introduction of `named-mailboxes` and removal of
`virtual-mailboxes` special cases, users may prefer to operate with
descriptions instead of (potentially) ugly paths. We can no longer
assume that a buffer is a path and require a method to find by
description.

This is not included as an `mxapi` function since `desc` is common to
all mailboxes so the backends do not need implement their own function.

Index: try description when changing mailboxes

Since mailbox descriptions are more prevalent with `named-mailboxes` and
`virtual-mailbox` special cases being removed, some users will try to
change folders with a description instead of a path.

This commit modifies `main_change_folder()` to look for a mailbox with a
given description if path probing fails.

6 years agodemote 'last message' errors to messages
Richard Russon [Wed, 2 Jan 2019 13:23:22 +0000 (13:23 +0000)]
demote 'last message' errors to messages

These error messages were annoying:
- You are on the last message
- You are on the first message
- Top of message is shown
- Bottom of message is shown

6 years agosolarized dark color scheme: Remove outdated comment about ncurses
Thomas Jarosch [Wed, 2 Jan 2019 11:27:58 +0000 (12:27 +0100)]
solarized dark color scheme: Remove outdated comment about ncurses

slang is no longer a requirement for proper colors, one likely related fix is

commit a7102c721893d6a6fc33a8e9590f99c450e9fe9e
Author: Fabrice Bellet <fabrice@bellet.info>
Date:   Fri Aug 4 21:16:53 2017 +0200

    color: call use_default_colors() in a single location

    we call use_default_colors() when parsing colors in rc files only, and
    unconditionally when defining the color of the tree element, because the
    foreground color of the tree element may be combined dynamically with
    the default background color of another element, not explicitely defined
    in an rc file. This patch fixes a bug visible with some versions of the
    ncurses library: use_default_colors() was used too late, and generated
    color leakage effects. (#689)

-> colors look fine on Fedora 28 with ncurses backend. The comment about slang
was in there since the first submission to git in early 2017.

6 years agoFix use of uninitialized memory in mutt_parse_unmailboxes()
Thomas Jarosch [Sat, 29 Dec 2018 17:44:07 +0000 (18:44 +0100)]
Fix use of uninitialized memory in mutt_parse_unmailboxes()

The buffer 'tmp' is not initialized when clearing all mailboxes,
therefore don't try to use it in mutt_str_strcasecmp().

The issue was uncovered when switching between different accounts,
"unvirtual-mailboxes *" sometimes cleared regular mailboxes, too.

Important bits from the config:

-----------------------------------
unmailboxes *
mailboxes "+INBOX"

unvirtual-mailboxes *
virtual-mailboxes "virtual INBOX" "notmuch://?query=folder:INBOX%20not%20tag:spam%20not%20tag:archive"
-----------------------------------

-> normal "INBOX" sometimes gets cleared.

valgrind backtrace of the issue without the patch:
==223072== Use of uninitialised value of size 8
==223072==    at 0x593E823: tolower (in /usr/lib64/libc-2.27.so)
==223072==    by 0x4C32BC5: strcasecmp (vg_replace_strmem.c:693)
==223072==    by 0x43FFEB: mutt_parse_unmailboxes (mailbox.c:500)
==223072==    by 0x43B134: mutt_parse_rc_line.part.18 (init.c:3145)
==223072==    by 0x43B42B: mutt_parse_rc_line (init.c:3120)
==223072==    by 0x43B42B: source_rc (init.c:823)
==223072==    by 0x43B93A: parse_source (init.c:1845)
==223072==    by 0x43B134: mutt_parse_rc_line.part.18 (init.c:3145)
==223072==    by 0x43B42B: mutt_parse_rc_line (init.c:3120)
==223072==    by 0x43B42B: source_rc (init.c:823)
==223072==    by 0x43C1B2: mutt_init (init.c:3045)
==223072==    by 0x406EB0: main (main.c:688)

The same problem is also present in the official neomutt 2018-07-16,
I've forward-ported and tested the fix for git HEAD.

The code was slightly refactored to be more readable.

6 years agorename menu.h back to mutt_menu.h
Richard Russon [Tue, 1 Jan 2019 11:23:31 +0000 (11:23 +0000)]
rename menu.h back to mutt_menu.h

The short name causes a clash with ncurses on MacPort.

6 years agoimap: command: Adds unique sequence IDs
Mark Stenglein [Tue, 1 Jan 2019 00:57:37 +0000 (19:57 -0500)]
imap: command: Adds unique sequence IDs

This patch adds support for unique sequence IDs to be logged. Each
new imap account is assigned an ID letter (seqid) which increments
to the next letter (and wraps at 'z') each time a new imap account
is created.

Signed-off-by: Mark Stenglein <mark@stengle.in>
6 years agoAdd $auto_subscribe variable.
Kevin McCarthy [Sat, 8 Dec 2018 23:15:56 +0000 (15:15 -0800)]
Add $auto_subscribe variable.

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.

Co-authored-by: Austin Ray <austin@austinray.io>
6 years agomanual: Fix small typo
Thomas Jarosch [Sun, 30 Dec 2018 09:41:06 +0000 (10:41 +0100)]
manual: Fix small typo

6 years agopager: prevent negative index
Richard Russon [Thu, 27 Dec 2018 11:13:32 +0000 (11:13 +0000)]
pager: prevent negative index

6 years agolight tidy
Richard Russon [Thu, 27 Dec 2018 12:11:34 +0000 (12:11 +0000)]
light tidy

6 years agoFix mistaken hdrs -> email
Alvaro Herrera [Thu, 27 Dec 2018 18:25:17 +0000 (15:25 -0300)]
Fix mistaken hdrs -> email

Search & replace was a bit too enthusiastic, causing some config files
to become invalid, and giving an invalid example.

6 years agorefactor hash
Richard Russon [Sat, 22 Dec 2018 21:28:22 +0000 (21:28 +0000)]
refactor hash

6 years agolight tidying
Richard Russon [Sat, 22 Dec 2018 20:47:49 +0000 (20:47 +0000)]
light tidying

6 years agoimap: remove ImapCache
Mehdi Abaakouk [Fri, 21 Dec 2018 18:28:19 +0000 (19:28 +0100)]
imap: remove ImapCache

The ImapCache is useless since it's used only when we fail bcache.
And this is not really expected.

6 years agombox: allow non-file mailboxes
Richard Russon [Fri, 21 Dec 2018 16:54:46 +0000 (16:54 +0000)]
mbox: allow non-file mailboxes

We disallow directories, but allow files or other devices.
This means we can run `neomutt -f /dev/null` again.

6 years agomxapi: fix creation of new mailboxes
Richard Russon [Fri, 21 Dec 2018 13:17:01 +0000 (13:17 +0000)]
mxapi: fix creation of new mailboxes

6 years agombox: fix dodgy stat buffer
Richard Russon [Fri, 21 Dec 2018 12:31:08 +0000 (12:31 +0000)]
mbox: fix dodgy stat buffer

6 years agofix email macros
Richard Russon [Thu, 20 Dec 2018 14:29:41 +0000 (14:29 +0000)]
fix email macros

6 years agomailbox: rename hdrmax to email_max
Richard Russon [Thu, 20 Dec 2018 14:33:15 +0000 (14:33 +0000)]
mailbox: rename hdrmax to email_max

6 years agomailbox: rename hdrs to emails
Richard Russon [Thu, 20 Dec 2018 14:21:37 +0000 (14:21 +0000)]
mailbox: rename hdrs to emails

6 years agomxapi: remove Context from mbox_close()
Richard Russon [Thu, 20 Dec 2018 13:12:08 +0000 (13:12 +0000)]
mxapi: remove Context from mbox_close()

6 years agoimap: Don't use Context in imap_mbox_close
Mehdi Abaakouk [Thu, 20 Dec 2018 06:48:42 +0000 (07:48 +0100)]
imap: Don't use Context in imap_mbox_close