]> granicus.if.org Git - neomutt/log
neomutt
5 years agoadd basic tests 1651/head
Richard Russon [Tue, 16 Apr 2019 11:29:42 +0000 (12:29 +0100)]
add basic tests

5 years agolibmutt: promote mutt_buffer_concat_path to the library
Richard Russon [Thu, 11 Apr 2019 01:59:24 +0000 (02:59 +0100)]
libmutt: promote mutt_buffer_concat_path to the library

5 years agolibmutt: promote getcwd to the library
Richard Russon [Thu, 11 Apr 2019 01:52:59 +0000 (02:52 +0100)]
libmutt: promote getcwd to the library

5 years agofix Mailbox->append,changed flags
Richard Russon [Sun, 14 Apr 2019 14:30:23 +0000 (15:30 +0100)]
fix Mailbox->append,changed flags

Replying to an email caused some unwanted side-effects:
- Updating the Context left `m->changed == false`
- `mutt_write_fcc()` left `m->append == true`

5 years agofix setting the 'replied' flag
Richard Russon [Fri, 12 Apr 2019 16:17:54 +0000 (17:17 +0100)]
fix setting the 'replied' flag

When replying to an email, mark the original as 'replied'.

Fixes: #1647
5 years agomerge: convert Buffers to use the pool
Richard Russon [Tue, 16 Apr 2019 10:45:07 +0000 (11:45 +0100)]
merge: convert Buffers to use the pool

 * remove unused Buffer in cs_inherit_variable()
 * allocate Buffer in ac_free()
 * allocate Buffer in cs_register_variables()
 * allocate Buffer in mutt_folder_hook()
 * allocate Buffer in lua_mutt_call()
 * allocate Buffer in lua_mutt_enter()
 * allocate Buffer in mutt_find_hook()
 * allocate Buffer in mutt_account_hook()
 * allocate Buffer in execute_commands()
 * allocate Buffer in mutt_dump_variables()

5 years agoallocate Buffer in mutt_dump_variables() 1649/head
Richard Russon [Fri, 12 Apr 2019 10:37:43 +0000 (11:37 +0100)]
allocate Buffer in mutt_dump_variables()

5 years agoallocate Buffer in execute_commands()
Richard Russon [Fri, 12 Apr 2019 10:37:16 +0000 (11:37 +0100)]
allocate Buffer in execute_commands()

5 years agoallocate Buffer in mutt_account_hook()
Richard Russon [Fri, 12 Apr 2019 10:37:04 +0000 (11:37 +0100)]
allocate Buffer in mutt_account_hook()

5 years agoallocate Buffer in mutt_find_hook()
Richard Russon [Fri, 12 Apr 2019 10:36:52 +0000 (11:36 +0100)]
allocate Buffer in mutt_find_hook()

5 years agoallocate Buffer in lua_mutt_enter()
Richard Russon [Fri, 12 Apr 2019 10:38:15 +0000 (11:38 +0100)]
allocate Buffer in lua_mutt_enter()

5 years agoallocate Buffer in lua_mutt_call()
Richard Russon [Fri, 12 Apr 2019 10:37:56 +0000 (11:37 +0100)]
allocate Buffer in lua_mutt_call()

5 years agoallocate Buffer in mutt_folder_hook()
Richard Russon [Fri, 12 Apr 2019 10:36:37 +0000 (11:36 +0100)]
allocate Buffer in mutt_folder_hook()

5 years agoallocate Buffer in cs_register_variables()
Richard Russon [Fri, 12 Apr 2019 10:36:07 +0000 (11:36 +0100)]
allocate Buffer in cs_register_variables()

5 years agoallocate Buffer in ac_free()
Richard Russon [Fri, 12 Apr 2019 10:35:58 +0000 (11:35 +0100)]
allocate Buffer in ac_free()

