]> granicus.if.org Git - neomutt/log
neomutt
5 years agoentire-thread: determine current position before resorting.
Andres Freund [Tue, 21 May 2019 23:13:10 +0000 (16:13 -0700)]
entire-thread: determine current position before resorting.

Previously oldcur was determined after nm_read_entire_thread(),
leading to entire-thread unintentionally jumping to the first message
in the thread.

Before 918885f32db41 that used to work, because mutt_sort_headers()
wasn't called from within nm_read_entire_thread().

Fix by moving determination of pre nm_read_entire_thread() count a few
lines up. Also reuse existing oldcount variable, rather than
'oc' (which could also be oldcur).

Fixes: #1714
5 years agofix: reverse_name / alternates
Andres Freund [Tue, 21 May 2019 13:29:07 +0000 (14:29 +0100)]
fix: reverse_name / alternates

Fixes: #1581
5 years agomerge: minor tidying
Richard Russon [Thu, 16 May 2019 14:43:07 +0000 (15:43 +0100)]
merge: minor tidying

 * clang-format
 * readme: split out contributors
 * rename fd parameters
 * increase buffer sizes to avoid truncation
 * test: add missing #include guards
 * unify char buffer inititialisation
 * boolify: locals, params, args
 * rename mailbox functions
 * light tidying
 * don't check for empty config strings
 * rename struct Event and Mailbox.notify
 * move el_free() to email
 * tidy maildir_mbox_check()
 * config: rename listener to observer
 * tidy ternary operators
 * tidy char pointers
 * initialise pointers
 * tidy pointer definitions

5 years agotidy pointer definitions
Richard Russon [Thu, 16 May 2019 14:18:28 +0000 (15:18 +0100)]
tidy pointer definitions

Separate multiple variable definitions which differ in type, e.g.

  char buf[16], *p = NULL, **pp = NULL;

becomes

  char buf[16];
  char *p = NULL;
  char **pp = NULL;

5 years agoinitialise pointers
Richard Russon [Thu, 16 May 2019 13:53:31 +0000 (14:53 +0100)]
initialise pointers

5 years agotidy char pointers
Richard Russon [Wed, 15 May 2019 19:01:38 +0000 (20:01 +0100)]
tidy char pointers

Make char-pointer dereferencing more consistent.
Any functions that used both `*ptr` and `ptr[0]` notation have been tidied.

5 years agotidy ternary operators
Richard Russon [Wed, 15 May 2019 22:53:37 +0000 (23:53 +0100)]
tidy ternary operators

- insert ()s
- expand checks against 0 or '\0'

5 years agoconfig: rename listener to observer
Richard Russon [Wed, 15 May 2019 11:25:37 +0000 (12:25 +0100)]
config: rename listener to observer

This fits in with the GoF's subject/observer pattern.

5 years agotidy maildir_mbox_check()
Richard Russon [Wed, 15 May 2019 10:52:12 +0000 (11:52 +0100)]
tidy maildir_mbox_check()

Factor out a common pointer.

5 years agomove el_free() to email
Richard Russon [Wed, 15 May 2019 10:50:02 +0000 (11:50 +0100)]
move el_free() to email

This function will be used elsewhere, soon.

5 years agorename struct Event and Mailbox.notify
Richard Russon [Tue, 12 Mar 2019 16:01:15 +0000 (16:01 +0000)]
rename struct Event and Mailbox.notify

Rename things out of the way of future work.
These names will be used by a general notifications system.

5 years agodon't check for empty config strings
Richard Russon [Thu, 16 May 2019 11:55:40 +0000 (12:55 +0100)]
don't check for empty config strings

The config system stores empty strings as NULL.
Config variables must not be set directly, but using the config system
(this gives us validation and notifications).

5 years agolight tidying
Richard Russon [Tue, 30 Apr 2019 12:41:04 +0000 (13:41 +0100)]
light tidying

Lots of minor fixes, many inspired by cppcheck.

