]> granicus.if.org Git - neomutt/log
neomutt
8 years agobuild: generate devel version suffix
Richard Russon [Tue, 13 Dec 2016 22:06:37 +0000 (22:06 +0000)]
build: generate devel version suffix

When developing, a typical version string might look like:

    NeoMutt 20161126-4-bee236-dirty (1.7.1)

Components:
- Date of last release
- Number of commits since release
- Git commit hash of last commit
- 'dirty' if there are uncommitted changes
- Upstream Mutt version

It's appended wherever a version string is displayed, e.g. "User-Agent:"

The version suffix (-4-bee236-dirty) is checked EVERY time you run make.
However, unlike the original version, changes will only require the
rebuilding of git-ver.c

To keep things simple for the downstream distros, there are some
limitations in place:

The NeoMutt date (20161126) and the upstream Mutt version (1.7.1) are
hard-coded into configure.ac and hence the Makefile.

The suffix will be empty if:
- git isn't present
- The source isn't in a git repo
- There aren't any "neomutt-*" tags

8 years agofix: increase the max lmdb database size
Richard Russon [Mon, 12 Dec 2016 22:33:19 +0000 (22:33 +0000)]
fix: increase the max lmdb database size

A user, with over 400,000 emails was getting the error:

    MDB_MAP_FULL: Environment mapsize limit reached

This commit increases the maximum database size to 2GiB.
The file is mmap(2)'d into memory, so mutt shouldn't actually use this
much memory.

Fixes: #267
8 years agobuild: Bail if a selected hcache backend cannot be found
Pietro Cerutti [Wed, 7 Dec 2016 15:52:19 +0000 (15:52 +0000)]
build: Bail if a selected hcache backend cannot be found

8 years agofix: pick smarter default for $sidebar_divider_char
Ivan Tham [Sun, 16 Oct 2016 14:50:08 +0000 (22:50 +0800)]
fix: pick smarter default for $sidebar_divider_char

If the user hasn't set $sidebar_divider_char, then pick a character for
them, whilst respecting $ascii_chars.

Closes: #183
8 years agobuild: Re-indent configure.ac
Richard Russon [Sat, 3 Dec 2016 17:43:38 +0000 (17:43 +0000)]
build: Re-indent configure.ac

The file is now indented with tabs, only.
The indentation of all the lines has been checked.

Note: The placement of ()s and []s still isn't consistent.

8 years agobuild: New configure option --enable-everything
Darshit Shah [Thu, 1 Dec 2016 23:27:36 +0000 (00:27 +0100)]
build: New configure option --enable-everything

As of this commit, the following options are enabled:
* All 6 hcache backends
* Compressed Folder Support
* GPGME
* IMAP
* NNTP
* Notmuch
* PGP
* POP3
* SMIME
* SMTP
* Sidebar

Closes: #264
8 years agomerge: improvements to $index_format
Richard Russon [Fri, 2 Dec 2016 13:26:48 +0000 (13:26 +0000)]
merge: improvements to $index_format

 * doc: make $to_chars docs more legible
 * add unicode string helper function
 * fix: allow $to_chars to contain Unicode characters
 * feature: $from_chars highlights differences in authorship

8 years agofeature: $from_chars highlights differences in authorship
Ian Zimmerman [Fri, 2 Dec 2016 13:14:26 +0000 (13:14 +0000)]
feature: $from_chars highlights differences in authorship

This adds a new variable $from_chars which works like $to_chars.
It will add a character prefix to the %F or %L field in $index_format.
The character is determined by the contents of the To/Cc/Bcc fields.

8 years agofix: allow $to_chars to contain Unicode characters
Richard Russon [Fri, 2 Dec 2016 13:12:46 +0000 (13:12 +0000)]
fix: allow $to_chars to contain Unicode characters

Fixes: #258
8 years agoadd unicode string helper function
Richard Russon [Fri, 2 Dec 2016 13:10:41 +0000 (13:10 +0000)]
add unicode string helper function

8 years agodoc: make $to_chars docs more legible
Richard Russon [Fri, 2 Dec 2016 13:09:46 +0000 (13:09 +0000)]
doc: make $to_chars docs more legible

