]> granicus.if.org Git - neomutt/log
neomutt
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

6 years agoimap: Move Context to ImapMboxData
Mehdi Abaakouk [Thu, 20 Dec 2018 07:50:59 +0000 (08:50 +0100)]
imap: Move Context to ImapMboxData

6 years agonntp: fix hcache unterminated string
Richard Russon [Mon, 17 Dec 2018 23:10:31 +0000 (23:10 +0000)]
nntp: fix hcache unterminated string

6 years agobuild: add -lgpg-error to gpgme build
Pietro Cerutti [Mon, 17 Dec 2018 11:48:07 +0000 (11:48 +0000)]
build: add -lgpg-error to gpgme build

Fixes #1493

6 years agoFix double evaluation of mutt_escape_path() inside a macro
Ian Zimmerman [Sun, 16 Dec 2018 00:55:51 +0000 (16:55 -0800)]
Fix double evaluation of mutt_escape_path() inside a macro

6 years agodoc: fix echo example
Richard Russon [Sat, 15 Dec 2018 22:07:52 +0000 (22:07 +0000)]
doc: fix echo example

6 years agocontrib: add mairix_filter.pl
Ian Zimmerman [Sun, 16 Dec 2018 00:02:48 +0000 (16:02 -0800)]
contrib: add mairix_filter.pl

Sample implementation of external search filter (mairix)

6 years agoPass current folder to external search tool
Ian Zimmerman [Sat, 15 Dec 2018 22:56:21 +0000 (14:56 -0800)]
Pass current folder to external search tool

Or "/", if needed

6 years agoMove escape_path to the library
Ian Zimmerman [Sat, 15 Dec 2018 22:45:26 +0000 (14:45 -0800)]
Move escape_path to the library

Also, make its source argument const

6 years agoimap: use imap_mailbox_status() in imap_mbox_check_stats()
Mehdi Abaakouk [Thu, 13 Dec 2018 15:01:36 +0000 (16:01 +0100)]
imap: use imap_mailbox_status() in imap_mbox_check_stats()

This change calls imap_mailbox_status() instead of imap_status()
in imap_mbox_check_stats() as we known the Mailbox.

This also add more sanity check in imap_mailbox_status().

6 years agoFix possible smime crash if the read mime header p is NULL.
Kevin McCarthy [Wed, 12 Dec 2018 02:41:37 +0000 (18:41 -0800)]
Fix possible smime crash if the read mime header p is NULL.

6 years agoFix memory leak in smime.c.
Kevin McCarthy [Tue, 11 Dec 2018 23:29:57 +0000 (15:29 -0800)]
Fix memory leak in smime.c.

smime_application_smime_handler() was not freeing the BODY returned by
smime_handle_entity().

6 years agodocs: strip out fake curly quotes in comments
Richard Russon [Thu, 13 Dec 2018 23:02:25 +0000 (23:02 +0000)]
docs: strip out fake curly quotes in comments

6 years agominor code tidying
Richard Russon [Thu, 13 Dec 2018 20:32:26 +0000 (20:32 +0000)]
minor code tidying

boolify variables
make function static
fix translation typo

6 years agomerge: refactor GroupContext to GroupList
Richard Russon [Wed, 12 Dec 2018 15:22:27 +0000 (15:22 +0000)]
merge: refactor GroupContext to GroupList

 * Convert GroupContext to use STAILQ
 * Rename Group-related structures
 * Move group.[ch] to mutt/
 * Sort functions prototypes
 * Get rid of global variable
 * Explicitly allocate/free Groups memory
 * Simplify the API when we cannot fail
 * Tidy API: s/group_context/grouplist/

6 years agoTidy API: s/group_context/grouplist/ 1187/head
Pietro Cerutti [Fri, 25 May 2018 12:15:00 +0000 (12:15 +0000)]
Tidy API: s/group_context/grouplist/