- reduce scope of variables
- return early
- NULL pointers after free
- fix typos
- correct retval type

5 years agorename mailbox functions
Richard Russon [Wed, 15 May 2019 23:31:46 +0000 (00:31 +0100)]
rename mailbox functions

Fix mailbox function naming for consistency

5 years agoboolify: locals, params, args
Richard Russon [Sun, 12 May 2019 22:40:08 +0000 (23:40 +0100)]
boolify: locals, params, args

5 years agounify char buffer inititialisation
Richard Russon [Wed, 15 May 2019 21:52:26 +0000 (22:52 +0100)]
unify char buffer inititialisation

For consistency, use the format:

  `char buf[16] = { 0 };`

5 years agotest: add missing #include guards
Richard Russon [Sun, 12 May 2019 22:44:19 +0000 (23:44 +0100)]
test: add missing #include guards

5 years agoincrease buffer sizes to avoid truncation
Richard Russon [Wed, 15 May 2019 20:24:41 +0000 (21:24 +0100)]
increase buffer sizes to avoid truncation

This is just to hide a compiler warning.

5 years agorename fd parameters
Richard Russon [Wed, 15 May 2019 19:26:29 +0000 (20:26 +0100)]
rename fd parameters

Rename parameters to match other functions.

5 years agoreadme: split out contributors
Richard Russon [Thu, 11 Apr 2019 10:38:08 +0000 (11:38 +0100)]
readme: split out contributors

5 years agoclang-format
Richard Russon [Thu, 16 May 2019 12:54:13 +0000 (13:54 +0100)]
clang-format

5 years agomerge: split up Buffer and the Pool
Richard Russon [Thu, 16 May 2019 11:14:49 +0000 (12:14 +0100)]
merge: split up Buffer and the Pool

 * split out pool
 * don't use pool in libraries
 * test: tidy config tests

5 years agotest: tidy config tests
Richard Russon [Thu, 16 May 2019 00:10:46 +0000 (01:10 +0100)]
test: tidy config tests

The config tests don't use the buffer pool any more.

5 years agodon't use pool in libraries
Richard Russon [Tue, 14 May 2019 18:09:51 +0000 (19:09 +0100)]
don't use pool in libraries

5 years agosplit out pool
Richard Russon [Tue, 14 May 2019 18:07:58 +0000 (19:07 +0100)]
split out pool

5 years agofix leaks in mutt_pattern_comp()
Richard Russon [Tue, 14 May 2019 13:49:24 +0000 (14:49 +0100)]
fix leaks in mutt_pattern_comp()

5 years agotest: fix leaks
Richard Russon [Mon, 13 May 2019 21:54:23 +0000 (22:54 +0100)]
test: fix leaks

5 years agomerge: upstream fixes
Richard Russon [Thu, 16 May 2019 10:29:49 +0000 (11:29 +0100)]
merge: upstream fixes

 * Fix sample neomuttrc to use better quoting practices.
 * Add a "backticks in double quotes" example to the manual.
 * Avoid undefined behaviour on huge integer in a RFC2231 header
 * sync pgp_gpgme_invoke_import()

5 years agosync pgp_gpgme_invoke_import()
Richard Russon [Thu, 16 May 2019 10:28:20 +0000 (11:28 +0100)]
sync pgp_gpgme_invoke_import()

5 years agoAvoid undefined behaviour on huge integer in a RFC2231 header
Vincent Lefevre [Wed, 15 May 2019 11:05:09 +0000 (13:05 +0200)]
Avoid undefined behaviour on huge integer in a RFC2231 header

The atoi() function was called on the index, which can potentially
be huge in an invalid message and can yield undefined behavior. The
mutt_atoi() function is now used for error detection.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoAdd a "backticks in double quotes" example to the manual.
Kevin McCarthy [Tue, 14 May 2019 16:26:38 +0000 (09:26 -0700)]
Add a "backticks in double quotes" example to the manual.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoFix sample neomuttrc to use better quoting practices.
Kevin McCarthy [Tue, 14 May 2019 16:00:46 +0000 (09:00 -0700)]
Fix sample neomuttrc to use better quoting practices.