5 years agoremove unused Buffer in cs_inherit_variable()
Richard Russon [Fri, 12 Apr 2019 10:36:26 +0000 (11:36 +0100)]
remove unused Buffer in cs_inherit_variable()

5 years agomerge: add framework for testing string functions
Richard Russon [Tue, 16 Apr 2019 09:49:35 +0000 (10:49 +0100)]
merge: add framework for testing string functions

 * test: templates for string functions
 * test: add string tests for degenerate cases
 * libmutt: fix code for degenerate cases
 * test: merge existing string tests
 * build: add coverage testing

5 years agobuild: add coverage testing 1655/head
Richard Russon [Tue, 16 Apr 2019 00:47:40 +0000 (01:47 +0100)]
build: add coverage testing

5 years agotest: merge existing string tests
Richard Russon [Tue, 16 Apr 2019 00:10:05 +0000 (01:10 +0100)]
test: merge existing string tests

5 years agolibmutt: fix code for degenerate cases
Richard Russon [Mon, 15 Apr 2019 23:49:25 +0000 (00:49 +0100)]
libmutt: fix code for degenerate cases

5 years agotest: add string tests for degenerate cases
Richard Russon [Mon, 15 Apr 2019 23:48:39 +0000 (00:48 +0100)]
test: add string tests for degenerate cases

5 years agotest: templates for string functions
Richard Russon [Mon, 15 Apr 2019 15:55:45 +0000 (16:55 +0100)]
test: templates for string functions

5 years agomerge: trivial fixes
Richard Russon [Mon, 15 Apr 2019 12:40:53 +0000 (13:40 +0100)]
merge: trivial fixes

 * refactor: light tidying
 * tidy macros
 * comment escape sequences
 * add: PatternExecFlags for mutt_pattern_exec()
 * tidy: mutt_copy_hdr()
 * tidy calls to mutt_copy_hdr()
 * boolify: mutt_parse_crypt_hdr()
 * boolify: mutt_enter_fname()
 * boolify: valid_passphrase()

5 years agoboolify: valid_passphrase() 1652/head
Richard Russon [Sun, 14 Apr 2019 16:30:08 +0000 (17:30 +0100)]
boolify: valid_passphrase()

5 years agoboolify: mutt_enter_fname()
Richard Russon [Fri, 12 Apr 2019 13:35:41 +0000 (14:35 +0100)]
boolify: mutt_enter_fname()

5 years agoboolify: mutt_parse_crypt_hdr()
Richard Russon [Wed, 10 Apr 2019 17:13:36 +0000 (18:13 +0100)]
boolify: mutt_parse_crypt_hdr()

5 years agotidy calls to mutt_copy_hdr()
Richard Russon [Fri, 12 Apr 2019 14:03:20 +0000 (15:03 +0100)]
tidy calls to mutt_copy_hdr()

5 years agotidy: mutt_copy_hdr()
Richard Russon [Fri, 12 Apr 2019 13:41:28 +0000 (14:41 +0100)]
tidy: mutt_copy_hdr()

5 years agoadd: PatternExecFlags for mutt_pattern_exec()
Richard Russon [Wed, 10 Apr 2019 18:06:40 +0000 (19:06 +0100)]
add: PatternExecFlags for mutt_pattern_exec()

The flags were an enum, which wasn't really suitable.

5 years agocomment escape sequences
Richard Russon [Fri, 12 Apr 2019 19:32:09 +0000 (20:32 +0100)]
comment escape sequences

5 years agotidy macros
Richard Russon [Thu, 11 Apr 2019 22:56:22 +0000 (23:56 +0100)]
tidy macros

- add underscores
- remove unused

5 years agorefactor: light tidying
Richard Russon [Thu, 11 Apr 2019 02:06:02 +0000 (03:06 +0100)]
refactor: light tidying

- clang-format
- remove unused declaration
- use bools in config definitions
- fix doxygen comments
- remove unnecessary check
- tidy list/queue definitions