6 years agoSimplify the API when we cannot fail
Pietro Cerutti [Fri, 25 May 2018 11:49:43 +0000 (11:49 +0000)]
Simplify the API when we cannot fail

6 years agoExplicitly allocate/free Groups memory
Pietro Cerutti [Fri, 25 May 2018 11:21:38 +0000 (11:21 +0000)]
Explicitly allocate/free Groups memory

6 years agoGet rid of global variable
Pietro Cerutti [Fri, 25 May 2018 10:53:37 +0000 (10:53 +0000)]
Get rid of global variable

6 years agoSort functions prototypes
Pietro Cerutti [Fri, 25 May 2018 10:40:51 +0000 (10:40 +0000)]
Sort functions prototypes

6 years agoMove group.[ch] to mutt/
Pietro Cerutti [Fri, 25 May 2018 10:38:51 +0000 (10:38 +0000)]
Move group.[ch] to mutt/

6 years agoRename Group-related structures
Pietro Cerutti [Fri, 25 May 2018 09:44:54 +0000 (09:44 +0000)]
Rename Group-related structures

6 years agoConvert GroupContext to use STAILQ
Bo YU [Fri, 4 May 2018 10:56:06 +0000 (18:56 +0800)]
Convert GroupContext to use STAILQ

6 years agomerge: imap refactoring
Richard Russon [Wed, 12 Dec 2018 12:52:48 +0000 (12:52 +0000)]
merge: imap refactoring

 * imap_expunge_mailbox use m instead of adata->mailbox
 * move some functions Mailbox
 * imap_fix/cache_path don't need ImapAccountData
 * use Mailbox in imap_sync_message_for_copy()
 * Change more functions with Mailbox

6 years agoimap: Change more functions with Mailbox 1487/head
Mehdi Abaakouk [Sat, 8 Dec 2018 20:15:23 +0000 (21:15 +0100)]
imap: Change more functions with Mailbox

make_msg_set()
imap_exec_msgset()
sync_helper()

6 years agoimap: use Mailbox in imap_sync_message_for_copy()
Mehdi Abaakouk [Sat, 8 Dec 2018 19:50:46 +0000 (20:50 +0100)]
imap: use Mailbox in imap_sync_message_for_copy()

6 years agoimap: imap_fix/cache_path don't need ImapAccountData
Mehdi Abaakouk [Sat, 8 Dec 2018 19:37:51 +0000 (20:37 +0100)]
imap: imap_fix/cache_path don't need ImapAccountData

6 years agoimap: move some functions Mailbox
Mehdi Abaakouk [Sat, 8 Dec 2018 17:59:35 +0000 (18:59 +0100)]
imap: move some functions Mailbox

To increase readability some functions take Mailbox instead of
ImapAccountData.

* imap_read_headers()
* imap_set_flags()
* imap_cache_del()
* imap_cache_clean()
* imap_cache_put()
* msg_cache_commit()

6 years agoimap: imap_expunge_mailbox use m instead of adata->mailbox
Mehdi Abaakouk [Sat, 8 Dec 2018 17:51:49 +0000 (18:51 +0100)]
imap: imap_expunge_mailbox use m instead of adata->mailbox

6 years agoimap: ensure '\0' and INBOX are the same Mailbox
Mehdi Abaakouk [Tue, 11 Dec 2018 18:00:21 +0000 (19:00 +0100)]
imap: ensure '\0' and INBOX are the same Mailbox

INBOX and '\0  was considered as different mailbox. But when '\0' was
opened, the path/realpath was updated to "INBOX".

This change fixes m->path, m->realpath at the beginning to ensure INBOX
and '\0' are the same Mailbox.

Related #1486

6 years agomx: share code between ac_find implementations
Mehdi Abaakouk [Tue, 11 Dec 2018 19:51:40 +0000 (20:51 +0100)]
mx: share code between ac_find implementations

All mx_ops->ac_add() do almost the same thing.

Just move the common code to mx_ac_find()