Use single quotes in the password encryption example.

For password decryption, put the backquotes inside double quotes to
avoid special characters being re-interpreted.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoDo not cache a compiled regex to avoid leaks
Pietro Cerutti [Mon, 13 May 2019 11:42:37 +0000 (11:42 +0000)]
Do not cache a compiled regex to avoid leaks

glibc's implementation of the regex engine is a DFA which creates nodes
on the fly under the regex_t object. This will cause leakes if we keep
the compiled regular expression around, as it was the case before.

See also https://sourceware.org/bugzilla/show_bug.cgi?id=12567

5 years agofix: counting of content-lines header
Richard Russon [Mon, 13 May 2019 09:44:32 +0000 (10:44 +0100)]
fix: counting of content-lines header

5 years agomerge: fix most leaks in test code
Richard Russon [Sun, 12 May 2019 22:37:21 +0000 (23:37 +0100)]
merge: fix most leaks in test code

 * check library parameters more carefully
 * test: fix leaks in config tests
 * test: fix leaks in library tests
 * clang-format test code

5 years agoclang-format test code
Richard Russon [Sun, 12 May 2019 22:29:13 +0000 (23:29 +0100)]
clang-format test code

5 years agotest: fix leaks in library tests
Richard Russon [Sun, 12 May 2019 22:25:28 +0000 (23:25 +0100)]
test: fix leaks in library tests

5 years agotest: fix leaks in config tests
Richard Russon [Sun, 12 May 2019 22:21:30 +0000 (23:21 +0100)]
test: fix leaks in config tests

5 years agocheck library parameters more carefully
Richard Russon [Sun, 12 May 2019 22:18:41 +0000 (23:18 +0100)]
check library parameters more carefully

Some test cases were causing library code to be run with invalid
parameters.  Reject these cases.

5 years agoFix next-unread-mailbox
Mehdi Abaakouk [Sun, 12 May 2019 19:34:42 +0000 (21:34 +0200)]
Fix next-unread-mailbox

e4133e5cd2 have introduced a small regression.

next-unread-mailbox does not automatically open the mailbox.

This change fixes it.

5 years agomerge: update translations
Richard Russon [Sat, 11 May 2019 10:05:18 +0000 (11:05 +0100)]
merge: update translations

 * Update lt_LT translation
 * update German translation
 * fix command string
 * fix 'too few/many' translations
 * tidy OAUTHBEARER error message
 * Update Ukrainian translation
 * Update Russian translation
 * Update Danish translation
 * sync translations

5 years agosync translations
Richard Russon [Sat, 11 May 2019 10:05:11 +0000 (11:05 +0100)]
sync translations

5 years agoUpdate Danish translation
Morten Bo Johansen [Fri, 10 May 2019 20:18:46 +0000 (13:18 -0700)]
Update Danish translation

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoUpdate Russian translation
Vsevolod Volkov [Fri, 10 May 2019 18:09:45 +0000 (11:09 -0700)]
Update Russian translation

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoUpdate Ukrainian translation
Vsevolod Volkov [Fri, 10 May 2019 18:07:41 +0000 (11:07 -0700)]
Update Ukrainian translation

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agotidy OAUTHBEARER error message
Richard Russon [Sat, 11 May 2019 09:12:30 +0000 (10:12 +0100)]
tidy OAUTHBEARER error message

5 years agofix 'too few/many' translations
Richard Russon [Sat, 11 May 2019 09:07:13 +0000 (10:07 +0100)]
fix 'too few/many' translations

5 years agofix command string
Richard Russon [Fri, 10 May 2019 22:31:31 +0000 (23:31 +0100)]
fix command string

