]> granicus.if.org Git - neomutt/log
neomutt
5 years agonotmuch: ensure message_id is correct 1797/head
Austin Ray [Sat, 3 Aug 2019 20:34:32 +0000 (16:34 -0400)]
notmuch: ensure message_id is correct

The notmuch-backend initializes a provided email struct with content
from notmuch. In rare instances, a provided email struct has a
message_id that does not match the one from notmuch. No validation to
ensure message_ids match is performed.

An issue occurs when running nm_mbox_check(), which stores all messages
in a hash table. The incorrect message_id is the key so our email is
considered missing, reloaded into the mailbox, and a duplicate appears
in the index. This triggers a warning from neomutt regarding external
modification.

Instead, validate the message_ids to ensure a match so our hash table
keys are correct. As a result, a reload is no longer performed and
neomutt's warning need not occur.

Fixes #1793

5 years agoRevert "mime_lookup: use compose mailcap entries when replying"
Pietro Cerutti [Fri, 2 Aug 2019 11:16:14 +0000 (11:16 +0000)]
Revert "mime_lookup: use compose mailcap entries when replying"

This reverts commit 672a84d9c4110343ab4d43d542b0c0933365d023.

5 years agomerge: preparation for window improvements
Richard Russon [Wed, 31 Jul 2019 12:05:47 +0000 (13:05 +0100)]
merge: preparation for window improvements

 * pager: tidy code
 * window: drop unused functions
 * window: don't pass a Window when an int will do
 * window: add new() and free()

5 years agowindow: add new() and free()
Richard Russon [Wed, 24 Jul 2019 11:36:16 +0000 (12:36 +0100)]
window: add new() and free()

5 years agowindow: don't pass a Window when an int will do
Richard Russon [Thu, 25 Jul 2019 14:22:33 +0000 (15:22 +0100)]
window: don't pass a Window when an int will do

5 years agowindow: drop unused functions
Richard Russon [Sat, 27 Jul 2019 19:07:20 +0000 (20:07 +0100)]
window: drop unused functions

5 years agopager: tidy code
Richard Russon [Thu, 25 Jul 2019 14:52:32 +0000 (15:52 +0100)]
pager: tidy code

5 years agoreflow multiline prompts correctly
Richard Russon [Tue, 30 Jul 2019 12:57:33 +0000 (13:57 +0100)]
reflow multiline prompts correctly

When asking the user a long question, NeoMutt can expand the message
window up to three lines.

This fixes two problems with multiline prompts:

- `mutt_window_reflow()` was resizing the windows when it shouldn't

- coloured (shortened) prompts weren't being measured correctly
  (causing unnecessary wrapping)

5 years agoRefactor regex with custom wrapper 1780/head
Simon Symeonidis [Fri, 19 Jul 2019 19:02:28 +0000 (15:02 -0400)]
Refactor regex with custom wrapper

5 years agomutt_sort_headers appens in ctx_update, no need to call it again
Pietro Cerutti [Thu, 25 Jul 2019 07:45:24 +0000 (07:45 +0000)]
mutt_sort_headers appens in ctx_update, no need to call it again

5 years agofix printf format strings
Richard Russon [Wed, 24 Jul 2019 20:07:07 +0000 (21:07 +0100)]
fix printf format strings

The logging functions use a printf formatting string, but unfortunately
the compiler can't automatically detect errors because of our use of
macros.

5 years agoRemove uninitialized char array buf
Zero King [Wed, 24 Jul 2019 18:27:43 +0000 (18:27 +0000)]
Remove uninitialized char array buf

5 years agodrop unused summary menu
Richard Russon [Tue, 23 Jul 2019 22:40:26 +0000 (23:40 +0100)]
drop unused summary menu

5 years agoRemove duplicate conditional expressions
Zero King [Wed, 24 Jul 2019 17:24:32 +0000 (17:24 +0000)]
Remove duplicate conditional expressions

5 years agoFix struct Buffer used as %s 1787/head
Zero King [Wed, 24 Jul 2019 16:51:12 +0000 (16:51 +0000)]
Fix struct Buffer used as %s

cmd is a Buffer struct, it does not correspond to %s in the format
string.