5 years agoFix save_message() - set the append flag to the correct mailbox
Pietro Cerutti [Fri, 12 Apr 2019 08:57:17 +0000 (08:57 +0000)]
Fix save_message() - set the append flag to the correct mailbox

Fixes #1645

5 years agomark oauth config variables as sensitive
Jakub Jindra [Tue, 9 Apr 2019 13:50:45 +0000 (15:50 +0200)]
mark oauth config variables as sensitive

5 years agotidy: delete trailing whitespace
Richard Russon [Tue, 9 Apr 2019 14:05:23 +0000 (15:05 +0100)]
tidy: delete trailing whitespace

5 years agofix crash on startup
Richard Russon [Tue, 9 Apr 2019 13:44:15 +0000 (14:44 +0100)]
fix crash on startup

Allocate the 'folder' earlier.
Our code paths seem to differ from upstream's.

5 years agomerge: Allow reopening of Maiboxes (workaround)
Richard Russon [Tue, 9 Apr 2019 13:18:23 +0000 (14:18 +0100)]
merge: Allow reopening of Maiboxes (workaround)

 * fix ev_message()
 * fix save_message()
 * fix pop_fetch_mail()
 * fix trash_append()

5 years agofix trash_append() 1630/head
Richard Russon [Tue, 2 Apr 2019 12:50:16 +0000 (12:50 +0000)]
fix trash_append()

Prevent a crash when reopening a Mailbox.

> How exactly do these changes prevent the crash from occurring?

It's all about how mx_mbox_open() handles flags.  These four examples
are where we have a Mailbox open in 'normal' mode and try to open it
again in 'append' mode.

'Append' mode only makes sense for 'mbox' and 'compress', but the flag
affects mx_mbox_open(). It causes the function to create a duplicate
Mailbox, which is then used and discarded. The original Mailbox is now
out of sync.

The workaround, simply hides the flag for mx_mbox_open(), but
temporarily sets the internal bool append. This means that we work with
one Mailbox.

5 years agofix pop_fetch_mail()
Richard Russon [Tue, 2 Apr 2019 12:47:27 +0000 (12:47 +0000)]
fix pop_fetch_mail()

Prevent a crash when reopening a Mailbox.

> How exactly do these changes prevent the crash from occurring?

It's all about how mx_mbox_open() handles flags.  These four examples
are where we have a Mailbox open in 'normal' mode and try to open it
again in 'append' mode.

'Append' mode only makes sense for 'mbox' and 'compress', but the flag
affects mx_mbox_open(). It causes the function to create a duplicate
Mailbox, which is then used and discarded. The original Mailbox is now
out of sync.

The workaround, simply hides the flag for mx_mbox_open(), but
temporarily sets the internal bool append. This means that we work with
one Mailbox.

5 years agofix save_message()
Richard Russon [Tue, 2 Apr 2019 12:39:06 +0000 (12:39 +0000)]
fix save_message()

Prevent a crash when reopening a Mailbox.

> How exactly do these changes prevent the crash from occurring?

It's all about how mx_mbox_open() handles flags.  These four examples
are where we have a Mailbox open in 'normal' mode and try to open it
again in 'append' mode.

'Append' mode only makes sense for 'mbox' and 'compress', but the flag
affects mx_mbox_open(). It causes the function to create a duplicate
Mailbox, which is then used and discarded. The original Mailbox is now
out of sync.

The workaround, simply hides the flag for mx_mbox_open(), but
temporarily sets the internal bool append. This means that we work with
one Mailbox.

5 years agofix ev_message()
Richard Russon [Mon, 1 Apr 2019 14:09:14 +0000 (14:09 +0000)]
fix ev_message()

Prevent a crash when reopening a Mailbox.

> How exactly do these changes prevent the crash from occurring?

It's all about how mx_mbox_open() handles flags.  These four examples
are where we have a Mailbox open in 'normal' mode and try to open it
again in 'append' mode.