5 years agoupdate German translation
Richard Russon [Fri, 10 May 2019 22:16:28 +0000 (23:16 +0100)]
update German translation

5 years agoUpdate lt_LT translation
Marius Gedminas [Thu, 9 May 2019 11:31:56 +0000 (14:31 +0300)]
Update lt_LT translation

Fixes 6 fuzzy strings.

5 years agofeat: use mailbox description for spoolfile 1708/head
Austin Ray [Fri, 10 May 2019 00:05:22 +0000 (20:05 -0400)]
feat: use mailbox description for spoolfile

'spoolfile' is limited to mailboxes paths so if one wants to use a
'named-mailboxes' or 'virtual-mailboxes' as the spoolfile, its path must
be duplicated in the 'spoolfile' assignment. 'virtual-mailboxes' has a
helper variable, 'virtual_spoolfile', for selecting the first
'virtual-mailboxes' entry as the spoolfile.

This commit allows one to use a mailbox description for the 'spoolfile,
which removes the need to duplicate a 'named-mailboxes' or
'virtual-mailboxes' path and makes 'virtual_spoolfile' defunct. The
configuration syntax is now more consistent.

It is important to note that mailbox descriptions are preferred to
paths.

To reflect the change, documentation was updated:
 - Add note to 'spoolfile' about using a string to specify a
   'named-mailboxes' or 'virtual-mailboxes' description.
 - Add a note to the 'virtual_spoolfile' documentation saying that it is no
   longer necessary since 'spoolfile' supports descriptions now.

5 years agomerge: upstream fixes
Richard Russon [Fri, 10 May 2019 14:16:58 +0000 (15:16 +0100)]
merge: upstream fixes

 * Add a test for NULL parameter attribute too
 * Add a quick-starter config section to the manual.
 * Add sample starter muttrc to contrib.
 * Change sample muttrc path to match other manual references.
 * Add note about %r for the pgp_list_*_command vars.

5 years agoAdd note about %r for the pgp_list_*_command vars.
Kevin McCarthy [Thu, 9 May 2019 20:48:44 +0000 (13:48 -0700)]
Add note about %r for the pgp_list_*_command vars.

In this case %r is the list of search strings.

5 years agoChange sample muttrc path to match other manual references.
Kevin McCarthy [Thu, 9 May 2019 20:25:25 +0000 (13:25 -0700)]
Change sample muttrc path to match other manual references.

The other parts of the manual refer to /usr/local/share/doc in their
examples.  For consistency, change the starter muttrc and manual entry
to do the same.

In the future, we may wish to have a config variable instead, so users
don't have to worry about system vs locally installed paths when
sourcing the gpg.rc, for instance.

5 years agoAdd sample starter muttrc to contrib.
Kevin McCarthy [Thu, 9 May 2019 02:28:21 +0000 (19:28 -0700)]
Add sample starter muttrc to contrib.

Add a mini-section with a link to the manual instead, under
"Configuration".

5 years agoAdd a quick-starter config section to the manual.
Kevin McCarthy [Mon, 6 May 2019 22:35:38 +0000 (15:35 -0700)]
Add a quick-starter config section to the manual.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoAdd a test for NULL parameter attribute too
Kevin McCarthy [Mon, 6 May 2019 19:37:04 +0000 (12:37 -0700)]
Add a test for NULL parameter attribute too

Just to be sure we don't have any issues with the new continuation
code.  The mutt_set_parameter() code doesn't actively prevent a null
attribute.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agomerge: fixes for bugs raised by automated testing
Richard Russon [Fri, 10 May 2019 13:20:52 +0000 (14:20 +0100)]
merge: fixes for bugs raised by automated testing

 * check value of 'Content-Length' more carefully
 * Replace atoi() to mutt_str_atoi()
 * fix leaks during header parsing

5 years agofix leaks during header parsing 1707/head
Richard Russon [Thu, 9 May 2019 19:16:58 +0000 (20:16 +0100)]
fix leaks during header parsing