5 years agoHonour a Mailbox's hidden flag in the browser
Pietro Cerutti [Tue, 23 Jul 2019 13:22:38 +0000 (13:22 +0000)]
Honour a Mailbox's hidden flag in the browser

5 years agoUpdate to latest autosetup and bundled JimTcl
Pietro Cerutti [Tue, 23 Jul 2019 08:10:49 +0000 (08:10 +0000)]
Update to latest autosetup and bundled JimTcl

5 years agoUpdate to latest acutest.h
Pietro Cerutti [Tue, 23 Jul 2019 08:05:47 +0000 (08:05 +0000)]
Update to latest acutest.h

5 years agoFix browsing an IMAP backend
Pietro Cerutti [Mon, 22 Jul 2019 11:37:23 +0000 (11:37 +0000)]
Fix browsing an IMAP backend

Fixes #1783

5 years agomerge: light refactoring
Richard Russon [Sat, 20 Jul 2019 22:18:23 +0000 (23:18 +0100)]
merge: light refactoring

 * test: sync mutt_extract_token()
 * drop Buffer.destroy
 * refactor: Mailbox in mutt_display_message()
 * pager: reorganised the code
 * context: tidy for clarity
 * context: add notifications
 * notify: use data to match specific callbacks

5 years agonotify: use data to match specific callbacks
Richard Russon [Sat, 20 Jul 2019 12:48:19 +0000 (13:48 +0100)]
notify: use data to match specific callbacks

When removing a notification callback, check both the function and data
pointers.

This means we can reuse a single callback function with multiple data
objects.

5 years agocontext: add notifications
Richard Russon [Fri, 19 Jul 2019 13:51:46 +0000 (14:51 +0100)]
context: add notifications

Prepare for more Context refactoring by supporting notifications on the
Context object.

5 years agocontext: tidy for clarity
Richard Russon [Fri, 19 Jul 2019 11:09:37 +0000 (12:09 +0100)]
context: tidy for clarity

- rename msgnotreadyet
- insert whitespace into header

5 years agopager: reorganised the code
Richard Russon [Fri, 19 Jul 2019 12:38:03 +0000 (13:38 +0100)]
pager: reorganised the code

Move all the data, defines and structs to the top of the file, where
they're more discoverable.

5 years agorefactor: Mailbox in mutt_display_message()
Richard Russon [Fri, 19 Jul 2019 10:54:11 +0000 (11:54 +0100)]
refactor: Mailbox in mutt_display_message()

Pass the Mailbox into mutt_display_message() rather than relying on
Context->mailbox.

5 years agodrop Buffer.destroy
Richard Russon [Fri, 19 Jul 2019 21:48:51 +0000 (22:48 +0100)]
drop Buffer.destroy

This member controlled whether, when destroyed, a Buffer should delete
its data.  The member was only used in a couple of places, so it seems
better to duplicate the data in those cases and *always* destroy it
afterwards.

5 years agotest: sync mutt_extract_token()
Richard Russon [Fri, 19 Jul 2019 17:29:56 +0000 (18:29 +0100)]
test: sync mutt_extract_token()

The test code needs a private copy of mutt_extract_token().
Update the copy to match the latest code.

5 years agonntp: fix leaks
Richard Russon [Thu, 18 Jul 2019 16:23:54 +0000 (17:23 +0100)]
nntp: fix leaks

5 years agonntp: remove old Context references
Richard Russon [Thu, 18 Jul 2019 16:23:17 +0000 (17:23 +0100)]
nntp: remove old Context references

5 years agosmime: factor out context
Richard Russon [Thu, 18 Jul 2019 13:02:48 +0000 (14:02 +0100)]
smime: factor out context

5 years agoaddrlist: fix empty string
Richard Russon [Thu, 18 Jul 2019 12:41:24 +0000 (13:41 +0100)]
addrlist: fix empty string

5 years agonotify: fix shutdown order
Richard Russon [Thu, 18 Jul 2019 14:58:00 +0000 (15:58 +0100)]
notify: fix shutdown order

Free the Notify object after we free anyone who might use it.

5 years agoboolify monitor
Richard Russon [Wed, 17 Jul 2019 22:01:06 +0000 (23:01 +0100)]
boolify monitor