6 years agomx: Ensure mailbox is always added to Account->mailboxes
Mehdi Abaakouk [Tue, 11 Dec 2018 20:00:38 +0000 (21:00 +0100)]
mx: Ensure mailbox is always added to Account->mailboxes

Currently if the user open a mailbox not in AllMailboxes.
We create a HIDDEN Mailbox and find an account with mx_ac_find().

In this case mx_ac_add is not called and the new Mailbox is not
added to the account.

Also some notmuch, pop and imap specific setup is not done.

This change fixes this

Close #1486

6 years agoAdd new pattern type ~I for external searches 1419/head
Ian Zimmerman [Wed, 14 Nov 2018 17:14:11 +0000 (09:14 -0800)]
Add new pattern type ~I for external searches

Call external commands, like mairix, to perform searches of the index.

6 years agoadd consts
Richard Russon [Mon, 10 Dec 2018 16:23:53 +0000 (16:23 +0000)]
add consts

6 years agoPrevent $charset from having multiple values
Richard Russon [Mon, 10 Dec 2018 14:26:28 +0000 (14:26 +0000)]
Prevent $charset from having multiple values

6 years agomerge: upstream fixes
Richard Russon [Mon, 10 Dec 2018 14:05:49 +0000 (14:05 +0000)]
merge: upstream fixes

 * Prevent trying to match a failing color body regex repeatedly
 * Fix QRESYNC crash after a large number of VANISHED messages
 * Improve pgp error message for translation
 * Add SENDER to default list of IMAP headers
 * Document Sender header as a default in $imap_headers
 * Deprecate TLS 1.0 and 1.1 by default
 * Enhance docs re security of SSL/TLS version vars
 * Fix compilation without deprecated OpenSSL 1.1 APIs
 * Add mutt_buffer_addstr_n()
 * Adjust version number comment in gpgme
 * Fix classic gpg date parsing in list-keys
 * Add note about the second --with-fingerprint to gpg.rc

6 years agoAdd note about the second --with-fingerprint to gpg.rc
Kevin McCarthy [Fri, 7 Dec 2018 21:18:04 +0000 (13:18 -0800)]
Add note about the second --with-fingerprint to gpg.rc

6 years agoFix classic gpg date parsing in list-keys
Kevin McCarthy [Fri, 7 Dec 2018 03:22:59 +0000 (19:22 -0800)]
Fix classic gpg date parsing in list-keys

GnuPG changed the format of their --with-colons output in 2.0.10.
Dates are now seconds since epoch.  Update the parse_pub_line() code
to detect the new format.

The GnuPG changes also separated pub and the first uid.  Since mutt
allows an empty uid field, the output is a bit less friendly now, with
an initial key without an uid.  I think that's acceptable, but
eventually we'll want to change the parsing behavior.

6 years agoAdjust version number comment in gpgme
Kevin McCarthy [Wed, 5 Dec 2018 17:31:34 +0000 (09:31 -0800)]
Adjust version number comment in gpgme

6 years agoAdd mutt_buffer_addstr_n()
Kevin McCarthy [Mon, 3 Dec 2018 04:26:27 +0000 (20:26 -0800)]
Add mutt_buffer_addstr_n()

6 years agoFix compilation without deprecated OpenSSL 1.1 APIs
Rosen Penev [Mon, 3 Dec 2018 00:46:28 +0000 (16:46 -0800)]
Fix compilation without deprecated OpenSSL 1.1 APIs

6 years agoEnhance docs re security of SSL/TLS version vars
Sam Pablo Kuper [Sun, 2 Dec 2018 22:32:35 +0000 (22:32 +0000)]
Enhance docs re security of SSL/TLS version vars

6 years agoDeprecate TLS 1.0 and 1.1 by default
Sam Pablo Kuper [Sun, 2 Dec 2018 22:31:19 +0000 (22:31 +0000)]
Deprecate TLS 1.0 and 1.1 by default

Fixes #101.