Credit to OSS-Fuzz

5 years agoReplace atoi() to mutt_str_atoi()
Richard Russon [Thu, 9 May 2019 15:23:24 +0000 (16:23 +0100)]
Replace atoi() to mutt_str_atoi()

mutt_str_atoi() has error checking.

5 years agocheck value of 'Content-Length' more carefully
Richard Russon [Thu, 9 May 2019 15:17:10 +0000 (16:17 +0100)]
check value of 'Content-Length' more carefully

Replace `atol()` with `mutt_str_atol()` which has error checking.
Cap the maximum size to 1GiB.  If we exceed this your email to TOO BIG!

5 years agofix: config_dump()
Richard Russon [Thu, 9 May 2019 00:07:45 +0000 (01:07 +0100)]
fix: config_dump()

Move a variable test so that config_dump() works again.

Fixes: #1705
5 years agofix: folder missing from status bar
Richard Russon [Tue, 7 May 2019 15:37:40 +0000 (16:37 +0100)]
fix: folder missing from status bar

Fix a typo introduced with the Buffer changes.
It lead to '%f' showing '(no mailbox)' all the time.

5 years agomerge: update translations
Richard Russon [Mon, 6 May 2019 15:52:04 +0000 (16:52 +0100)]
merge: update translations

 * Polish translation update
 * Update lt_LT translations
 * sync translations

5 years agosync translations
Richard Russon [Mon, 6 May 2019 15:51:06 +0000 (16:51 +0100)]
sync translations

5 years agoUpdate lt_LT translations
Marius Gedminas [Sat, 27 Apr 2019 07:20:49 +0000 (10:20 +0300)]
Update lt_LT translations

New fuzzy and untranslated strings.

See also https://github.com/neomutt/neomutt/issues/1680 because

  all: no binds in this menu
  all: no macros in this menu

probably should not be translated to

  all: šiame meniu nėra binds
  all: šiame meniu nėra macros

5 years agoPolish translation update
Marcin Rajner [Wed, 10 Apr 2019 13:11:39 +0000 (15:11 +0200)]
Polish translation update

5 years agoAllow to disable IMAP's ENABLE extension to work-around broken servers
Pietro Cerutti [Fri, 3 May 2019 14:12:17 +0000 (14:12 +0000)]
Allow to disable IMAP's ENABLE extension to work-around broken servers

Issue #1689

5 years agomerge: Upstream refactoring
Richard Russon [Mon, 6 May 2019 11:27:15 +0000 (12:27 +0100)]
merge: Upstream refactoring

 * Change struct Mailbox->realpath to be const char *
 * Convert struct Buffer->path to a struct Buffer
 * Convert other users of struct Mailbox->pathbuf to use Buffers
 * Add mutt_buffer_enter_fname()
 * Convert change folder operations to use struct Buffer
 * Increase prompt size to remove warning
 * Convert migrated lib.c functions to use struct Buffer
 * Add menu dialog helper to add rows
 * Convert certficate prompts to use menu dialog helper and struct Buffer
 * Convert pager help string to use struct Buffer
 * Convert compress to use mutt_buffer_quote_filename()
 * Convert remailer to use struct Buffer for Mixmaster invocation
 * Revert "Fix truncation of long filenames in attachments."
 * Handle the same secret key appearing in multiple public keyrings
 * Change mutt_parse_mailboxes() to use the path struct Buffer argument
 * Convert mutt_parse_adrlist() to use struct Buffer for simple parsing
 * Add note about $mailcap_path generation to the documentation
 * Add $imap_fetch_chunk_size to allow FETCHing new headers in chunks
 * Enable the use of toggle-write from the pager
 * Add note about IMAP browser and trailing delimiters
 * Add $forward_attachments quadoption for inline-forward mode
 * Note the other parts of generated message-ids in the manual
 * Fix mailbox search to not recompile for a repeated search
 * Corrected minor errors in text related to $forward_attachments
 * Update French translation
 * Write rfc2231 parameter continuations for long parameters
 * Add a manual section on OpenPGP and S/MIME configuration.
 * build: fix tests
 * tidy code