'Append' mode only makes sense for 'mbox' and 'compress', but the flag
affects mx_mbox_open(). It causes the function to create a duplicate
Mailbox, which is then used and discarded. The original Mailbox is now
out of sync.

The workaround, simply hides the flag for mx_mbox_open(), but
temporarily sets the internal bool append. This means that we work with
one Mailbox.

5 years agomerge: upstream changes
Richard Russon [Tue, 9 Apr 2019 13:09:00 +0000 (14:09 +0100)]
merge: upstream changes

 * browser.c: Convert LastDir and LastDirBackup to Buffer
 * browser.c: Convert prefix to Buffer
 * browser.c: Convert buf to Buffer
 * browser.c: Convert other browser local variables to Buffer
 * browser.c: Convert f parameter to Buffer
 * Create mutt_buffer_mailbox() buffer function
 * Change main() folder to be Buffer

5 years agoChange main() folder to be Buffer
Kevin McCarthy [Mon, 8 Apr 2019 01:49:07 +0000 (18:49 -0700)]
Change main() folder to be Buffer

This affects the -f, -y, and -Z options directly.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoCreate mutt_buffer_mailbox() buffer function
Kevin McCarthy [Sun, 7 Apr 2019 23:02:02 +0000 (16:02 -0700)]
Create mutt_buffer_mailbox() buffer function

Relocate some of the buffy function declarations to mailbox.h while
adding the new declaration.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agobrowser.c: Convert f parameter to Buffer
Kevin McCarthy [Tue, 12 Mar 2019 06:25:42 +0000 (14:25 +0800)]
browser.c: Convert f parameter to Buffer

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agobrowser.c: Convert other browser local variables to Buffer
Kevin McCarthy [Tue, 12 Mar 2019 05:56:51 +0000 (13:56 +0800)]
browser.c: Convert other browser local variables to Buffer

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agobrowser.c: Convert buf to Buffer
Kevin McCarthy [Tue, 12 Mar 2019 05:26:37 +0000 (13:26 +0800)]
browser.c: Convert buf to Buffer

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agobrowser.c: Convert prefix to Buffer
Kevin McCarthy [Tue, 12 Mar 2019 04:46:56 +0000 (12:46 +0800)]
browser.c: Convert prefix to Buffer

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agobrowser.c: Convert LastDir and LastDirBackup to Buffer
Kevin McCarthy [Mon, 11 Mar 2019 11:08:52 +0000 (19:08 +0800)]
browser.c: Convert LastDir and LastDirBackup to Buffer

Add a cleanup method call to main to free the Buffers.

Add mutt_buffer_concat_path() buffer helper function.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agomerge: non-functional code improvements
Richard Russon [Tue, 9 Apr 2019 12:53:29 +0000 (13:53 +0100)]
merge: non-functional code improvements

 * test: sync mutt_extract_token()
 * boolify mutt_sig_allow_interrupt()
 * unify variable names
 * use MUTT_TOKEN_NO_FLAGS
 * reduce scope of variables
 * rename 'hdr' variables
 * Replace 0 flags with their NO_FLAGS equivalent

5 years agoReplace 0 flags with their NO_FLAGS equivalent 1642/head
Richard Russon [Mon, 8 Apr 2019 23:29:04 +0000 (00:29 +0100)]
Replace 0 flags with their NO_FLAGS equivalent

When a function has a flags parameter, pass the matching `NO_FLAGS`
symbol rather than `0`.

5 years agorename 'hdr' variables
Richard Russon [Mon, 8 Apr 2019 22:40:24 +0000 (23:40 +0100)]
rename 'hdr' variables

Rename some Email and Envelope objects to 'e' and 'env'.

5 years agoreduce scope of variables
Richard Russon [Mon, 8 Apr 2019 17:36:44 +0000 (18:36 +0100)]
reduce scope of variables