5 years agocontext: crypt_extract_keys_from_messages()
Richard Russon [Wed, 17 Jul 2019 13:33:19 +0000 (14:33 +0100)]
context: crypt_extract_keys_from_messages()

Change crypt_extract_keys_from_messages() to use a Context parameter
rather than the global.

5 years agonntp: fix refactoring bugs
Richard Russon [Wed, 17 Jul 2019 15:36:04 +0000 (16:36 +0100)]
nntp: fix refactoring bugs

- fix cli startup
- fix mailbox ptr
- fix change-folder

5 years agoemail: add events
Richard Russon [Mon, 15 Jul 2019 10:49:53 +0000 (11:49 +0100)]
email: add events

5 years agoiwyu: tidy more #includes
Richard Russon [Wed, 17 Jul 2019 01:10:53 +0000 (02:10 +0100)]
iwyu: tidy more #includes

5 years agomerge: trivial tidying
Richard Russon [Tue, 16 Jul 2019 21:43:12 +0000 (22:43 +0100)]
merge: trivial tidying

 * doxygen: fix comments
 * fix whitespace
 * rename mutt_emaillist_free() to _clear()
 * drop unused maildir_update_tables()
 * de-Context nntp_check_msgid()
 * de-Context nntp_check_children()
 * boolify imap_next_word()
 * rename dreadful local
 * email: shorten function names
 * rename ParameterList variables
 * unify private data free functions
 * hash: pick some better variable names
 * iwyu: tidy #includes

5 years agoiwyu: tidy #includes
Richard Russon [Tue, 16 Jul 2019 21:04:02 +0000 (22:04 +0100)]
iwyu: tidy #includes

5 years agohash: pick some better variable names
Richard Russon [Tue, 16 Jul 2019 20:14:50 +0000 (21:14 +0100)]
hash: pick some better variable names

5 years agounify private data free functions
Richard Russon [Tue, 16 Jul 2019 19:44:32 +0000 (20:44 +0100)]
unify private data free functions

5 years agorename ParameterList variables
Richard Russon [Tue, 16 Jul 2019 18:33:14 +0000 (19:33 +0100)]
rename ParameterList variables

5 years agoemail: shorten function names
Richard Russon [Tue, 16 Jul 2019 18:25:21 +0000 (19:25 +0100)]
email: shorten function names

5 years agorename dreadful local
Richard Russon [Tue, 16 Jul 2019 18:13:07 +0000 (19:13 +0100)]
rename dreadful local

5 years agoboolify imap_next_word()
Richard Russon [Tue, 16 Jul 2019 18:07:38 +0000 (19:07 +0100)]
boolify imap_next_word()

5 years agode-Context nntp_check_children()
Richard Russon [Tue, 16 Jul 2019 17:11:54 +0000 (18:11 +0100)]
de-Context nntp_check_children()

5 years agode-Context nntp_check_msgid()
Richard Russon [Tue, 16 Jul 2019 17:08:38 +0000 (18:08 +0100)]
de-Context nntp_check_msgid()

5 years agodrop unused maildir_update_tables()
Richard Russon [Tue, 16 Jul 2019 17:00:17 +0000 (18:00 +0100)]
drop unused maildir_update_tables()

5 years agorename mutt_emaillist_free() to _clear()
Richard Russon [Mon, 15 Jul 2019 17:36:16 +0000 (18:36 +0100)]
rename mutt_emaillist_free() to _clear()

The function doesn't free the Emails, just the list, so rename it to
match similar functions.

5 years agofix whitespace
Richard Russon [Mon, 15 Jul 2019 16:47:20 +0000 (17:47 +0100)]
fix whitespace

5 years agodoxygen: fix comments
Richard Russon [Sun, 14 Jul 2019 01:05:06 +0000 (02:05 +0100)]
doxygen: fix comments

5 years agomerge: upstream fixes
Richard Russon [Mon, 15 Jul 2019 21:37:03 +0000 (22:37 +0100)]
merge: upstream fixes

Sync to upstream: 82973a6e

 * change Command to use intptr_t
 * Don't read or save history if $history_file isn't set
 * Omit User-Agent: header by default
 * Remove unnecessary checks for strings
 * Convert $header_cache_pagesize to type DT_LONG