5 years agotidy code 1701/head
Richard Russon [Sat, 4 May 2019 22:29:38 +0000 (23:29 +0100)]
tidy code

- doxy: Tidy duplicate comments
- clang-format

5 years agobuild: fix tests
Richard Russon [Sat, 4 May 2019 23:44:25 +0000 (00:44 +0100)]
build: fix tests

5 years agoAdd a manual section on OpenPGP and S/MIME configuration.
Kevin McCarthy [Sun, 5 May 2019 20:26:59 +0000 (13:26 -0700)]
Add a manual section on OpenPGP and S/MIME configuration.

Talk about the required config variables, GPGME and classic mode,
agents, pinentry programs, and smime_keys.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoWrite rfc2231 parameter continuations for long parameters
Kevin McCarthy [Thu, 2 May 2019 19:31:29 +0000 (12:31 -0700)]
Write rfc2231 parameter continuations for long parameters

Previously, Mutt would truncate long attachment filenames, to avoid
writing an illegal length header line.  This commit is a followup to
4dcb3ba1, where I reverted an incorrect fix for the problem.

rfc2231_encode_string() now returns a list of continuations, with
encoding and continuation number suffixes already appended to the
attribute.  The function tries to keep the line length less than 78
characters, but the code is a bit imprecise as a trade off for
simplicity and readability.

Modify mutt_write_mime_header() to loop through the continuations.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoUpdate French translation
Vincent Lefevre [Mon, 29 Apr 2019 11:03:44 +0000 (13:03 +0200)]
Update French translation

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoCorrected minor errors in text related to $forward_attachments
Vincent Lefevre [Mon, 29 Apr 2019 10:49:22 +0000 (12:49 +0200)]
Corrected minor errors in text related to $forward_attachments

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoFix mailbox search to not recompile for a repeated search
Kevin McCarthy [Sun, 28 Apr 2019 22:48:33 +0000 (15:48 -0700)]
Fix mailbox search to not recompile for a repeated search

The LastSearchExpn was being compared, but was never set to the
expanded search value.  This was causing the search to be recompiled
even if it were for the same previous expanded search string.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoNote the other parts of generated message-ids in the manual
Kevin McCarthy [Sun, 28 Apr 2019 21:59:13 +0000 (14:59 -0700)]
Note the other parts of generated message-ids in the manual

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoAdd $forward_attachments quadoption for inline-forward mode
Kevin McCarthy [Fri, 26 Apr 2019 02:41:04 +0000 (19:41 -0700)]
Add $forward_attachments quadoption for inline-forward mode

When set or answered yes, non text-decodable parts will be attached to
the new message.  The default value is "ask-yes", because I believe
this is something people will want to use, and should be made aware of
the new possible behavior.

The option presents a nice middle ground between previous
inline-forwarding behavior (where all the non-text parts were
dropped), and $mime_forward where the entire email was included as an
attachment.

This was previously difficult to achieve, but after the
recv-attachment refactoring: (a19e5266^..faabd621)
it became possible to use the ATTACH_CONTEXT and the recvattach.c
helper mutt_generate_recvattach_list() to properly deal with nesting
and multiple file-handles.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoAdd note about IMAP browser and trailing delimiters
Kevin McCarthy [Thu, 25 Apr 2019 16:26:43 +0000 (09:26 -0700)]
Add note about IMAP browser and trailing delimiters

This is the same behavior as the regular browser, but I think still
deserves a quick mention.

Thanks to Charles for pointing out this section of the manual and
suggesting the addition.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoEnable the use of toggle-write from the pager
Jeremy Sowden [Tue, 23 Apr 2019 21:15:31 +0000 (22:15 +0100)]
Enable the use of toggle-write from the pager

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoAdd $imap_fetch_chunk_size to allow FETCHing new headers in chunks
Kevin McCarthy [Sun, 19 Aug 2018 16:25:53 +0000 (09:25 -0700)]
Add $imap_fetch_chunk_size to allow FETCHing new headers in chunks