8 years agobuild: Fix configure.ac to require md5 if hcache is enabled
Pietro Cerutti [Thu, 1 Dec 2016 10:50:34 +0000 (10:50 +0000)]
build: Fix configure.ac to require md5 if hcache is enabled

Fixes: #261
8 years agoRemove enable-hcache configure arg and fix commend
Pietro Cerutti [Mon, 28 Nov 2016 16:55:38 +0000 (16:55 +0000)]
Remove enable-hcache configure arg and fix commend

8 years agodoc: de-tab the DocBook
Richard Russon [Wed, 30 Nov 2016 13:38:32 +0000 (13:38 +0000)]
doc: de-tab the DocBook

[ci skip]

8 years agodocs: Improve whitespace and grammar on the NNTP feature page
Wieland Hoffmann [Wed, 30 Nov 2016 13:24:04 +0000 (13:24 +0000)]
docs: Improve whitespace and grammar on the NNTP feature page

Ref: neomutt/neomutt.github.io#11

8 years agoEnable reconstruct-thread in the pager
Wieland Hoffmann [Mon, 28 Nov 2016 18:44:27 +0000 (19:44 +0100)]
Enable reconstruct-thread in the pager

Make reconstruct-thread in the pager behave more like entire-thread in the pager

This means keep displaying the message that was displayed when
reconstruct-thread was called, but redisplaying the index.

Closes: #260
8 years agobuild: enhance mutt_to_base64() (and callers)
Pietro Cerutti [Fri, 18 Nov 2016 16:49:37 +0000 (16:49 +0000)]
build: enhance mutt_to_base64() (and callers)

- take chars and cast to unsigned chars inside, remove casts from callers
- return the number of characters written to the output buffers
- Doxygenize and verboize the documentation

Closes: #250
8 years agobuild: add a constant for an aborted question
Pietro Cerutti [Tue, 22 Nov 2016 12:14:15 +0000 (12:14 +0000)]
build: add a constant for an aborted question

Mnemonize mutt_yesorno()'s return on Ctrl-G as MUTT_ABORT

Closes: #231
8 years agofix: status color breaks "mutt -D"
Pietro Cerutti [Thu, 24 Nov 2016 23:06:53 +0000 (23:06 +0000)]
fix: status color breaks "mutt -D"

"mutt -D" gets confused when it reads config for the status-color feature.

Let _mutt_parse_color fake a whole-line parsing when dry-running

Fixes: #235
8 years agobuild: fix hcache + make dist
Richard Russon [Mon, 28 Nov 2016 18:29:13 +0000 (18:29 +0000)]
build: fix hcache + make dist

The hcache changes introduced a load of new source files, but they
weren't added to the "make dist" target.

Also, "make distcheck" didn't offer any options to configure so the
build succeeded, but only because the hcache wasn't built.

8 years agoFix build failure with GPGME 1.8: do not steal the gpgme_ prefix.
Vincent Lefevre [Fri, 25 Nov 2016 23:57:42 +0000 (00:57 +0100)]
Fix build failure with GPGME 1.8: do not steal the gpgme_ prefix.

Upstream commit.

Fixes: #257
8 years agoNeoMutt 2016-11-26 (1.7.1) neomutt-20161126
Richard Russon [Sat, 26 Nov 2016 14:17:29 +0000 (14:17 +0000)]
NeoMutt 2016-11-26 (1.7.1)

8 years agotravis: restore build
Richard Russon [Sat, 26 Nov 2016 11:39:09 +0000 (11:39 +0000)]
travis: restore build

.travis.yml got overwritten when I merged the translation updates.

8 years agofix: index in pager crash
Richard Russon [Sat, 26 Nov 2016 11:20:16 +0000 (11:20 +0000)]
fix: index in pager crash

The steps to reproduce this were:
- open a mail
- change the underlying maildir while the mail is open
- reply to the mail

I can't reproduce the original crash, but it happened when the index was
being redrawn.  One of the "Context->hdrs" was NULL causing
index_make_entry to crash.

8 years agofix: tag with multiple labels
Richard Russon [Fri, 25 Nov 2016 14:38:49 +0000 (14:38 +0000)]
fix: tag with multiple labels