5 years agouse MUTT_TOKEN_NO_FLAGS
Richard Russon [Sun, 7 Apr 2019 01:15:00 +0000 (02:15 +0100)]
use MUTT_TOKEN_NO_FLAGS

5 years agounify variable names
Richard Russon [Sat, 6 Apr 2019 21:34:26 +0000 (22:34 +0100)]
unify variable names

All file descriptors variables now begin with `fd`.

5 years agoboolify mutt_sig_allow_interrupt()
Richard Russon [Sat, 6 Apr 2019 20:43:57 +0000 (21:43 +0100)]
boolify mutt_sig_allow_interrupt()

5 years agotest: sync mutt_extract_token()
Richard Russon [Thu, 4 Apr 2019 14:53:22 +0000 (15:53 +0100)]
test: sync mutt_extract_token()

mutt_extract_token() was updated, but the copy in test/pattern wasn't.

5 years agocurses: clear screen on exit
Richard Russon [Thu, 4 Apr 2019 13:37:11 +0000 (14:37 +0100)]
curses: clear screen on exit

5 years agomerge: upstream changes
Richard Russon [Tue, 9 Apr 2019 12:02:28 +0000 (13:02 +0100)]
merge: upstream changes

 * Fix raw socket read/write to follow expected behavior
 * Fix truncation of long filenames in attachments
 * Add $include_encrypted config to prevent reply-decryption attack
 * Use gpgme recipient strings for encryption when available
 * Fix mailcap %{charset} expansion in send mode
 * Check noconv for mailcap %{charset} send mode expansion
 * Expand a couple of the comments about charset
 * Add "Message Composition Flow" section to manual
 * Minor buffer handling code cleanup
 * Improve imap uid seqset hcache buffer usage
 * Fix imap_pretty_mailbox() call to url_ciss_tostring()
 * Add mutt_buffer_expand_path()
 * Fixes to mutt_buffer_expand_path()
 * Add mutt_buffer_strcpy_n()
 * Add mutt_getcwd()
 * Add documentation on thread tree characters and config vars
 * Fail oauth quietly if it was not configured
 * Change IMAP to try oauthbearer first
 * Remove h->active hack in imap_sync_message_for_copy()
 * Restore active flag in imap_fetch_message() on error
 * Add a note about spam and the header cache in the manual

5 years agoAdd a note about spam and the header cache in the manual 1638/head
Kevin McCarthy [Wed, 3 Apr 2019 21:07:14 +0000 (14:07 -0700)]
Add a note about spam and the header cache in the manual

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoRestore active flag in imap_fetch_message() on error
Kevin McCarthy [Tue, 2 Apr 2019 19:43:55 +0000 (12:43 -0700)]
Restore active flag in imap_fetch_message() on error

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoRemove h->active hack in imap_sync_message_for_copy()
Kevin McCarthy [Tue, 2 Apr 2019 17:58:34 +0000 (10:58 -0700)]
Remove h->active hack in imap_sync_message_for_copy()

Commit 285baf9a improved FLAGS parsing such that "spurious" FLAGS
updates won't cause a mailbox reopen.

Remove the h->active=0 hack because it isn't needed now and makes
reasoning about deletes, purges, and message set generation more
difficult.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoChange IMAP to try oauthbearer first
Kevin McCarthy [Fri, 29 Mar 2019 22:21:02 +0000 (15:21 -0700)]
Change IMAP to try oauthbearer first

$imap_authenticators says if it is unset, the authenticators from
most-secure to secure will be tried.  It makes sense for oauthbearer
to come first, like with POP.

To make this change backwards compatible, it depends on the previous
commit, which changed imap_auth_oauth() to return IMAP_AUTH_UNAVAIL if
oauth is not configured or explictily requested.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoFail oauth quietly if it was not configured
Kevin McCarthy [Sun, 24 Mar 2019 01:45:31 +0000 (09:45 +0800)]
Fail oauth quietly if it was not configured