For extremely large mailboxes, some implementations will time out just
while fetching the new headers, because the client doesn't send any
commands for 30 minutes while downloading the large number of headers.

Rewrite imap_fetch_msn_seqset() to return chunks of size
$imap_fetch_chunk_size.

The change requires trusting the server will follow the RFC and not
send an EXPUNGE during or between the FETCH chunks; otherwise we'll
miss MSNs between the chunks because the shift.

We could in theory continue to set "msn_begin = idata->max_msn + 1",
but that makes the assumption there are no holes in the header cache
that we are filling in during a chunk.  Personally I am dubious about
"header cache holes", but the IMAP code has explicitly mentioned and
handled them since prior to my involvement.

Since the RFC forbids the interleaving EXPUNGE I believe it's safe
enough to set "msn_begin = fetch_msn_end + 1" until proven otherwise.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoAdd note about $mailcap_path generation to the documentation
Kevin McCarthy [Mon, 22 Apr 2019 18:02:28 +0000 (11:02 -0700)]
Add note about $mailcap_path generation to the documentation

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoConvert mutt_parse_adrlist() to use struct Buffer for simple parsing
Kevin McCarthy [Mon, 22 Apr 2019 03:05:13 +0000 (20:05 -0700)]
Convert mutt_parse_adrlist() to use struct Buffer for simple parsing

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoChange mutt_parse_mailboxes() to use the path struct Buffer argument
Kevin McCarthy [Mon, 22 Apr 2019 02:45:49 +0000 (19:45 -0700)]
Change mutt_parse_mailboxes() to use the path struct Buffer argument

Instead of copying to a buf[] variable, since the various utility
methods are now available to struct Buffer too.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoHandle the same secret key appearing in multiple public keyrings
Julian Gilbey [Thu, 18 Apr 2019 15:30:38 +0000 (16:30 +0100)]
Handle the same secret key appearing in multiple public keyrings

Allow for S/MIME keys and the possibility of missing subkeys

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoRevert "Fix truncation of long filenames in attachments."
Kevin McCarthy [Sat, 20 Apr 2019 22:43:59 +0000 (15:43 -0700)]
Revert "Fix truncation of long filenames in attachments."

This reverts commit f476d0aecd6f88db5291427fced21a8e834ca181.

The commit allowed the generation of illegal length header lines.  A
correct fix needs to implement parameter continuations.

I will work on that, but in case I don't get it in before 1.12,
preserve the hard truncation.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoConvert remailer to use struct Buffer for Mixmaster invocation
Kevin McCarthy [Sat, 20 Apr 2019 20:00:28 +0000 (13:00 -0700)]
Convert remailer to use struct Buffer for Mixmaster invocation

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoConvert compress to use mutt_buffer_quote_filename()
Kevin McCarthy [Sat, 20 Apr 2019 19:34:35 +0000 (12:34 -0700)]
Convert compress to use mutt_buffer_quote_filename()

Because the compress expandos operate differently than the rest of
mutt, requiring manual outer quoting, add a parameter to the function
to toggle outer quoting off.

Remove the now unused escape_path() function.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoConvert pager help string to use struct Buffer
Kevin McCarthy [Fri, 19 Apr 2019 22:04:43 +0000 (15:04 -0700)]
Convert pager help string to use struct Buffer

Remove the awkward string truncation warnings, and remove helpstr and
tmphelp char arrays from the stack.

Because the pager is fairly long lived, allocate the helpstr instead
of using the pool.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoConvert certficate prompts to use menu dialog helper and struct Buffer
Kevin McCarthy [Fri, 19 Apr 2019 21:25:05 +0000 (14:25 -0700)]
Convert certficate prompts to use menu dialog helper and struct Buffer

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoAdd menu dialog helper to add rows
Kevin McCarthy [Fri, 19 Apr 2019 20:14:54 +0000 (13:14 -0700)]
Add menu dialog helper to add rows