Fixes: #246
8 years agomerge: mass tidy up of the translation messages
Richard Russon [Fri, 25 Nov 2016 02:46:03 +0000 (02:46 +0000)]
merge: mass tidy up of the translation messages

 * convert files to utf-8
 * tidy headers
 * update list of translatable files
 * regenerate po files
 * add English (British) translation
 * fix make clean
 * drop old translation strings
 * standardise the headers
 * update German translation
 * l10n: add translator notes
 * add msgid-bug address
 * build: add option to disable translation messages
 * updated German translation
 * updated Slovak translation
 * updated sk.po
 * unwrap all lines
 * sync translations to mutt

8 years agosync translations to mutt
Richard Russon [Fri, 25 Nov 2016 02:38:21 +0000 (02:38 +0000)]
sync translations to mutt

8 years agounwrap all lines
Richard Russon [Fri, 25 Nov 2016 00:09:35 +0000 (00:09 +0000)]
unwrap all lines

8 years agoupdated sk.po
Richard Russon [Thu, 24 Nov 2016 01:31:08 +0000 (01:31 +0000)]
updated sk.po

8 years agoupdated Slovak translation
František Hájik [Thu, 24 Nov 2016 01:24:43 +0000 (01:24 +0000)]
updated Slovak translation

8 years agoupdated German translation
Richard Russon [Wed, 23 Nov 2016 17:56:31 +0000 (17:56 +0000)]
updated German translation

8 years agobuild: add option to disable translation messages
Richard Russon [Wed, 23 Nov 2016 14:37:00 +0000 (14:37 +0000)]
build: add option to disable translation messages

    ./configure --disable-po

8 years agoadd msgid-bug address
Richard Russon [Wed, 23 Nov 2016 02:17:02 +0000 (02:17 +0000)]
add msgid-bug address

8 years agol10n: add translator notes
Richard Russon [Wed, 23 Nov 2016 01:12:37 +0000 (01:12 +0000)]
l10n: add translator notes

8 years agoupdate German translation
André Berger [Tue, 22 Nov 2016 23:51:29 +0000 (23:51 +0000)]
update German translation

8 years agostandardise the headers
Richard Russon [Tue, 22 Nov 2016 19:03:09 +0000 (19:03 +0000)]
standardise the headers

8 years agodrop old translation strings
Richard Russon [Tue, 22 Nov 2016 13:49:45 +0000 (13:49 +0000)]
drop old translation strings

8 years agotravis: test messages
Richard Russon [Fri, 18 Nov 2016 02:20:34 +0000 (02:20 +0000)]
travis: test messages

8 years agofix make clean
Richard Russon [Thu, 17 Nov 2016 23:14:15 +0000 (23:14 +0000)]
fix make clean

8 years agoadd English (British) translation
Richard Russon [Thu, 17 Nov 2016 15:21:41 +0000 (15:21 +0000)]
add English (British) translation

8 years agoregenerate po files
Richard Russon [Thu, 17 Nov 2016 15:17:48 +0000 (15:17 +0000)]
regenerate po files

8 years agoupdate list of translatable files
Richard Russon [Thu, 17 Nov 2016 02:10:06 +0000 (02:10 +0000)]
update list of translatable files

8 years agotidy headers
Richard Russon [Thu, 17 Nov 2016 15:10:41 +0000 (15:10 +0000)]
tidy headers

8 years agoconvert files to utf-8
Richard Russon [Thu, 17 Nov 2016 14:52:26 +0000 (14:52 +0000)]
convert files to utf-8

8 years agolight tidying
Richard Russon [Fri, 18 Nov 2016 01:01:07 +0000 (01:01 +0000)]
light tidying

8 years agobuild: fix nntp/notmuch conditionals
Richard Russon [Fri, 18 Nov 2016 02:29:19 +0000 (02:29 +0000)]
build: fix nntp/notmuch conditionals

8 years agobuild: doc/Makefile clean neomutt-syntax.vim
Richard Russon [Thu, 17 Nov 2016 22:55:42 +0000 (22:55 +0000)]
build: doc/Makefile clean neomutt-syntax.vim