Don't report an error unless they explicitly put "oauthbearer" in the
authenticator list or configured the oauth_refresh_command.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoAdd documentation on thread tree characters and config vars
Kevin McCarthy [Thu, 21 Mar 2019 10:35:34 +0000 (18:35 +0800)]
Add documentation on thread tree characters and config vars

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoAdd mutt_getcwd()
Kevin McCarthy [Mon, 11 Mar 2019 09:38:58 +0000 (17:38 +0800)]
Add mutt_getcwd()

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoAdd mutt_buffer_strcpy_n()
Kevin McCarthy [Mon, 11 Mar 2019 09:38:18 +0000 (17:38 +0800)]
Add mutt_buffer_strcpy_n()

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoFixes to mutt_buffer_expand_path()
Kevin McCarthy [Mon, 11 Mar 2019 09:04:28 +0000 (17:04 +0800)]
Fixes to mutt_buffer_expand_path()

Create _mutt_buffer_expand_path() with the rx argument.

Use mutt_b2s() instead of derefencing buffer->data in
mutt_buffer_expand_path().  The p->data uses were safe, but the
src->data was potentially not.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoAdd mutt_buffer_expand_path()
Kevin McCarthy [Sun, 10 Mar 2019 05:27:11 +0000 (13:27 +0800)]
Add mutt_buffer_expand_path()

TODO: '@' expansion using mutt_default_save() is still using a fixed size
string parameter.

Convert imap_expand_path() and mutt_rx_sanitize_string() to use
BUFFERS instead.

Add url_ciss_tobuffer().

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoFix imap_pretty_mailbox() call to url_ciss_tostring()
Kevin McCarthy [Sun, 10 Mar 2019 12:05:12 +0000 (20:05 +0800)]
Fix imap_pretty_mailbox() call to url_ciss_tostring()

Pass the correct buffer size through, so the strfcpy added in the next
commit doesn't write past the end of the buffer.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoImprove imap uid seqset hcache buffer usage
Kevin McCarthy [Sun, 10 Mar 2019 02:03:52 +0000 (10:03 +0800)]
Improve imap uid seqset hcache buffer usage

mutt_buffer_increase_size() terminates the buffer, so there is no need
to explicitly check for an empty buffer after the
imap_msn_index_to_uid_seqset() call.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoMinor buffer handling code cleanup
Kevin McCarthy [Sun, 10 Mar 2019 01:58:07 +0000 (09:58 +0800)]
Minor buffer handling code cleanup

Use mutt_buffer_len() and mutt_buffer_clear() to make the code a bit
clearer.  There are still places in the code that manipulate the
buffers directly (pattern.c, for example), but that doesn't mean we
shouldn't abstract the buffer where we can.

Add comments in a couple places where unusual buffer manipulation is
occurring.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoAdd "Message Composition Flow" section to manual
Kevin McCarthy [Sat, 9 Mar 2019 11:12:19 +0000 (19:12 +0800)]
Add "Message Composition Flow" section to manual

This provides a brief overview of the steps during message
composition, and shows when the various hooks are executed.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoExpand a couple of the comments about charset
Kevin McCarthy [Sat, 9 Mar 2019 07:03:00 +0000 (15:03 +0800)]
Expand a couple of the comments about charset

Make it clearer what BODY->charset is used for, and why we are
checking for !noconv during mailcap charset parameter expansion.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoCheck noconv for mailcap %{charset} send mode expansion
Kevin McCarthy [Fri, 8 Mar 2019 11:48:41 +0000 (19:48 +0800)]
Check noconv for mailcap %{charset} send mode expansion

Improve the previous commit by checking to make sure a->noconv also
isn't set.  If noconv is set, we ignore any value a->charset might
have picked up during previous encoding checks.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoFix mailcap %{charset} expansion in send mode
Kevin McCarthy [Fri, 8 Mar 2019 10:06:52 +0000 (18:06 +0800)]
Fix mailcap %{charset} expansion in send mode