Minor digit of version number has been bumped per [Semantic Versioning
2.0.0](https://semver.org/spec/v2.0.0.html) §7:

> Minor version Y (x.Y.z | x > 0) MUST be incremented if ... any public
> API functionality is marked as deprecated.

6 years agoDocument Sender header as a default in $imap_headers
Kevin McCarthy [Sat, 1 Dec 2018 19:27:20 +0000 (11:27 -0800)]
Document Sender header as a default in $imap_headers

6 years agoAdd SENDER to default list of IMAP headers
Kevin McCarthy [Thu, 29 Nov 2018 20:36:08 +0000 (12:36 -0800)]
Add SENDER to default list of IMAP headers

This header is matched by the ~e and ~L patterns.  Those patterns
should work without the user having to know to add Sender to the list
of $imap_headers.  This was probably just an oversight.

6 years agoImprove pgp error message for translation
Kevin McCarthy [Wed, 28 Nov 2018 03:06:42 +0000 (19:06 -0800)]
Improve pgp error message for translation

The past tense phrase makes it unclear whether the error is about a
failed action or the state of the message.

Thanks to Vincent Lefèvre for the improved wording suggestion.

6 years agoFix QRESYNC crash after a large number of VANISHED messages
Kevin McCarthy [Tue, 27 Nov 2018 21:55:04 +0000 (13:55 -0800)]
Fix QRESYNC crash after a large number of VANISHED messages

When handling QRESYNC vanished, imap_expunge_mailbox() was called to
empty out the messages.  Various counters, including vcount are
updated by the mx_update_tables() after the expunge.

These counters need to be reset, because mx_update_context() will do
so once again at the end of reading new headers.  This can cause an
out of bounds access in v2r.

6 years agoPrevent trying to match a failing color body regex repeatedly
Kevin McCarthy [Mon, 26 Nov 2018 03:48:49 +0000 (19:48 -0800)]
Prevent trying to match a failing color body regex repeatedly

Emails with really long lines (e.g. spam), can suffer performance if a
complicated regex is matched to no effect over and over.  If the regex
failed at the beginning, it won't match at the end of another's regex
match range, so turn it off.

6 years agoclang-format
Richard Russon [Mon, 10 Dec 2018 13:52:51 +0000 (13:52 +0000)]
clang-format

6 years agomerge: document all the globals
Richard Russon [Mon, 10 Dec 2018 00:58:29 +0000 (00:58 +0000)]
merge: document all the globals

 * globals: upper case
 * drop duplicate externs
 * doxy: rename config pages
 * doxy: fix header
 * doxy: document menus
 * doxy: doc globals
 * doxy: add pages

6 years agodoxy: add pages
Richard Russon [Mon, 10 Dec 2018 00:37:19 +0000 (00:37 +0000)]
doxy: add pages

6 years agodoxy: doc globals
Richard Russon [Mon, 10 Dec 2018 00:17:24 +0000 (00:17 +0000)]
doxy: doc globals

6 years agodoxy: document menus
Richard Russon [Sun, 9 Dec 2018 15:42:17 +0000 (15:42 +0000)]
doxy: document menus

6 years agodoxy: fix header
Richard Russon [Sun, 9 Dec 2018 15:12:59 +0000 (15:12 +0000)]
doxy: fix header

6 years agodoxy: rename config pages
Richard Russon [Thu, 6 Dec 2018 23:21:25 +0000 (23:21 +0000)]
doxy: rename config pages

6 years agodrop duplicate externs
Richard Russon [Sun, 9 Dec 2018 14:47:24 +0000 (14:47 +0000)]
drop duplicate externs

6 years agoglobals: upper case
Richard Russon [Sun, 9 Dec 2018 15:07:21 +0000 (15:07 +0000)]
globals: upper case

6 years agoglobals: upper case
Richard Russon [Sun, 9 Dec 2018 15:01:02 +0000 (15:01 +0000)]
globals: upper case

6 years agoglobals: upper case
Richard Russon [Sun, 9 Dec 2018 14:55:20 +0000 (14:55 +0000)]
globals: upper case

6 years agoimap: imap_expunge_mailbox should take Mailbox as argument
Mehdi Abaakouk [Sat, 8 Dec 2018 13:35:32 +0000 (14:35 +0100)]
imap: imap_expunge_mailbox should take Mailbox as argument

6 years agoimap: always use mdata/adata getter
Mehdi Abaakouk [Sat, 8 Dec 2018 13:34:46 +0000 (14:34 +0100)]
imap: always use mdata/adata getter

6 years agoimap: remove useless imap_check
Mehdi Abaakouk [Fri, 7 Dec 2018 19:40:34 +0000 (20:40 +0100)]
imap: remove useless imap_check

imap_check_mailbox and imap_check are the same with different signature.

This change just use the one signature everywhere.

6 years agoimap: always set mdata
Mehdi Abaakouk [Fri, 7 Dec 2018 19:15:49 +0000 (20:15 +0100)]
imap: always set mdata

imap_prepare_mbox is called everywhere now.

So this change just set mdata when the mailbox is added.

6 years agombox_check_stats: fix MailboxCount
Mehdi Abaakouk [Fri, 7 Dec 2018 20:15:07 +0000 (21:15 +0100)]
mbox_check_stats: fix MailboxCount

The new mbox_check_stats work well, but MailboxCount was not correctly
updated.

This change fixes that.

6 years agoreset notmuch Mailbox->size on opening
Jenya Sovetkin [Fri, 7 Dec 2018 17:54:04 +0000 (18:54 +0100)]
reset notmuch Mailbox->size on opening

previous behaviour: size was not reset. This resulted in mailbox size to
accumulate on each mailbox reopening, hence displaying incorrect mailbox
size information in the status bar.

new behaviour: size is reset to zero.

steps to replicate previous behaviour: open neomutt with vfolder. Press
space to refresh vfolder (open from sidebar) several times. Mailbox size
in the status bar accumulates.

6 years agoTry to fix the mbox_check_stats() merge
Pietro Cerutti [Fri, 7 Dec 2018 09:58:32 +0000 (09:58 +0000)]
Try to fix the mbox_check_stats() merge

6 years agomerge: mxapi: add mbox_check_stats()
Richard Russon [Fri, 7 Dec 2018 01:25:16 +0000 (01:25 +0000)]
merge: mxapi: add mbox_check_stats()

 * mxapi: add mbox_check_stats()
 * imap: use mbox_check_stats()
 * mbox: use mbox_check_stats()
 * notmuch: use mbox_check_stats()
 * maildir: use mbox_check_stats()
 * maildir: tidy maildir_check_dir()

6 years agomaildir: tidy maildir_check_dir() 1407/head
Richard Russon [Fri, 7 Dec 2018 00:43:38 +0000 (00:43 +0000)]
maildir: tidy maildir_check_dir()

6 years agomaildir: use mbox_check_stats()
Austin Ray [Fri, 7 Dec 2018 00:41:07 +0000 (00:41 +0000)]
maildir: use mbox_check_stats()

6 years agonotmuch: use mbox_check_stats()
Austin Ray [Fri, 7 Dec 2018 00:10:32 +0000 (00:10 +0000)]
notmuch: use mbox_check_stats()

6 years agombox: use mbox_check_stats()
Austin Ray [Fri, 7 Dec 2018 00:10:20 +0000 (00:10 +0000)]
mbox: use mbox_check_stats()

6 years agoimap: use mbox_check_stats()
Austin Ray [Fri, 7 Dec 2018 00:09:38 +0000 (00:09 +0000)]
imap: use mbox_check_stats()

6 years agomxapi: add mbox_check_stats()
Austin Ray [Fri, 7 Dec 2018 00:04:26 +0000 (00:04 +0000)]
mxapi: add mbox_check_stats()

6 years agomerge: upstream GPGME improvements
Pietro Cerutti [Thu, 6 Dec 2018 11:55:43 +0000 (11:55 +0000)]
merge: upstream GPGME improvements

 * Require GPGME version 1.2.0 and drop useless HAVE macros.
 * Always use the gpgme_new wrapper in crypt-gpgme.
 * Try to avoid creation of temp. directory for key import.
 * Improve the console output for extract-keys and speed up import.

6 years agoImprove the console output for extract-keys and speed up import. 1478/head
Werner Koch [Mon, 3 Dec 2018 07:41:56 +0000 (08:41 +0100)]
Improve the console output for extract-keys and speed up import.

The listing of imported keys to the console must have stopped working
on 2014-12-31 due to a fix for bug #3698, commit
bbc5acb6de0ca56d7e8366402d68a1a919ca9b23 which was needed due to a
not fully working stub code introduced in 2008 with commit
a4b3a60dd63bc7af7927025b2d1344530ca89aa9.

The latter commit also introduced a bug in the import code which
listed all keys in the keyring to a temporary file and copied that one
to stdout.  The former commit avoided the output to stdout.

The fix here is to use pgp_gpgme_extract_keys only for extracting
information about the key and don't re-use the same code for importing
keys.  We now import the keys directly in pgp_gpgme_invoke_import and
we print the fingerprint and status flags for all imported keys.  That
information available from GPGME for ages (0.3.1 from 2003).
The user id is unfortunately not printed; that would require a lookup
of the newly imported key.  Can be done with another patch.

6 years agoTry to avoid creation of temp. directory for key import.
Werner Koch [Mon, 3 Dec 2018 07:41:55 +0000 (08:41 +0100)]
Try to avoid creation of temp. directory for key import.

Since gpgme 1.9.0 it is possible to list keys directly from a file
without importing it into gpg' own keyring.  This patch implements
this in a backward compatible way.

Unfortunately we need to check for a suitable gpgme version at build
time and also for a suitable gpg version at runtime.  This is
implemented by a version check which requires to call or include code
taken from libgpg-error (aka gpgrt).  However this library is anyway a
dependency of gpgme and thus does not pose any extra burden.

The functions parse_version_number, parse_version_string, and
cmp_version_strings are taken from libgpg-error's repo at 2018-11-20.
Libgpg-error is distributed under the LGPL-2.1-or-later.

6 years agoAlways use the gpgme_new wrapper in crypt-gpgme.
Werner Koch [Mon, 3 Dec 2018 07:41:54 +0000 (08:41 +0100)]
Always use the gpgme_new wrapper in crypt-gpgme.

The wrapper is much more convenient and there is no need to sometimes
use gpgme_new directly.  The perceived advantage on not bailing out in
an out-of-core condition is not realistic because other small amounts
of memory are allocated all over mutt anyway and thus function will
terminate the process as well.

This patch also changes the minimum version of gpgme to 1.4.0.  This
is so that we can always pass NULL to functions like gpgme_release.
Further 1.4.0 has new functions which we may soon like to use.

6 years agoRequire GPGME version 1.2.0 and drop useless HAVE macros.
Werner Koch [Mon, 3 Dec 2018 07:41:53 +0000 (08:41 +0100)]
Require GPGME version 1.2.0 and drop useless HAVE macros.

GPGME 1.2.0 was released nearly 10 years ago and thus we can really
demand this version.  For various reasons it would be advisable to
require a decent version but that is a different thing and needs to be
done in a separate patch.

HAVE_GPGME_OP_EXPORT_KEYS and HAVE_GPGME_PKA_TRUST are not anymore
needed because they are supported by that GPGME version.

6 years agoRename crypto_chars to crypt_chars (plus implementation stuff) for consistency
Pietro Cerutti [Thu, 6 Dec 2018 10:57:31 +0000 (10:57 +0000)]
Rename crypto_chars to crypt_chars (plus implementation stuff) for consistency