8 years agomerge: upstream fixes (mutt/default)
Richard Russon [Thu, 24 Nov 2016 20:00:59 +0000 (20:00 +0000)]
merge: upstream fixes (mutt/default)

 * When $flag_safe is set, flagged messages cannot be deleted.
 * Adds the '@' pattern modifier to limit matches to known aliases.
 * Adds <mark-message> binding to create "hotkeys" for messages.
 * Updated requirement on the C compiler.
 * Updated French translation (except for 1 string).
 * Make a string translatable. Add a missing space at the end.
 * Make a string translatable.
 * Updated French translation.
 * Updated French translation.
 * Fix mark-message translation and keybind menu.
 * More openssl1.1 fixes: remove uses of X509->name in debugging. (closes #3870)
 * Don't close stderr when opening a tunnel. (closes #3726)
 * Minor resource and error logic cleanup in tunnel_socket_open()
 * Make sure that the output of X509_NAME_oneline is null-terminated.
 * Revert db13010a2e8d but add a comment. (see #3870)
 * Corrected comment.

8 years agoCorrected comment.
Vincent Lefevre [Tue, 22 Nov 2016 02:48:10 +0000 (03:48 +0100)]
Corrected comment.

8 years agoRevert db13010a2e8d but add a comment. (see #3870)
Kevin McCarthy [Tue, 22 Nov 2016 02:03:20 +0000 (18:03 -0800)]
Revert db13010a2e8d but add a comment. (see #3870)

X509_NAME_oneline() always NULL-terminates the string, even when it
has to truncate the data to fit in buf.

8 years agoMake sure that the output of X509_NAME_oneline is null-terminated.
Vincent Lefevre [Mon, 21 Nov 2016 22:10:47 +0000 (23:10 +0100)]
Make sure that the output of X509_NAME_oneline is null-terminated.

8 years agoMinor resource and error logic cleanup in tunnel_socket_open()
Kevin McCarthy [Mon, 21 Nov 2016 00:19:18 +0000 (16:19 -0800)]
Minor resource and error logic cleanup in tunnel_socket_open()

Free the conn->sockdata on failure.  conn->fd is not set until the
bottom, and before it is set, conn->conn_close() will not be called.

Close the pin pipe if the pout pipe fails.

Call mutt_perror first on a fork failure.  Calling after the close()
may cause errno to be changed on a close failure.

8 years agoDon't close stderr when opening a tunnel. (closes #3726)
Kevin McCarthy [Mon, 21 Nov 2016 00:19:17 +0000 (16:19 -0800)]
Don't close stderr when opening a tunnel. (closes #3726)

Instead of closing stderr, redirect it to /dev/null in
tunnel_socket_open().  Otherwise a program can accidentally open a
file into handle 2 and then unknowingly use that when trying to print
to stderr.

Thanks to lotheac for the original patch, which I just modified
slightly.

8 years agoMore openssl1.1 fixes: remove uses of X509->name in debugging. (closes #3870)
Kevin McCarthy [Sun, 20 Nov 2016 03:35:07 +0000 (19:35 -0800)]
More openssl1.1 fixes: remove uses of X509->name in debugging. (closes #3870)

X509->name was a shortcut for the longer
  name = X509_NAME_oneline (X509_get_subject_name (cert),
    buf, sizeof (buf));
invocation.  Change the debugging to print the cert name and chain
names in the ssl_check_certificate() loop instead.

8 years agoFix mark-message translation and keybind menu.
Kevin McCarthy [Fri, 18 Nov 2016 23:54:27 +0000 (15:54 -0800)]
Fix mark-message translation and keybind menu.

Move the OP_MARK_MESSAGE and hotkey macro from MENU_GENERIC to the
MENU_MAIN keymap.  Putting the macro under generic prevents it from
overriding a keybinding in the index (even if the function is bound to
noop).  Additionally, the macro can only be executed from the index,
so it doesn't make sense as a generic keybinding.

Use the term "hotkey" in both the OPS and km_bind description.

Mark the km_bind description translatable.

Add L10N messages for the new translation strings.

8 years agoUpdated French translation.
Vincent Lefevre [Sun, 20 Nov 2016 00:41:49 +0000 (01:41 +0100)]
Updated French translation.

8 years agoUpdated French translation.
Vincent Lefevre [Fri, 18 Nov 2016 17:17:02 +0000 (18:17 +0100)]
Updated French translation.

8 years agoMake a string translatable.
Vincent Lefevre [Fri, 18 Nov 2016 16:00:23 +0000 (17:00 +0100)]
Make a string translatable.

8 years agoMake a string translatable. Add a missing space at the end.
Vincent Lefevre [Fri, 18 Nov 2016 15:59:22 +0000 (16:59 +0100)]
Make a string translatable. Add a missing space at the end.

8 years agoUpdated French translation (except for 1 string).
Vincent Lefevre [Fri, 18 Nov 2016 12:07:59 +0000 (13:07 +0100)]
Updated French translation (except for 1 string).

8 years agoUpdated requirement on the C compiler.
Vincent Lefevre [Fri, 18 Nov 2016 11:32:46 +0000 (12:32 +0100)]
Updated requirement on the C compiler.

8 years agoAdds <mark-message> binding to create "hotkeys" for messages.
David Champion [Thu, 17 Nov 2016 23:57:42 +0000 (15:57 -0800)]
Adds <mark-message> binding to create "hotkeys" for messages.

<mark-message>foo<enter> will create a new macro "'foo" which will
return to the current message by searching for that message's
message id.  The initial character of the macro is defined by
$mark_macro_prefix, and defaults to "'" for verisimilitude vs. vi.

Pushed by Kevin McCarthy with a minor fix.

8 years agoAdds the '@' pattern modifier to limit matches to known aliases.
David Champion [Thu, 17 Nov 2016 00:05:02 +0000 (16:05 -0800)]
Adds the '@' pattern modifier to limit matches to known aliases.

Example: ~f joe matches messages from joe. @~f joe matches messages from
any joe who is defined as an alias.

Pushed by Kevin McCarthy with two minor cosmetic fixes.

8 years agoWhen $flag_safe is set, flagged messages cannot be deleted.
David Champion [Wed, 16 Nov 2016 23:43:50 +0000 (15:43 -0800)]
When $flag_safe is set, flagged messages cannot be deleted.

This saves them from bulk operations on threads and tagged messages.  To
remove a flagged message, first unflag it.

8 years ago$forward_references includes References: header on forwards
Serge Gebhardt [Sat, 19 Nov 2016 22:15:21 +0000 (23:15 +0100)]
$forward_references includes References: header on forwards

By default a forwarded message does not reference the messages it
contains. This commit introduces a new boolean option
`$forward_references`. When it is set, a forwarded message includes the
`In-Reply-To:` and `References:` headers, just like a reply would. Hence
the forwarded message becomes part of the original thread instead of
starting a new one.

Closes: #252
8 years agoMake sure gdbm's symbols are not resolved in QDBM's compatibility layer
Pietro Cerutti [Thu, 24 Nov 2016 15:07:18 +0000 (15:07 +0000)]
Make sure gdbm's symbols are not resolved in QDBM's compatibility layer

8 years agoGive myself some credit
Richard Russon [Thu, 24 Nov 2016 15:26:13 +0000 (15:26 +0000)]
Give myself some credit

8 years agoInitialize imap_authenticate's return value to something meaningful
Pietro Cerutti [Tue, 22 Nov 2016 14:29:39 +0000 (14:29 +0000)]
Initialize imap_authenticate's return value to something meaningful

Closes: #256
8 years agomerge: hcache refactor
Richard Russon [Thu, 24 Nov 2016 14:02:48 +0000 (14:02 +0000)]
merge: hcache refactor

 * Support compilation of multiple hcache backends and run-time selection
 * More hcache-related cleanup and consistency in autoconf land
 * Hcache backends list
 * Hcache backends list up tidying
 * Implement mutt_hcache_free to dispose of header cache data

8 years agoImplement mutt_hcache_free to dispose of header cache data
Pietro Cerutti [Tue, 22 Nov 2016 09:57:37 +0000 (09:57 +0000)]
Implement mutt_hcache_free to dispose of header cache data

8 years agoHcache backends list up tidying
Pietro Cerutti [Mon, 21 Nov 2016 16:55:21 +0000 (16:55 +0000)]
Hcache backends list up tidying

8 years agoHcache backends list
Pietro Cerutti [Mon, 21 Nov 2016 16:18:49 +0000 (16:18 +0000)]
Hcache backends list

8 years agoMore hcache-related cleanup and consistency in autoconf land
Pietro Cerutti [Fri, 18 Nov 2016 12:54:31 +0000 (12:54 +0000)]
More hcache-related cleanup and consistency in autoconf land

8 years agoSupport compilation of multiple hcache backends and run-time selection
Pietro Cerutti [Thu, 10 Nov 2016 13:33:16 +0000 (13:33 +0000)]
Support compilation of multiple hcache backends and run-time selection

Backend specific APIs have been moved to hcache-backend.h

This commits introduces the support for multiple backends and an option to
configure the one to use at run time (header_cache_backend). Backends are not
mutual exclusive anymore, and several can be compiled in by specifying multiple
--with-<backend> configure options.

For backwards compatibility, the header_cache_backend option can be left empty,
in which case the first (configure.ac order) compiled-in backend is selected.
In the case of distros building with a single backend enabled - as they are
forced to do today - the hcache functionality is unchanged.

8 years agolib: Implement mutt_strchrnul()
Pietro Cerutti [Mon, 21 Nov 2016 14:09:57 +0000 (14:09 +0000)]
lib: Implement mutt_strchrnul()

Closes: #253
8 years agodocs: <escape> and \e means refers to both alt and escape key
toogley [Sun, 20 Nov 2016 13:14:21 +0000 (14:14 +0100)]
docs: <escape> and \e means refers to both alt and escape key

8 years agomerge: upstream adoption of compress
Richard Russon [Sat, 19 Nov 2016 01:39:44 +0000 (01:39 +0000)]
merge: upstream adoption of compress

 * Compress patch from the neomutt repository.
 * Compress: prefix external functions with "mutt_"
 * Compress: remove buffy stats "improvisation".
 * Compress: fix several logic and memory bugs.
 * Compress: add delegate calls to open_append and close mx_ops functions.
 * Compress: safe_fopen() the tempfile, to prevent tempfile attacks.
 * Compress: pull the lock/unlock operations into the open,close,sync operations.
 * Create mx_ops.sync operation. Refactor compress to use the mx_ops.sync.
 * Compress: fix check_mailbox and sync_mailbox.
 * Compress: escape single quotes when invoking the compress/decompress commands.
 * Compress: check mailbox type if possible when appending.
 * Ensure the compressed documentation is always built.
 * Improve two compress translation messages.
 * Revert "Compress: remove buffy stats "improvisation"."

8 years agoRevert "Compress: remove buffy stats "improvisation"."
Richard Russon [Sat, 19 Nov 2016 01:38:08 +0000 (01:38 +0000)]
Revert "Compress: remove buffy stats "improvisation"."

I think this is an improvement which should stay.

This reverts commit d273f8c1e5e1eb8695d26d1b6ce55b15a7f0a01a.

8 years agoImprove two compress translation messages.
Kevin McCarthy [Fri, 18 Nov 2016 22:20:54 +0000 (14:20 -0800)]
Improve two compress translation messages.

Change the "Error executing" to "Error running", which is used in
multiple places elsewhere in mutt.  This also removes the
unnecessary newline.

Remove the leading space in the "Error compressing" message, and
change it to match the error message in editmsg.c.

8 years agoEnsure the compressed documentation is always built.
Kevin McCarthy [Mon, 14 Nov 2016 19:02:17 +0000 (11:02 -0800)]
Ensure the compressed documentation is always built.

Add USE_COMPRESSED to makedoc-defs.h so any conditional documentation
will always be built.

8 years agoCompress: check mailbox type if possible when appending.
Kevin McCarthy [Mon, 14 Nov 2016 04:02:36 +0000 (20:02 -0800)]
Compress: check mailbox type if possible when appending.

If an append hook isn't defined, then mutt has to decompress the
mailbox.  In that case, we can check the type of the decompressed
mailbox instead of defaulting to DefaultMagic.

8 years agoCompress: escape single quotes when invoking the compress/decompress commands.
Kevin McCarthy [Mon, 14 Nov 2016 04:02:36 +0000 (20:02 -0800)]
Compress: escape single quotes when invoking the compress/decompress commands.

The format strings are placed in single quotes.  mutt_system() invokes
sh, so escape the single quotes using bourne-shell syntax: '\''

8 years agoCompress: fix check_mailbox and sync_mailbox.
Kevin McCarthy [Mon, 14 Nov 2016 04:02:35 +0000 (20:02 -0800)]
Compress: fix check_mailbox and sync_mailbox.

Change check_mailbox to delegate to the child_ops->check_mailbox if
the compressed mailbox has changed.  This allows the mailbox to
properly recover if both the decompressed mailbox and compressed file
have changed.

Change sync_mailbox to call check_mailbox before attempting to sync.
This will prevent overwriting external changes to the compressed
mailbox.

8 years agoCreate mx_ops.sync operation. Refactor compress to use the mx_ops.sync.
Kevin McCarthy [Mon, 14 Nov 2016 04:02:35 +0000 (20:02 -0800)]
Create mx_ops.sync operation. Refactor compress to use the mx_ops.sync.

Change compress.sync_mailbox() to lock the compressed mailbox around
both the tempfile sync and compress operations.  This will prevent
changes made inbetween the two syncs from being overwritten.

Thanks to Damien Riegel for his original patch refactoring
mx_ops.sync, which this patch is partially based upon.

8 years agoCompress: pull the lock/unlock operations into the open,close,sync operations.
Kevin McCarthy [Mon, 14 Nov 2016 04:02:35 +0000 (20:02 -0800)]
Compress: pull the lock/unlock operations into the open,close,sync operations.

Some operations, such as open_append and sync, need an exclusive lock
across a longer period than a single compress/decompress.  Remove it
from the execute_command and pull into the outer callers.  Store lock
information inside compress_info.

Sync and check_mailbox need more fixes, which will be addressed in
subsequent patches.

8 years agoCompress: safe_fopen() the tempfile, to prevent tempfile attacks.
Kevin McCarthy [Mon, 14 Nov 2016 04:02:35 +0000 (20:02 -0800)]
Compress: safe_fopen() the tempfile, to prevent tempfile attacks.

8 years agoCompress: add delegate calls to open_append and close mx_ops functions.
Kevin McCarthy [Mon, 14 Nov 2016 04:02:34 +0000 (20:02 -0800)]
Compress: add delegate calls to open_append and close mx_ops functions.

The open_append and close were partially duplicating mbox open_append
and close operations internally.  Change it to call the actual
delegate functions instead.

Inline the open_read() function inside open_mailbox().  Having it
split improved nothing and just complicated the code (i.e. added
error-handling checks in open_mailbox() that in reality could not
fail).

8 years agoCompress: fix several logic and memory bugs.
Kevin McCarthy [Mon, 14 Nov 2016 04:02:34 +0000 (20:02 -0800)]
Compress: fix several logic and memory bugs.

setup_paths leaks memory: realpath is already set in mx_open_mailbox()

restore_paths is unneeded.  mx_fastclose_mailbox() will free stuff,
and nothing is looking at the path once we are closing or aborting.

Make a copy of the hooks.  Otherwise 'unhook *' will leave dangling
pointers.

Add compress_info freeing inside mx_fastclose_mailbox().  Only free
inside compress.c when we want to prevent close() from doing anything.

close_mailbox() didn't preserve ctx->path on error.

execute_command() didn't return an error if the mutt_system() command
failed.

mx_open_mailbox_append() should check mutt_comp_can_append() only for
the case that the mailbox doesn't exist.  When it exists,
mx_get_magic() has already looked at the file contents before checking
for matching open_hooks.

In open_append_mailbox() if no append hook is defined, it should't
call ci->open() if the mailbox doesn't exist.  It should act just like
append and create a temporary file.

check_mailbox() needs more work.  For now, at least have it properly
close the mailbox on error.

8 years agoCompress: remove buffy stats "improvisation".
Kevin McCarthy [Mon, 14 Nov 2016 04:02:34 +0000 (20:02 -0800)]
Compress: remove buffy stats "improvisation".

Mutt doesn't support polling compressed mailboxes.  This code creates
a false impression and dirties mutt_save_message() in the process.  I
don't like it, so am taking it out.

8 years agoCompress: prefix external functions with "mutt_"
Kevin McCarthy [Mon, 14 Nov 2016 04:02:33 +0000 (20:02 -0800)]
Compress: prefix external functions with "mutt_"

Also, include compress.h in compress.c so the mx_comp_ops doesn't need
to be redeclared.

8 years agoCompress patch from the neomutt repository.
Kevin McCarthy [Mon, 14 Nov 2016 04:02:33 +0000 (20:02 -0800)]
Compress patch from the neomutt repository.

With the following changes:
- po/de.po changes trimmed to just the compress additions.

- Move the sample muttrc to contrib, and add it to the Makefile.am so it is
  distributed.  Remove the sample vimrc.

- Remove extra fluff from manual.

Thanks to Roland Rosenfeld for the original patch, and to the NeoMutt
team for their work cleaning up the patch.

8 years agomerge: upstream fixes (mutt/default)
Richard Russon [Fri, 18 Nov 2016 14:03:30 +0000 (14:03 +0000)]
merge: upstream fixes (mutt/default)

 * attach_format: add new %F placeholder
 * compose: add operation to rename an attachment
 * Chain %d->%F->%f in the attachment menu.
 * Move mbox close-append logic inside mbox_close_mailbox().

8 years agoMove mbox close-append logic inside mbox_close_mailbox().
Kevin McCarthy [Tue, 8 Nov 2016 20:42:56 +0000 (12:42 -0800)]
Move mbox close-append logic inside mbox_close_mailbox().

The mx_fastclose_mailbox() calls mx_ops->close(), which invokes
mbox_close_mailbox().

Also, close the ctx->fp inside mbox_close_mailbox().  This way, the
(to be added) compress logic can call the mx_ops->close() instead of
"knowing" to close the fp before recompressing.

mx_fastclose_mailbox() will safe_fclose() the fp again, but I'm
leaving it there just in case I missed a usage of the fp in some other
part of the code.

Thanks to Damien Riegel for the original patch.

8 years agoChain %d->%F->%f in the attachment menu.
Kevin McCarthy [Tue, 8 Nov 2016 02:10:27 +0000 (18:10 -0800)]
Chain %d->%F->%f in the attachment menu.

Previously, %d would use %f if there was no description set.

Place the new %F option in between %d and %f.  This way, %d will fall
back on %F, which will fall back on %f.  This allows the standard
attachment menu to show d_filename.

This is useful for forwarding attachments or editing draft files with
attachments.  In these cases the actual filename is sanitized but the
attachment name is preserved in d_filename.

8 years agocompose: add operation to rename an attachment
Damien Riegel [Tue, 8 Nov 2016 02:10:22 +0000 (18:10 -0800)]
compose: add operation to rename an attachment

As opposed to rename-file, which actually renames the underlying file
of the attachment, rename-attachment puts a value in d_filename, which
is used in the Content-Disposition header.

8 years agoattach_format: add new %F placeholder
Damien Riegel [Tue, 8 Nov 2016 02:06:13 +0000 (18:06 -0800)]
attach_format: add new %F placeholder

This new placeholder allows to print the attachment name as it will be
seen on the recipient side.

8 years agohooks: define hooks for startup and shutdown
Thomas Adam [Wed, 26 Oct 2016 22:58:16 +0000 (23:58 +0100)]
hooks: define hooks for startup and shutdown

Having hooks which run when mutt first starts (startup-hook) but before the
fist mbox is opened, and when mutt closes the mbox (shutdown-hook) before
exiting, allows for those notmuch users to run commands to sync the state of
their caches, etc.

support GLOBALHOOK type

There's now a few hooks (startup/shutdown/timeout) which don't operate on a
mbox or pattern, but are instead global to mutt.  Therefore, don't require the
hooks themselves to needlessly define these parameters.

Closes: #184
8 years agobuild: Improve discovery for the Berkeley Database
Pietro Cerutti [Sun, 13 Nov 2016 16:52:13 +0000 (16:52 +0000)]
build: Improve discovery for the Berkeley Database

- Drop support for old BDB versions and fix autoconf discovery
- Be more verbose when looking for BDB
- Hardcode a couple of commonly used prefixes
- Workaround empty path component expansion
- Do not clobber LIBS with BDB libraries

Closes: #228
8 years agoFix crash when doing collapse_all on an empty folder
Pietro Cerutti [Mon, 14 Nov 2016 09:01:30 +0000 (09:01 +0000)]
Fix crash when doing collapse_all on an empty folder

Closes: #230
8 years agofix: crash when browsing empty dir
Richard Russon [Sun, 13 Nov 2016 00:57:39 +0000 (00:57 +0000)]
fix: crash when browsing empty dir

The sensible-browser avoids selecting '..' when possible.
However, it *should* select '..' if there's no other option.