]> granicus.if.org Git - neomutt/log
neomutt
7 years agoRemove snprintf.c from EXTRA_DIST (#406)
Pietro Cerutti [Thu, 16 Feb 2017 07:16:31 +0000 (07:16 +0000)]
Remove snprintf.c from EXTRA_DIST (#406)

Pull #402

7 years agoKill homebrew (v)snprintf implementations, as they are C99 (#402)
Pietro Cerutti [Thu, 16 Feb 2017 06:53:52 +0000 (06:53 +0000)]
Kill homebrew (v)snprintf implementations, as they are C99 (#402)

7 years agoMerge pull request #400 from neomutt/devel/issue-336
Pierre-Elliott Bécue [Wed, 15 Feb 2017 09:14:13 +0000 (10:14 +0100)]
Merge pull request #400 from neomutt/devel/issue-336

Avoid browsing the remote spoolfile by setting MUTT_SELECT_MULTI attach

7 years agonotmuch: fix crash when completing tags (#395)
William Pettersson [Tue, 14 Feb 2017 18:24:02 +0000 (05:24 +1100)]
notmuch: fix crash when completing tags (#395)

Notmuch was found to sometimes return a NULL when asked for a list of
tags.  This caused mutt to crash when trying to autocomplete.

Thanks to William Pettersson (@WPettersson) for the initial patch.

Closes #393
Closes #395

7 years agoDisplay charset + small refactoring
Pietro Cerutti [Sat, 11 Feb 2017 17:24:34 +0000 (17:24 +0000)]
Display charset + small refactoring

7 years agoAdd option $show_multipart_alternative
Ismaël Bouya [Fri, 10 Feb 2017 20:10:05 +0000 (21:10 +0100)]
Add option $show_multipart_alternative

When viewing a multi-part MIME email:
    'alternative_order' determines which part is displayed
    'auto_view' determines how the part is displayed

$show_multipart_alternative has three options to control what is displayed:
    unset    Only the chosen part (default)
    'info'   The chosen part plus information about the other parts
    'inline' All the parts

7 years agobuild: add a few includes (prelude to clang-format)
Richard Russon [Thu, 26 Jan 2017 01:22:19 +0000 (01:22 +0000)]
build: add a few includes (prelude to clang-format)

7 years agobuild: slcurses.h defines its own bool type
Richard Russon [Tue, 14 Feb 2017 16:16:15 +0000 (16:16 +0000)]
build: slcurses.h defines its own bool type

7 years agoAvoid browsing the remote spoolfile by setting MUTT_SELECT_MULTI attach 400/head
Pietro Cerutti [Sun, 5 Feb 2017 15:59:17 +0000 (15:59 +0000)]
Avoid browsing the remote spoolfile by setting MUTT_SELECT_MULTI attach

Closes #336

7 years agoFixes missing failure return of notmuch msg open (#401)
guyzmo [Tue, 14 Feb 2017 14:49:32 +0000 (15:49 +0100)]
Fixes missing failure return of notmuch msg open (#401)

When calling the mx_ops->open_msg() method of the notmuch
implementation, if the message failed to open, it is not reported to the
user interface. This patch returns a non-zero value that will prevent a
crash.

fixes #308

Signed-off-by: Pietro Cerutti <gahr@gahr.ch>
Signed-off-by: Guyzmo <guyzmo+github+pub@m0g.net>
7 years agoDo not cast or check returns from safe_calloc (#396)
Pietro Cerutti [Mon, 13 Feb 2017 12:38:36 +0000 (12:38 +0000)]
Do not cast or check returns from safe_calloc (#396)

Fixes #388

7 years agoFix latest Coverity issues (#387)
Pietro Cerutti [Fri, 10 Feb 2017 17:14:13 +0000 (17:14 +0000)]
Fix latest Coverity issues (#387)

* Fix two use-before-check bugs

Closes #386

* Fix memory leak

Issue #386

* Treat a NULL b->subtype as a wildcard (*)

Issue #386

* Move assignment out of conditional

Closes #386

* Move assignment out of conditional (2)

Closes #386

7 years agoAdvance by the correct number of position even for unknown characters (#368)
Pietro Cerutti [Fri, 10 Feb 2017 17:09:51 +0000 (17:09 +0000)]
Advance by the correct number of position even for unknown characters (#368)

Closes #245

7 years agomerge: sync to mutt/default
Richard Russon [Fri, 10 Feb 2017 15:15:13 +0000 (15:15 +0000)]
merge: sync to mutt/default

I've been cherry-picking all of mutt's upstream changes.
This gave us a neat and tidy commit history, but GitHub thinks we're
very out-of-sync.

This merge doesn't make any changes, but shows GitHub where we are.

7 years agomerge: upstream fixes (mutt/default)
Richard Russon [Fri, 10 Feb 2017 15:13:47 +0000 (15:13 +0000)]
merge: upstream fixes (mutt/default)

 * Canonicalize line endings for GPGME S/MIME encryption. (closes #3904)
 * Add a pattern_cache_t to speed up a few repeated matches.
 * Fix imap server-side search to call uid2msgno() only once. (see #3905)
 * Convert HASH to be indexable by unsigned int. (see #3905)
 * Create a uid hash for imap. (see #3905)
 * Convert cmd_parse_search to use the uid hash. (closes #3905)
 * Fix minor documentation issues.
 * Allow initial blank lines in local mailboxes.
 * Improve error handling in mbox magic detection.
 * Add casecmp and strdup_key flags to hash_create()
 * Fix several alias hashtable issues.
 * Fix sidebar references to the "new count" to be "unread". (closes #3908)
 * Improve Reply-to vs From comparison when replying. (closes #3909)
 * Abstract the SPAM_LIST as a generic REPLACE_LIST
 * Add subjectrx command to replace matching subjects with something else.
 * Allow "unsubjectrc *" to remove all patterns.
 * Adds capability to edit x-labels inside mutt, and to sort by label.
 * Minor fixes to the x-label patch from David.
 * Add hash_find_elem to get the hash element.
 * Adds label completion.
 * Improve the label completion hash table usage.
 * Fix the x-label update code check location.
 * Fix the mutt_label_complete() pos parameter.
 * Permit tab completion of pattern expressions with ~y (labels).
 * Simplify mutt_label_complete().

7 years agoSimplify mutt_label_complete(). 385/head
Kevin McCarthy [Tue, 31 Jan 2017 22:27:36 +0000 (14:27 -0800)]
Simplify mutt_label_complete().

It was derived from mutt_command_complete(), which had more complex
requirements.  For labels, we just need to skip whitespace and
complete based on the passed in buffer.

Therefore, we don't need the pos parameter, or to work backwards from
the end of the buffer.

7 years agoPermit tab completion of pattern expressions with ~y (labels).
Kevin McCarthy [Tue, 31 Jan 2017 22:27:28 +0000 (14:27 -0800)]
Permit tab completion of pattern expressions with ~y (labels).

Thanks to David Champion for the original patch.  This version is
slightly different, as I couldn't get the original patch working.
This version simply scans backward for the first ~, and if it is ~y,
invokes completion.

7 years agoFix the mutt_label_complete() pos parameter.
Kevin McCarthy [Tue, 31 Jan 2017 22:27:09 +0000 (14:27 -0800)]
Fix the mutt_label_complete() pos parameter.

i is the state->wbuf index, not the end of the buf.  It was "working"
only because the contents of buf past the null were not "space" most
of the time.

7 years agoFix the x-label update code check location.
Kevin McCarthy [Sun, 29 Jan 2017 19:02:50 +0000 (11:02 -0800)]
Fix the x-label update code check location.

The x-label comparison was outside the "beginning of header" block.

This meant that it could theoretically match a continuation line.
Additionally, the continuation lines of x-labels would not be
stripped, because the comparison was after the ignore variable was
reset.

Move the comparison inside the block and before the ignore reset.

7 years agoImprove the label completion hash table usage.
Kevin McCarthy [Sun, 29 Jan 2017 02:48:08 +0000 (18:48 -0800)]
Improve the label completion hash table usage.

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.

7 years agoAdds label completion.
David Champion [Sun, 29 Jan 2017 02:47:57 +0000 (18:47 -0800)]
Adds label completion.

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'.

7 years agoAdd hash_find_elem to get the hash element.
Kevin McCarthy [Sun, 29 Jan 2017 02:47:48 +0000 (18:47 -0800)]
Add hash_find_elem to get the hash element.

This will be used in the following patch for directly manipulating the
label counter.

7 years agoMinor fixes to the x-label patch from David.
Kevin McCarthy [Sun, 29 Jan 2017 02:47:26 +0000 (18:47 -0800)]
Minor fixes to the x-label patch from David.

Add L10N comment to sort menu.  Mark a couple strings for localization.

Use ascii_strncasecmp() for the X-Label header comparison.

Simplify label_message() using mutt library routines.

Bind label editing to "Y" instead of "y".  "y" is already used in the
default sample muttrc to display mailboxes.

7 years agoAdds capability to edit x-labels inside mutt, and to sort by label.
David Champion [Sun, 29 Jan 2017 02:47:15 +0000 (18:47 -0800)]
Adds capability to edit x-labels inside mutt, and to sort by label.

7 years agoAllow "unsubjectrc *" to remove all patterns.
Kevin McCarthy [Tue, 24 Jan 2017 23:33:23 +0000 (15:33 -0800)]
Allow "unsubjectrc *" to remove all patterns.

Thanks to Aaron Schrab for the original patch.

7 years agoAdd subjectrx command to replace matching subjects with something else.
David Champion [Tue, 24 Jan 2017 03:01:50 +0000 (19:01 -0800)]
Add subjectrx command to replace matching subjects with something else.

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.

7 years agoAbstract the SPAM_LIST as a generic REPLACE_LIST
David Champion [Tue, 24 Jan 2017 03:01:36 +0000 (19:01 -0800)]
Abstract the SPAM_LIST as a generic REPLACE_LIST

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().

7 years agoImprove Reply-to vs From comparison when replying. (closes #3909)
Kevin McCarthy [Tue, 24 Jan 2017 02:46:16 +0000 (18:46 -0800)]
Improve Reply-to vs From comparison when replying. (closes #3909)

Prior to this patch, if the Reply-to mailbox matched the From mailbox,
mutt would always use the From address.  This was probably done to
preserve the display name, as the Reply-to address is often missing one.

Unfortunately, there are circumstances where the Reply-to display-name
has significance, such as in ticket 3909.

Change mutt so that it only uses the From address if the Reply-To has
no display-name.

7 years agoFix sidebar references to the "new count" to be "unread". (closes #3908)
Kevin McCarthy [Thu, 19 Jan 2017 22:58:13 +0000 (14:58 -0800)]
Fix sidebar references to the "new count" to be "unread". (closes #3908)

%N in $sidebar_format and "new"in $sidebar_sort_method actually use
the unread message count.  Update the documentation to mention that.

Add an "unread" method to $sidebar_sort_method, but preserve "new" for
compatibility.

Change the SORT_COUNT_NEW constant to SORT_UNREAD, so the code is also
consistent with the meaning.

Thanks to cri for reporting the problem and suggesting where to fix it
in the code.

7 years agoFix several alias hashtable issues.
Kevin McCarthy [Wed, 18 Jan 2017 00:09:16 +0000 (16:09 -0800)]
Fix several alias hashtable issues.

Convert to use the strdup keys hash.  Addresses can be converted back
and forth from intl to local forms.  This frees and recreates a new
addr->mailbox string, resulting in the hash table key being a dangling
pointer.

Change alias hash table insert/remove to ensure the address is in intl
form.  The alias menu (previously) converted address entries to local
form when performing a completion.  Even with the pointer issue fixed,
the entries may not be removed from the hash if the intl and local
forms are different.

Lastly, there is no reason for the alias menu to manually convert to
local form before writing the address to the output buffer.
rfc822_write_address() has a display parameter that will call
mutt_addr_for_display() instead when set.  Change to set the display
parameter and remove the conversion calls.

This last change obviates the first two changes, but they are a good idea
in any case.

7 years agoAdd casecmp and strdup_key flags to hash_create()
Kevin McCarthy [Wed, 18 Jan 2017 00:09:11 +0000 (16:09 -0800)]
Add casecmp and strdup_key flags to hash_create()

Aliases and (in the future), X-Label hashes will require a hash that
strdups the key.  Convert the casecmp parameter of hash_create() to a
flags parameter, and add a flag to strdup the keys.

7 years agoImprove error handling in mbox magic detection.
Kevin McCarthy [Sun, 15 Jan 2017 18:00:55 +0000 (10:00 -0800)]
Improve error handling in mbox magic detection.

Thanks to Simon Ruderich for pointing out several small issues with
the previous commit.

7 years agoAllow initial blank lines in local mailboxes.
David Champion [Sun, 15 Jan 2017 03:18:45 +0000 (19:18 -0800)]
Allow initial blank lines in local mailboxes.

Some mailbox-creation tools erroneously append a blank line to a file
before appending a UNIXv7-format mail message, resulting in mailboxes
that are intended to be valid "mbox" folders but are not.  Notably old
versions of Mailman do this, making archive files that cannot be read by
mutt.

This patch causes mutt to skip leading NLs and CRs when detecting magic.

7 years agoFix minor documentation issues.
Simon Ruderich [Tue, 10 Jan 2017 22:48:08 +0000 (14:48 -0800)]
Fix minor documentation issues.

manual.xml:
Wrap line for clarity.

muttrc.man:
Remove superfluous spaces in brackets.
Add missing error object in color command.
Sort the prompt object.
Add sidebar color objects.

7 years agoConvert cmd_parse_search to use the uid hash. (closes #3905)
Kevin McCarthy [Fri, 6 Jan 2017 22:37:48 +0000 (14:37 -0800)]
Convert cmd_parse_search to use the uid hash. (closes #3905)

Replace the linear scan for each result with a hash lookup.  This
should greatly improve performance for large mailboxes.

7 years agoCreate a uid hash for imap. (see #3905)
Kevin McCarthy [Fri, 6 Jan 2017 22:23:28 +0000 (14:23 -0800)]
Create a uid hash for imap. (see #3905)

This hash will allow for more efficient UID SEARCH processing,
replacing a linear scan with a hash lookup.

7 years agoConvert HASH to be indexable by unsigned int. (see #3905)
Kevin McCarthy [Fri, 6 Jan 2017 22:17:10 +0000 (14:17 -0800)]
Convert HASH to be indexable by unsigned int. (see #3905)

Convert the HASH to be usable for either string or unsigned int keys,
so that a uid hash can be added for imap.

To keep hash-usage code disruption to a minimum, this introduces new
create/insert/find/delete functions for the int hash, but keeps the
old function names for string keys.

This implementation makes the key a union.  It may have been a better
idea to introduce a whole new structure, but this way allows minimum
changes to and maximum reuse of the existing hash code.

7 years agoFix imap server-side search to call uid2msgno() only once. (see #3905)
Kevin McCarthy [Thu, 5 Jan 2017 03:45:59 +0000 (19:45 -0800)]
Fix imap server-side search to call uid2msgno() only once. (see #3905)

After performing a UID SEARCH, the results are parsed in
cmd_parse_search().  This was accidentally calling uid2msgno() twice.
Since that function does a linear search, this has a noticable impact
on large search results.

7 years agoAdd a pattern_cache_t to speed up a few repeated matches.
Kevin McCarthy [Tue, 3 Jan 2017 02:08:17 +0000 (18:08 -0800)]
Add a pattern_cache_t to speed up a few repeated matches.

Vincent Lefèvre reported experiencing an index display performance
issue.  This occurred with messages containing many recipients.  He
had many index color lines containing ~l.  The ~l ended up being run
over and over on these messages, resulting in a noticable slowdown
displaying the index.

This patch adds caching for just a few of the pattern operations (~l,
~u, ~p, ~P) that are potentially expensive and also don't have
arguments.  The caching is only enabled for operations repeatedly
matching against the same message: color, hooks, scoring.

The caching is fairly targeted, but isn't that invasive or
complicated.

7 years agoCanonicalize line endings for GPGME S/MIME encryption. (closes #3904)
Kevin McCarthy [Sun, 1 Jan 2017 03:57:07 +0000 (19:57 -0800)]
Canonicalize line endings for GPGME S/MIME encryption. (closes #3904)

This matches the behavior for S/MIME classic mode: OpenSSL converts
the line endings to cr/lf before encrypting.  Although Mutt always
canonicalizes the line endings before verifying the signature, some
clients do not do this for encrypted messages.

Thanks to cooler for the patch!

7 years agoRelease KyotoCabinet data with kcfree() (#384)
Pietro Cerutti [Fri, 10 Feb 2017 03:29:36 +0000 (03:29 +0000)]
Release KyotoCabinet data with kcfree() (#384)

Obtained from https://dev.mutt.org/hg/mutt/rev/09bb4a62ceb1

Closes #383

7 years agorefactor: create a generic base64 encode/decode
Damien Riegel [Sun, 5 Feb 2017 01:51:17 +0000 (20:51 -0500)]
refactor: create a generic base64 encode/decode

- make sendlib use generic base64 encode function

Sendlib had its own implementation for base64 encoding, so change it to
make use of the generic one defined in base64.c. While we're at it, move
the B64Chars where it belongs, and remove some global variables by
creating a b64_context structure to hold all necessary information.

- make rfc2047 use generic base64 encode function

This was another source of a custom base64 encode function. Let's keep
the same logic as before: encode 3 bytes (or less) at a time. Also,
switch from a `for` to a `while` loop as `dlen` can simply be used as a
stop condition.

- B64Chars can now be made static to base64.c.

closes #360

7 years agodebug: remove dprint in favor of mutt_debug (#375)
Damien R [Thu, 9 Feb 2017 21:16:07 +0000 (16:16 -0500)]
debug: remove dprint in favor of mutt_debug (#375)

The dprint macro is error-prone. Any FILE* can be passed to dprint, but
the macro checks that `debugfile` is not NULL (ie. it's open), not the
file pointer it received as parameter. This had also the consequence
that `debugfile` is passed to every call to `dprint`, making lines
unnecessarily long.

This commit replaces calls to `dprint` by direct calls to `mutt_debug`.
It's now hardcoded in this function that it will write in `debugfile`.
Also, remove the MUTT_LIB_WHERE magic.

The substistution has been done with the following command:
   perl -0777 -pi -e 's/dprint[ ]*\((.+?),[ \t\r\n]*\(debugfile,[ ]*(.*?)\)\);/mutt_debug (\1, \2);/igs' *.c imap/*.c
And the code was then slightly ajusted to fix identation and line
length.

Closes #362

7 years agoFix dubious use macro for _() / gettext() (#376)
Richard Russon [Thu, 9 Feb 2017 19:16:50 +0000 (19:16 +0000)]
Fix dubious use macro for _() / gettext() (#376)

The macro _() is defined as:

    #define _(a) (gettext(a))

Which has led to a lot of functions omitting the ()s, e.g.

    mutt_message _("string");

This only compiles because of a side-effect of the macro.

In addition, some translatable strings didn't have a _()
wrapper, so it was added

7 years agoUse mutt_buffer_init instead of memset 370/head
Guillaume Brogi [Mon, 6 Feb 2017 19:27:10 +0000 (20:27 +0100)]
Use mutt_buffer_init instead of memset

The mutt_buffer_init function does a memset to 0 of its argument, so use
it instead of doing a manual memset.

I noticed (thanks to @zmo) that a number of buffer used in hooks where
initialised using memset instead of this dedicated function. This
remedies to that.

Fixes #369

7 years agoMake the heap method and datatype a plain list 380/head
Guyzmo [Wed, 8 Feb 2017 18:41:00 +0000 (19:41 +0100)]
Make the heap method and datatype a plain list

Instead of a useless typedef, making all the stack operations work on
plain LIST types.

N.B.: I used *heap* when I really meant *stack*.

Signed-off-by: Guyzmo <guyzmo+github+pub@m0g.net>
7 years agoReverts making AliasFile into a list_t (#379)
guyzmo [Thu, 9 Feb 2017 17:27:46 +0000 (18:27 +0100)]
Reverts making AliasFile into a list_t (#379)

Uses the first loaded muttrc file as default for alias file.

This partially reverts commit 83f7558efab3dcd7b7e227a727ef95f711363f50.

fixes #378

Signed-off-by: Guyzmo <guyzmo+github+pub@m0g.net>
7 years agoFix build for bdb.
Kevin McCarthy [Wed, 8 Feb 2017 15:48:07 +0000 (07:48 -0800)]
Fix build for bdb.

Changeset fca7e504ab6a removed #else/#endif around two blocks of code
that won't compile with bdb enabled.  Restore those directives.

Thanks to Richard Russon for pointing out the problem and saving me
from having egg all over my face with the 1.8 release!

7 years agoTurn mutt_new_* macros into inline functions
Pietro Cerutti [Tue, 7 Feb 2017 12:21:51 +0000 (12:21 +0000)]
Turn mutt_new_* macros into inline functions

Closes #372

7 years agoDo not cast return values from malloc (et similia)
Pietro Cerutti [Tue, 7 Feb 2017 09:27:06 +0000 (09:27 +0000)]
Do not cast return values from malloc (et similia)

Closes #372

7 years agoCreate function to free header cache data.
Kevin McCarthy [Wed, 8 Feb 2017 03:36:43 +0000 (19:36 -0800)]
Create function to free header cache data.

Kyoto Cabinet documents that data from it should be freed via
kcfree().

LMDB claims ownership of the data returned, so convert its free
operation to be a noop and remove the malloc from its fetch function.

7 years agoAdd Kyoto Cabinet support to the header cache.
Kevin McCarthy [Wed, 8 Feb 2017 03:36:37 +0000 (19:36 -0800)]
Add Kyoto Cabinet support to the header cache.

Retain the defaults as they are, although we might switch to Kyoto
Cabinet for the next major release.

7 years agodoc: fix confusing description of notmuch operators (#371)
Tobias Angele [Tue, 7 Feb 2017 20:53:56 +0000 (21:53 +0100)]
doc: fix confusing description of notmuch operators (#371)

8 years agoTry (once) to reconnect after an IMAP failure (#366)
Pietro Cerutti [Mon, 6 Feb 2017 15:36:50 +0000 (15:36 +0000)]
Try (once) to reconnect after an IMAP failure (#366)

* Try (once) to reconnect after an IMAP failure

Closes #346

* Keep recovering state in IMAP_DATA instead of in a static local variable

Closes #346

8 years agoSimplify imap_keepalive + some cleanup (#354)
Pietro Cerutti [Mon, 6 Feb 2017 15:03:41 +0000 (15:03 +0000)]
Simplify imap_keepalive + some cleanup (#354)

8 years agoNeoMutt 2017-02-06 (1.7.2) neomutt-20170206
Richard Russon [Mon, 6 Feb 2017 13:10:29 +0000 (13:10 +0000)]
NeoMutt 2017-02-06 (1.7.2)

8 years agoUnicode 0x202F is a non-break space too (#358)
Pietro Cerutti [Sun, 5 Feb 2017 22:19:47 +0000 (22:19 +0000)]
Unicode 0x202F is a non-break space too (#358)

Closes #357

8 years agoimprove readability of find_subject()
toogley [Sun, 5 Feb 2017 12:17:12 +0000 (13:17 +0100)]
improve readability of find_subject()

8 years agoImport hcache-lmdb fixes from upstream (#363)
Pietro Cerutti [Sun, 5 Feb 2017 15:17:13 +0000 (15:17 +0000)]
Import hcache-lmdb fixes from upstream (#363)

Adopted from https://dev.mutt.org/hg/mutt/rev/fca7e504ab6a

Use mdb_txn_abort() to free up readonly/reset transactions, and avoid
leaking memory.

Use dprint, not fprintf, for debugging messages.

Remove strange blending of enum and bitfield logic for the txn_mode
state.

Closes #359

8 years agoRework the "inbox-first" implementation to make code self-explanatory (#356)
Pietro Cerutti [Sun, 5 Feb 2017 14:22:25 +0000 (14:22 +0000)]
Rework the "inbox-first" implementation to make code self-explanatory (#356)

Do not sort INBOX before its parent folder

This is achieved by considering /a/b/ and /a/b/c/d as different
subpaths, thus avoiding this situation

/a/b/INBOX
/a/b/

Closes #301

8 years agoFixes to the LMDB header cache. (closes #3691)
Kevin McCarthy [Sat, 4 Feb 2017 20:53:52 +0000 (12:53 -0800)]
Fixes to the LMDB header cache. (closes #3691)

Use mdb_txn_abort() to free up readonly/reset transactions, and avoid
leaking memory.

Fix hcache_delete() key generation - looks like this was an incorrect
copy/paste from the bdb code.

Use dprint, not fprintf, for debugging messages.

Remove strange blending of enum and bitfield logic for the txn_mode
state.

Remove some duplicate code from store/fetch raw.

8 years agoAdd LMDB backend support for header cache. (see #3691)
Kevin McCarthy [Sat, 4 Feb 2017 20:53:38 +0000 (12:53 -0800)]
Add LMDB backend support for header cache. (see #3691)

Based on the original from JP Mens:
https://gist.github.com/jpmens/15969d9d678a3d450e4e

The following performance patch was manually applied on top of the
original patch:
https://github.com/neomutt/neomutt/commit/7e5380cd4c40d119ff83b2cf5f51f2cdb8a95ab3

A variant of this patch was added to handle larger mailboxes:
https://github.com/neomutt/neomutt/commit/6d337642e701b1dde4b5d0812e01c85f41ba65ca

Thanks to all the developers and contributors to this patch, and to
Fabian Groffen for bundling and posting this to mutt-dev.

8 years agoIf possible, only redraw after gpgme has invoked pinentry (#352)
Pietro Cerutti [Wed, 1 Feb 2017 15:52:40 +0000 (15:52 +0000)]
If possible, only redraw after gpgme has invoked pinentry (#352)

If possible, only redraw after gpgme has invoked pinentry

This requires gpgme >= 1.8.1, which exposes a new "redraw" status flag.
On older versions, fallback to always redraw if pinentry was potentially called.
Thanks to Werner Koch for the hints!

8 years agofix: bug introduced by mkdir changes (#350)
Richard Russon [Wed, 1 Feb 2017 13:31:11 +0000 (13:31 +0000)]
fix: bug introduced by mkdir changes (#350)

When converting NNTP to use mutt_mkdir() a line of code got lost.
Commit: 6800b2a nntp: use mutt_mkdir

Closes #338

8 years agoRemove two use-after free in global hooks (#353)
guiniol [Wed, 1 Feb 2017 13:26:35 +0000 (14:26 +0100)]
Remove two use-after free in global hooks (#353)

Fixes #347
In both mutt_timeout_hook and mutt_startup_shutdown_hook, we iterate on
the list of hooks and try to execute the right ones, always using the
same buffer. The buffer must be free'd after all the hooks have been
checked and not after the first hook which fails. This also removes a
memory leak, because the buffer was never freed if no hook failed.

8 years agoMinor fix to ~y completion.
Kevin McCarthy [Tue, 31 Jan 2017 23:02:21 +0000 (15:02 -0800)]
Minor fix to ~y completion.

Make sure the entire ~y is before curpos when enabling completion.

8 years agoSimplify mutt_label_complete().
Kevin McCarthy [Tue, 31 Jan 2017 22:27:36 +0000 (14:27 -0800)]
Simplify mutt_label_complete().

It was derived from mutt_command_complete(), which had more complex
requirements.  For labels, we just need to skip whitespace and
complete based on the passed in buffer.

Therefore, we don't need the pos parameter, or to work backwards from
the end of the buffer.

8 years agoPermit tab completion of pattern expressions with ~y (labels).
Kevin McCarthy [Tue, 31 Jan 2017 22:27:28 +0000 (14:27 -0800)]
Permit tab completion of pattern expressions with ~y (labels).

Thanks to David Champion for the original patch.  This version is
slightly different, as I couldn't get the original patch working.
This version simply scans backward for the first ~, and if it is ~y,
invokes completion.

8 years agoFix the mutt_label_complete() pos parameter.
Kevin McCarthy [Tue, 31 Jan 2017 22:27:09 +0000 (14:27 -0800)]
Fix the mutt_label_complete() pos parameter.

i is the state->wbuf index, not the end of the buf.  It was "working"
only because the contents of buf past the null were not "space" most
of the time.

8 years agoHandle BAD as IMAP_AUTH_UNAVAIL (#351)
Pietro Cerutti [Tue, 31 Jan 2017 15:25:43 +0000 (15:25 +0000)]
Handle BAD as IMAP_AUTH_UNAVAIL (#351)

* Handle BAD as IMAP_AUTH_UNAVAIL

Closes #348

8 years agochange pager to allow timehook-hook to fire
Richard Russon [Tue, 31 Jan 2017 11:51:36 +0000 (11:51 +0000)]
change pager to allow timehook-hook to fire

Closes #241

8 years agoDo not crash when closing a non-opened mailbox
Pietro Cerutti [Mon, 30 Jan 2017 10:35:17 +0000 (10:35 +0000)]
Do not crash when closing a non-opened mailbox

Issue: #342

8 years agoUpdate documentation about modify-labels-then-hide
Bryan Bennett [Mon, 30 Jan 2017 21:48:46 +0000 (16:48 -0500)]
Update documentation about modify-labels-then-hide

This will inform new users regarding the need to call <sync-mailbox> after calling this function

Closes #345, closes #332

8 years agoImport hcache benchmark
Pietro Cerutti [Fri, 27 Jan 2017 17:10:58 +0000 (17:10 +0000)]
Import hcache benchmark

8 years agoFix the x-label update code check location.
Kevin McCarthy [Sun, 29 Jan 2017 19:02:50 +0000 (11:02 -0800)]
Fix the x-label update code check location.

The x-label comparison was outside the "beginning of header" block.

This meant that it could theoretically match a continuation line.
Additionally, the continuation lines of x-labels would not be
stripped, because the comparison was after the ignore variable was
reset.

Move the comparison inside the block and before the ignore reset.

8 years agoImprove the label completion hash table usage.
Kevin McCarthy [Sun, 29 Jan 2017 02:48:08 +0000 (18:48 -0800)]
Improve the label completion hash table usage.

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.

8 years agoAdds label completion.
David Champion [Sun, 29 Jan 2017 02:47:57 +0000 (18:47 -0800)]
Adds label completion.

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'.

8 years agoAdd hash_find_elem to get the hash element.
Kevin McCarthy [Sun, 29 Jan 2017 02:47:48 +0000 (18:47 -0800)]
Add hash_find_elem to get the hash element.

This will be used in the following patch for directly manipulating the
label counter.

8 years agoAdd reentrant hash_walk() function for iterating down a hash table.
David Champion [Sun, 29 Jan 2017 02:47:41 +0000 (18:47 -0800)]
Add reentrant hash_walk() function for iterating down a hash table.

8 years agoMinor fixes to the x-label patch from David.
Kevin McCarthy [Sun, 29 Jan 2017 02:47:26 +0000 (18:47 -0800)]
Minor fixes to the x-label patch from David.

Add L10N comment to sort menu.  Mark a couple strings for localization.

Use ascii_strncasecmp() for the X-Label header comparison.

Simplify label_message() using mutt library routines.

Bind label editing to "Y" instead of "y".  "y" is already used in the
default sample muttrc to display mailboxes.

8 years agoAdds capability to edit x-labels inside mutt, and to sort by label.
David Champion [Sun, 29 Jan 2017 02:47:15 +0000 (18:47 -0800)]
Adds capability to edit x-labels inside mutt, and to sort by label.

8 years agoNeoMutt 2017-01-28 (1.7.2) 312/head neomutt-20170128
Richard Russon [Sat, 28 Jan 2017 15:02:02 +0000 (15:02 +0000)]
NeoMutt 2017-01-28 (1.7.2)

8 years agoFix typo in comment
Elimar Riesebieter [Fri, 27 Jan 2017 08:47:23 +0000 (08:47 +0000)]
Fix typo in comment

8 years agofix global hooks to not take a pattern
Guillaume Brogi [Tue, 24 Jan 2017 21:06:28 +0000 (22:06 +0100)]
fix global hooks to not take a pattern

Closes #329
Closes #330

8 years agodocs: Added waffle badges to readme
Guyzmo [Sun, 22 Jan 2017 10:11:21 +0000 (11:11 +0100)]
docs: Added waffle badges to readme

Closes #317

8 years agobuild: appease check_sec.sh
Richard Russon [Wed, 25 Jan 2017 20:00:51 +0000 (20:00 +0000)]
build: appease check_sec.sh

8 years agoMerge pull request #327 from neomutt/devel/issue-325
Pietro Cerutti [Wed, 25 Jan 2017 16:02:28 +0000 (16:02 +0000)]
Merge pull request #327 from neomutt/devel/issue-325

Remove in-house implementations of various Std C / POSIX.1 APIs

8 years agoAllow "unsubjectrc *" to remove all patterns.
Kevin McCarthy [Tue, 24 Jan 2017 23:33:23 +0000 (15:33 -0800)]
Allow "unsubjectrc *" to remove all patterns.

Thanks to Aaron Schrab for the original patch.

8 years agoRemove most ascii_ functions 327/head
Pietro Cerutti [Tue, 24 Jan 2017 11:35:58 +0000 (11:35 +0000)]
Remove most ascii_ functions

Issue: #325

8 years agoAssume ANSI C headers are there
Pietro Cerutti [Mon, 23 Jan 2017 17:11:47 +0000 (17:11 +0000)]
Assume ANSI C headers are there

Issue: #325

8 years agoRemove in-house implementation of mkdtemp
Pietro Cerutti [Mon, 23 Jan 2017 16:55:22 +0000 (16:55 +0000)]
Remove in-house implementation of mkdtemp

Issue: #325

8 years agoMention that strcasestr doesn't exist on AIX
Pietro Cerutti [Mon, 23 Jan 2017 16:40:54 +0000 (16:40 +0000)]
Mention that strcasestr doesn't exist on AIX

Issue: #325

8 years agoRemove in-house implementation of strtok_r
Pietro Cerutti [Mon, 23 Jan 2017 16:33:35 +0000 (16:33 +0000)]
Remove in-house implementation of strtok_r

Issue: #325

8 years agoRemove in-house implementation of strsep
Pietro Cerutti [Mon, 23 Jan 2017 16:18:14 +0000 (16:18 +0000)]
Remove in-house implementation of strsep

Issue: #325

8 years agoRemove in-house implementation of setenv
Pietro Cerutti [Mon, 23 Jan 2017 14:45:25 +0000 (14:45 +0000)]
Remove in-house implementation of setenv

Issue: #325

8 years agoRemove str(n)casecmp declarations
Pietro Cerutti [Mon, 23 Jan 2017 14:33:49 +0000 (14:33 +0000)]
Remove str(n)casecmp declarations

Issue: #325

8 years agoRemove in-house implementations of strcasecmp and strncasecmp
Pietro Cerutti [Mon, 23 Jan 2017 13:58:08 +0000 (13:58 +0000)]
Remove in-house implementations of strcasecmp and strncasecmp

Issue: #325

8 years agonotmuch: fix toggle labels
Richard Russon [Tue, 24 Jan 2017 18:58:38 +0000 (18:58 +0000)]
notmuch: fix toggle labels

Fix the comparison of labels when toggling.

Thanks to Pietro Cerutti (@gahr) for spotting this.

8 years agonotmuch: Allow <modify-labels> to toggle labels
Bryan Bennett [Tue, 24 Jan 2017 15:49:14 +0000 (10:49 -0500)]
notmuch: Allow <modify-labels> to toggle labels

<modify-labels> can, now:
    tag     add a tag
    +tag    add a tag
    -tag    remove a tag
    !tag    toggle a tag

Closes #326
Closes #328

8 years agofix bug in "Support for aborting mailbox loading"
Richard Russon [Tue, 24 Jan 2017 17:20:27 +0000 (17:20 +0000)]
fix bug in "Support for aborting mailbox loading"

A typo would have prevented mbox_parse_mailbox() from working correctly.
Also, add a few comments.

Thanks to Pietro Cerutti (@gahr) for spotting this.