Use the current charset of the file for the parameter, since the file
hasn't been converted yet.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoUse gpgme recipient strings for encryption when available
Kevin McCarthy [Mon, 4 Mar 2019 07:05:50 +0000 (15:05 +0800)]
Use gpgme recipient strings for encryption when available

For gpgme >= 1.11.0, use gpgme_op_encrypt_ext() and
gpgme_op_encrypt_sign_ext() to specify recipients as a string.

This allows '!' to specify forcing a subkey, as is the case in classic
gpg and from the command line.

Remove the '!' "force valid" usage for the newer version.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoAdd $include_encrypted config to prevent reply-decryption attack
Kevin McCarthy [Fri, 22 Feb 2019 21:50:52 +0000 (13:50 -0800)]
Add $include_encrypted config to prevent reply-decryption attack

@jensvoid, in cooperation with Ruhr-Uni Bochum and FH Münster,
Germany, reported a possible "Oracle decryption" attack on various
mail clients.  An attacker could include previously encrypted contents
they obtained access to, and include it in a message.  Replying
without trimming would include the decrypted contents.

This attack relies on several "ifs", and is more dangerous for clients
that compose HTML mail.  However, it is still an issue that an
unwary/busy Mutt user could fall for.

Add a new config $include_encrytped, defaulting off, to reduce the
possibility of the user being unaware of previously encrypted parts in
the reply.  Only the main initial encrypted part will be included in
the reply.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoFix truncation of long filenames in attachments
Andrey Skvortsov [Thu, 21 Feb 2019 13:37:05 +0000 (16:37 +0300)]
Fix truncation of long filenames in attachments

Currently mutt truncates long filenames in attachments and doesn't
take into account UTF-8 character size. If filename is truncated in
the middle of multi-byte UTF-8 character (last character is bad),
then some mail clients assume whole attachment name bad and don't
display its name (use 'Noname' instead).

Filenames can be up to 255 *characters* long depending on used
filesystem. ReiserFS, NFTS, FAT, APFS and some other supports up to
255 characters.
In the worst case 255 characters in UTF-8 will take 255*4 = 1020
bytes. Every non-ascii byte in the filename will be encoded using 3
bytes (for example, %8D).
So 'Content-Disposition' will take in the worst case up to: 1020*3 =
3060 bytes. Therefore even LONG_STRING (1024) isn't enough.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoFix raw socket read/write to follow expected behavior
Kevin McCarthy [Mon, 21 Jan 2019 23:19:08 +0000 (15:19 -0800)]
Fix raw socket read/write to follow expected behavior

The mutt_sasl.c code expects conn_write() to write the entire buffer.
This is inconsistent with mutt_socket.c, but since other conn_write()
implementations guarantee this, change raw_socket_write() to do so too
for now.

Also, update reading and writing to loop on EINTR, as gnutls does.
They won't return EAGAIN or EWOULDBLOCK because we don't mark sockets
as non-blocking.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agomerge: Tidy a lot of messages/translations
Richard Russon [Tue, 9 Apr 2019 11:51:23 +0000 (12:51 +0100)]
merge: Tidy a lot of messages/translations

 * add missing constants
 * quote 'nametemplate'
 * add space after question prompt
 * remove []s from a question
 * remove colons from questions
 * use a question mark in the crypto questions
 * use a question mark in the bounce question
 * merge similar translation strings 1
 * merge similar translation strings 2
 * merge similar translation strings 2
 * quote Content-Language
 * quote alternatives
 * quote multilingual
 * quote multipart/alternative
 * quote multipart/multilingual
 * quote Content-Language
 * reword relative path error message
 * replace cannot with can't
 * ensure (o)ptions' style
 * mutt_debug
 * sync translations