5 years agoConvert $header_cache_pagesize to type DT_LONG
Kevin McCarthy [Thu, 27 Jun 2019 18:06:19 +0000 (11:06 -0700)]
Convert $header_cache_pagesize to type DT_LONG

Prior to commit 4bc76c2f there was no LNUM type, and so the workaround
was to store it as a string, converting in the hcache_open_gdbm()
call.

This will not affect the user interface or config file, because DT_NUM
and DT_LNUM read in a string from the config file and convert to a
number.  Quotes are used for escaping style, not passed through to the
variable setter.

So essentially this simply moves the conversion to parse_set(), and
provides feedback for a non-numeric type immediately.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoRemove unnecessary checks for strings
Kevin McCarthy [Thu, 27 Jun 2019 22:35:12 +0000 (15:35 -0700)]
Remove unnecessary checks for strings

MuttVars of those types are set via safe_strdup(), which returns NULL
if the original is "".  Thus Var implies *Var.

A good portion of the code relies on that axiom, but over the years
some (Var && *Var) checks have crept in, including from me.

This was partially because of the INITVAL("") that were in the code,
which implied (incorrectly) the initial value could be "".  Commit
2f91d43e removed those to make it more clear.

This commit removes the *Var checks to make it even clearer, and help
avoid them creeping back in again.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoOmit User-Agent: header by default
Daniel Kahn Gillmor [Sun, 14 Jul 2019 01:49:05 +0000 (21:49 -0400)]
Omit User-Agent: header by default

The User-Agent: header can be fun and interesting and useful for
debugging, but it also leaks quite a bit of information about the user
and their software stack.

This represents a potential security risk (attackers can target the
particular stack) and also an anonymity risk (a user trying to
preserve their anonymity by sending mail from a non-associated account
might reveal quite a lot of information if their choice of mail user
agent is exposed).

Users who want to configure `user_agent` to `yes` can still do so, but
it makes sense to have safer defaults.

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agoDon't read or save history if $history_file isn't set
Kevin McCarthy [Fri, 28 Jun 2019 19:57:24 +0000 (12:57 -0700)]
Don't read or save history if $history_file isn't set

Co-authored-by: Richard Russon <rich@flatcap.org>
5 years agochange Command to use intptr_t
Richard Russon [Mon, 15 Jul 2019 19:36:40 +0000 (20:36 +0100)]
change Command to use intptr_t

5 years agofix browser attach
Richard Russon [Mon, 15 Jul 2019 16:24:40 +0000 (17:24 +0100)]
fix browser attach

5 years agosync translations
Richard Russon [Mon, 15 Jul 2019 15:32:04 +0000 (16:32 +0100)]
sync translations

5 years agofix re-opening attachments
Richard Russon [Sun, 23 Jun 2019 12:24:40 +0000 (13:24 +0100)]
fix re-opening attachments

When opening an attachment with a two part suffix, e.g. `.tar.gz`
NeoMutt created a temporary file with just `.gz`.

Hack the splitting logic to give a useful suffix

Fixes: #1699
5 years agoAvoid implicit conversion between bool and quadopt
Federico Kircheis [Sun, 14 Jul 2019 07:24:09 +0000 (09:24 +0200)]
Avoid implicit conversion between bool and quadopt