Remove the manual max calculation and dialog row allocation.

Add a NONULL check because the helper uses safe_strdup() to add a row.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoConvert migrated lib.c functions to use struct Buffer
Kevin McCarthy [Fri, 19 Apr 2019 01:42:57 +0000 (18:42 -0700)]
Convert migrated lib.c functions to use struct Buffer

Fix mutt_getcwd() to return NULL on failure.

Change mutt_rmtree(), mutt_mkwrapdir(), safe_open(), and
safe_symlink() to use struct Buffer so they don't have filename length
limitations.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoIncrease prompt size to remove warning
Kevin McCarthy [Wed, 17 Apr 2019 23:07:05 +0000 (16:07 -0700)]
Increase prompt size to remove warning

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoConvert change folder operations to use struct Buffer
Kevin McCarthy [Wed, 17 Apr 2019 03:22:08 +0000 (20:22 -0700)]
Convert change folder operations to use struct Buffer

Store the folder name inside a struct Buffer and use the various struct Buffer
enhanced functions.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoAdd mutt_buffer_enter_fname()
Kevin McCarthy [Wed, 17 Apr 2019 02:25:36 +0000 (19:25 -0700)]
Add mutt_buffer_enter_fname()

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoConvert other users of struct Mailbox->pathbuf to use Buffers
Kevin McCarthy [Wed, 17 Apr 2019 01:11:35 +0000 (18:11 -0700)]
Convert other users of struct Mailbox->pathbuf to use Buffers

A few functions in browser.c, buffy.c, and monitor.c were using
struct Mailbox->pathbuf but were potentially truncating via fixed size buffers.
Convert those to use Buffers too.

buffy_get() was creating epath and expanding it, apparently to match
against expanded struct Mailbox list entries, was wasn't using the epath.  I
believe this is a bug, and have switched the comparison to epath.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoConvert struct Buffer->path to a struct Buffer
Kevin McCarthy [Tue, 16 Apr 2019 20:41:10 +0000 (13:41 -0700)]
Convert struct Buffer->path to a struct Buffer

Rename to struct Buffer->pathbuf to make it clear the field is a struct Buffer, and
to make sure to catch and review all usages.

There are still uses of pathbuf that are truncating and need to be
fixed, for example in browser.c and buffy.c.

Fix up sidebar usage in one place, that was pointing inside the
struct Mailbox->path with a char *.  At the same time, change their "short
folder" computation to also use a struct Buffer.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoChange struct Mailbox->realpath to be const char *
Kevin McCarthy [Tue, 16 Apr 2019 19:23:42 +0000 (12:23 -0700)]
Change struct Mailbox->realpath to be const char *

struct Mailbox->path is a fixed array (which will be converted to a struct Buffer in
the next commit).  This is needed to call mutt_expand_path().

However, struct Mailbox->realpath has no such need, and so it is a bit
wasteful (not to mention not big enough) to store as such.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoFix utf7/utf8 conversion of mailbox names in LIST response
Pietro Cerutti [Fri, 3 May 2019 11:53:40 +0000 (11:53 +0000)]
Fix utf7/utf8 conversion of mailbox names in LIST response

Because of a wrong argument passed into `imap_unmunge_mbox_name`, mailbox names
encoded in utf7 are not properly converted into utf8. This causes two problems:

1. mailbox names are mangled in the UI (M&AOY-lstr&APY-m instead of Mælström)

2. mailbox names are re-encoded to utf7 before being sent to the server,
resulting in "Mailbox does not exists" errors in commands such as DELETE

5 years agoAvoid identity conversion
Pietro Cerutti [Fri, 3 May 2019 11:34:58 +0000 (11:34 +0000)]
Avoid identity conversion