5 years agosync translations
Richard Russon [Tue, 9 Apr 2019 11:51:06 +0000 (12:51 +0100)]
sync translations

5 years agomutt_debug 1637/head
Richard Russon [Fri, 5 Apr 2019 21:56:48 +0000 (22:56 +0100)]
mutt_debug

Tidy lots of debugging messages

5 years agoensure (o)ptions' style
Richard Russon [Fri, 5 Apr 2019 19:16:16 +0000 (20:16 +0100)]
ensure (o)ptions' style

Make sure all multi-choice options have their letters parenthesised.

5 years agoreplace cannot with can't
Richard Russon [Fri, 5 Apr 2019 16:17:27 +0000 (17:17 +0100)]
replace cannot with can't

"can't" is used more often than "cannot", so use it everywhere.

5 years agoreword relative path error message
Richard Russon [Fri, 5 Apr 2019 16:09:43 +0000 (17:09 +0100)]
reword relative path error message

5 years agoquote Content-Language
Richard Russon [Fri, 5 Apr 2019 16:05:17 +0000 (17:05 +0100)]
quote Content-Language

'Content-Language' is a reserved keyword -- not to be translated

5 years agoquote multipart/multilingual
Richard Russon [Fri, 5 Apr 2019 16:03:06 +0000 (17:03 +0100)]
quote multipart/multilingual

'multipart/multilingual' is a reserved keyword -- not to be translated

5 years agoquote multipart/alternative
Richard Russon [Fri, 5 Apr 2019 16:01:50 +0000 (17:01 +0100)]
quote multipart/alternative

'multipart/alternative' is a reserved keyword -- not to be translated

5 years agoquote multilingual
Richard Russon [Fri, 5 Apr 2019 15:59:26 +0000 (16:59 +0100)]
quote multilingual

'multilingual' is a reserved keyword -- not to be translated

5 years agoquote alternatives
Richard Russon [Fri, 5 Apr 2019 15:57:21 +0000 (16:57 +0100)]
quote alternatives

'alternatives' is a reserved keyword -- not to be translated

5 years agoquote Content-Language
Richard Russon [Fri, 5 Apr 2019 15:54:25 +0000 (16:54 +0100)]
quote Content-Language

'Content-Language' is a reserved keyword -- not to be translated

5 years agomerge similar translation strings 2
Richard Russon [Fri, 5 Apr 2019 15:47:04 +0000 (16:47 +0100)]
merge similar translation strings 2

- brackets
- parentheses

5 years agomerge similar translation strings 2
Richard Russon [Fri, 5 Apr 2019 15:38:58 +0000 (16:38 +0100)]
merge similar translation strings 2

- Compressing %s...
- Compressing %s

5 years agomerge similar translation strings 1
Richard Russon [Fri, 5 Apr 2019 15:35:03 +0000 (16:35 +0100)]
merge similar translation strings 1

- Can't create %s %s
- Can't create %s: %s

5 years agouse a question mark in the bounce question
Richard Russon [Fri, 5 Apr 2019 15:21:31 +0000 (16:21 +0100)]
use a question mark in the bounce question

5 years agouse a question mark in the crypto questions
Richard Russon [Fri, 5 Apr 2019 15:03:39 +0000 (16:03 +0100)]
use a question mark in the crypto questions

5 years agoremove colons from questions
Richard Russon [Fri, 5 Apr 2019 15:00:12 +0000 (16:00 +0100)]
remove colons from questions

Remove the :'s to align the style with other questions.

5 years agoremove []s from a question
Richard Russon [Fri, 5 Apr 2019 14:59:22 +0000 (15:59 +0100)]
remove []s from a question

Remove the []s to align the style with other questions.

5 years agoadd space after question prompt
Richard Russon [Fri, 5 Apr 2019 14:38:51 +0000 (15:38 +0100)]
add space after question prompt

Change the code to print a space after a question.
This simplifies the translation strings.