Make the conversion between `bool and `QuadOption` explicit, and avoid
depending on the underlying `enum` value.

Also state that `mutt_yesorno` works correctly for `MUTT_YES` and `MUTT_NO`

5 years agoMake callback take const param
Federico Kircheis [Wed, 10 Jul 2019 07:20:42 +0000 (09:20 +0200)]
Make callback take const param

Otherwise a realloc is potentnially unsafe

5 years agoInitialize the variable `index_hint`
Federico Kircheis [Sun, 14 Jul 2019 07:13:53 +0000 (09:13 +0200)]
Initialize the variable `index_hint`

Prior to this commit, `index_hint` is initialized if `Context && !attach_msg`.

If `query_quadoption(C_Quit, _("Quit NeoMutt?")) == MUTT_YES`,
`!Context || ((check = mx_mbox_close(&Context)) == 0)` is `false` and
`(check == MUTT_NEW_MAIL) || (check == MUTT_REOPENED)` the function `update_index`
is called with parameter `index_hint`.

As one of the condition is `query_quadoption(C_Quit, _("Quit NeoMutt?")) == MUTT_YES`,
the real current position is probably not so important.

5 years agomerge: account preparations
Richard Russon [Sat, 13 Jul 2019 23:39:22 +0000 (00:39 +0100)]
merge: account preparations

 * split up mailbox.c
 * notify: add global notifications
 * neomutt: move AllAccounts
 * notify: add Account Events
 * refactor users of AllMailboxes
 * drop AllMailboxes
 * account: add mailbox_add()
 * notify: add Mailbox Events
 * notify: drop old Context notifications
 * config: add config subsets
 * config: convert to subset
 * mailbox: rename desc to name
 * create libcore

5 years agoversion: add colour for devel features
Richard Russon [Fri, 28 Jun 2019 12:19:34 +0000 (13:19 +0100)]
version: add colour for devel features

5 years agocreate libcore
Richard Russon [Fri, 12 Jul 2019 15:16:39 +0000 (16:16 +0100)]
create libcore

5 years agodoxygen: Address struct members
Richard Russon [Sat, 13 Jul 2019 22:03:49 +0000 (23:03 +0100)]
doxygen: Address struct members

5 years agomailbox: rename desc to name
Richard Russon [Fri, 12 Jul 2019 13:17:06 +0000 (14:17 +0100)]
mailbox: rename desc to name

5 years agodoxygen: Email struct members
Richard Russon [Sat, 13 Jul 2019 18:36:14 +0000 (19:36 +0100)]
doxygen: Email struct members

5 years agoconfig: convert to subset
Richard Russon [Thu, 11 Jul 2019 11:12:27 +0000 (12:12 +0100)]
config: convert to subset

5 years agogitignore: drop old test binaries
Richard Russon [Sat, 13 Jul 2019 18:29:50 +0000 (19:29 +0100)]
gitignore: drop old test binaries

5 years agoconfig: add config subsets
Richard Russon [Wed, 10 Jul 2019 16:37:29 +0000 (17:37 +0100)]
config: add config subsets

5 years agonotify: drop old Context notifications
Richard Russon [Wed, 10 Jul 2019 16:09:21 +0000 (17:09 +0100)]
notify: drop old Context notifications

5 years agonotify: add Mailbox Events
Richard Russon [Tue, 9 Jul 2019 14:23:50 +0000 (15:23 +0100)]
notify: add Mailbox Events

5 years agoaccount: add mailbox_add()
Richard Russon [Tue, 9 Jul 2019 14:12:55 +0000 (15:12 +0100)]
account: add mailbox_add()

5 years agodrop AllMailboxes
Richard Russon [Thu, 4 Jul 2019 15:01:02 +0000 (16:01 +0100)]
drop AllMailboxes

5 years agorefactor users of AllMailboxes
Richard Russon [Wed, 3 Jul 2019 21:37:52 +0000 (22:37 +0100)]
refactor users of AllMailboxes

5 years agonotify: add Account Events
Richard Russon [Wed, 3 Jul 2019 10:01:13 +0000 (11:01 +0100)]
notify: add Account Events

5 years agoneomutt: move AllAccounts
Richard Russon [Mon, 1 Jul 2019 16:28:40 +0000 (17:28 +0100)]
neomutt: move AllAccounts

5 years agonotify: add global notifications
Richard Russon [Wed, 3 Jul 2019 10:20:15 +0000 (11:20 +0100)]
notify: add global notifications

5 years agosplit up mailbox.c
Richard Russon [Thu, 11 Jul 2019 12:26:54 +0000 (13:26 +0100)]
split up mailbox.c

5 years agomerge: Improve const-correctness
Richard Russon [Sat, 13 Jul 2019 23:13:34 +0000 (00:13 +0100)]
merge: Improve const-correctness

 * Improve const-correctness
 * Do not cast const qualifier from sort callbacks
 * Make const discards more explicit
 * Remove useless cast

5 years agoRemove useless cast 1772/head
Federico Kircheis [Wed, 10 Jul 2019 18:30:30 +0000 (20:30 +0200)]
Remove useless cast

5 years agoMake const discards more explicit
Federico Kircheis [Wed, 10 Jul 2019 18:30:30 +0000 (20:30 +0200)]
Make const discards more explicit

5 years agoDo not cast const qualifier from sort callbacks
Federico Kircheis [Wed, 10 Jul 2019 18:30:30 +0000 (20:30 +0200)]
Do not cast const qualifier from sort callbacks

If `const void*` points to an instance of type `T`, then it should be
casted to a `const T*` instance.

If `const void*` is a pointer to an instance of type `T`, then the pointer
is `const T*`.

The instance could be `const`, or could be not, but to be on the safe
side, it's casted to `T const *const *`.
In the case of pointer-to-pointer, `const` is on the right to ease
readability; from right to leaft it reads:
A pointer to a const pointer to a const T.

5 years agoImprove const-correctness
Federico Kircheis [Wed, 10 Jul 2019 18:30:30 +0000 (20:30 +0200)]
Improve const-correctness

of

  * convert_file_to
  * get_quote_level
  * mutt_write_one_header
  * classify_quote
  * gen_string_hash
  * gen_case_string_hash
  * mutt_buffer_enter_fname_full
  * parse_references

5 years agoAvoid using reserved identifiers
Federico Kircheis [Sun, 7 Jul 2019 11:04:51 +0000 (13:04 +0200)]
Avoid using reserved identifiers

Found with `clang -Wreserved-id-macro`

5 years agomerge: trivial fixes
Richard Russon [Sat, 6 Jul 2019 11:46:20 +0000 (12:46 +0100)]
merge: trivial fixes

 * rename templates
 * drop old refs to struct Header
 * unify naming of Email vars/params
 * unify naming of Mailbox vars/params
 * doxy: unify MXAPI comments
 * notmuch: fix prototypes

5 years agonotmuch: fix prototypes
Richard Russon [Sat, 6 Jul 2019 11:10:47 +0000 (12:10 +0100)]
notmuch: fix prototypes

5 years agodoxy: unify MXAPI comments
Richard Russon [Fri, 5 Jul 2019 15:46:26 +0000 (16:46 +0100)]
doxy: unify MXAPI comments

5 years agounify naming of Mailbox vars/params
Richard Russon [Fri, 5 Jul 2019 14:33:05 +0000 (15:33 +0100)]
unify naming of Mailbox vars/params

5 years agounify naming of Email vars/params
Richard Russon [Fri, 5 Jul 2019 14:04:53 +0000 (15:04 +0100)]
unify naming of Email vars/params

5 years agodrop old refs to struct Header
Richard Russon [Fri, 5 Jul 2019 13:08:07 +0000 (14:08 +0100)]
drop old refs to struct Header

5 years agorename templates
Richard Russon [Fri, 5 Jul 2019 14:27:35 +0000 (15:27 +0100)]
rename templates

5 years agoRename typedef to ParseDateRangeFlags
Federico Kircheis [Sat, 6 Jul 2019 05:23:54 +0000 (07:23 +0200)]
Rename typedef to ParseDateRangeFlags

As there is another definition of PatternFlags

5 years agomerge: trivial fixes
Richard Russon [Fri, 5 Jul 2019 11:19:00 +0000 (12:19 +0100)]
merge: trivial fixes

 * fix whitespace
 * add missing flag
 * fix compress local init
 * sidebar: pass in Mailbox
 * debug: fix levels and messages
 * tags: fix leak
 * notify: fix observer retval
 * drop nm_description_to_path() - unused
 * rename locals for consistency
 * rename account_remove_mailbox()
 * monitor #define -> enum

5 years agomonitor #define -> enum
Richard Russon [Fri, 5 Jul 2019 09:49:55 +0000 (10:49 +0100)]
monitor #define -> enum

5 years agorename account_remove_mailbox()
Richard Russon [Wed, 3 Jul 2019 12:58:35 +0000 (13:58 +0100)]
rename account_remove_mailbox()

5 years agorename locals for consistency
Richard Russon [Thu, 4 Jul 2019 18:41:57 +0000 (19:41 +0100)]
rename locals for consistency

5 years agodrop nm_description_to_path() - unused
Richard Russon [Wed, 3 Jul 2019 12:51:27 +0000 (13:51 +0100)]
drop nm_description_to_path() - unused