Age | Commit message (Collapse) | Author |
|
This will be a bit slower over IMAP from the index, but it removes
storing all the new headers in the header cache. Since those are not
used for anything except the list menu, and the list menu is
infrequently used, it's a bit wasteful to store them in the header
cache.
|
|
List-Post parsing is inline in the List-Post header handler. This moves
it to some separate functions so that we can use it for other purposes.
|
|
|
|
Fix backtick processing to append to tok instead of allocating and
assigning to tok->data directly.
|
|
|
|
|
|
Change the namer function and mutt_hcache_per_folder to operate on a
buffer parameter.
|
|
|
|
Then rename the other uses of mutt_buffer_encode_path() to
mutt_encode_path().
|
|
Commit 4c728278 converted the config far to type DT_LNUM, but
embarrassingly I missed a usage.
|
|
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.
|
|
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.
|
|
Add spaces after if, else, while, for, switch.
Unify the brace placement style. The vast majority of the code uses
Allman style so convert the relatively few K&R braces over.
|
|
These are mostly automated changes corresponding to the emacs
settings:
(c-set-style "linux")
(setq c-basic-offset 2)
(c-set-offset 'case-label '+)
Most of the code follows the convention:
(add-to-list 'c-cleanup-list 'space-before-funcall)
but this is not enforced by this indentation cleanup.
Also, I personally dislike tabs, so I have:
(setq-default indent-tabs-mode nil)
in my own configuration. However I have no desire to change every line
just for that effect. So this cleanup does nothing about the mix issue.
Some of the secondary files (e.g. regex.c) have been skipped.
I've also skipped crypt-gpgme.c, because I need to think about that
file. Werner Koch and the GnuPG team contributed most it, and it
follows the Gnu indentation settings. It should probably be made
uniform with Mutt, but I don't want to discourage future GnuPG
contribution to the file.
I manually reverted a few unsightly cleanups, and added a few tweeks
when I saw things that could be improved.
|
|
The result of
find . -name "*.[ch]" -exec emacs -batch {} \
--eval="(progn (delete-trailing-whitespace) (and (buffer-modified-p) (save-buffer)))" \;
|
|
Don't store the field in the header cache though.
|
|
When set, it automatically subscribes to mailing lists found in
List-Post headers.
This commit is based on Michael Elkins's patch from the thread
<https://marc.info/?l=mutt-users&m=127076105423565&w=2>.
I've added an opt-in variable $auto_subscribe and a hash table cache
to speed up reading headers when the variable is set.
|
|
|
|
Changeset fca7e504ab6a removed #else/#endif around two blocks of code
that won't compile with bdb enabled. Restore those directives.
Thanks to Richard Russon for pointing out the problem and saving me
from having egg all over my face with the 1.8 release!
|
|
Kyoto Cabinet documents that data from it should be freed via
kcfree().
LMDB claims ownership of the data returned, so convert its free
operation to be a noop and remove the malloc from its fetch function.
|
|
Retain the defaults as they are, although we might switch to Kyoto
Cabinet for the next major release.
|
|
Use mdb_txn_abort() to free up readonly/reset transactions, and avoid
leaking memory.
Fix hcache_delete() key generation - looks like this was an incorrect
copy/paste from the bdb code.
Use dprint, not fprintf, for debugging messages.
Remove strange blending of enum and bitfield logic for the txn_mode
state.
Remove some duplicate code from store/fetch raw.
|
|
Based on the original from JP Mens:
https://gist.github.com/jpmens/15969d9d678a3d450e4e
The following performance patch was manually applied on top of the
original patch:
https://github.com/neomutt/neomutt/commit/7e5380cd4c40d119ff83b2cf5f51f2cdb8a95ab3
A variant of this patch was added to handle larger mailboxes:
https://github.com/neomutt/neomutt/commit/6d337642e701b1dde4b5d0812e01c85f41ba65ca
Thanks to all the developers and contributors to this patch, and to
Fabian Groffen for bundling and posting this to mutt-dev.
|
|
REPLACE_LIST can be used more generally as a list of pattern
match-replace settings. SPAM_LIST was a special case of this, so
spam handling has been been changed to use REPLACE_LIST instead, and
SPAM_LIST was removed.
A generic function for performing a REPLACE_LIST replacement has
been added in mutt_apply_replace().
Commited by Kevin McCarthy with some buffer overflow fixes in
mutt_apply_replace().
|
|
Changeset 23334e967dd7 created a workaround for a namespace conflict
with Solaris and derivatives. After some discussion, the team decided
it would be best to move away from using the "M_" prefix for macros.
This patch was automatically generated by running:
perl -wpi -e 's/\bM_(\w+)\b/MUTT_$1/g' `find . -name '*.[ch]' -print`
with the exception that sys_socket.h was exempted. (That file will
be backed out subsequent to this commit.)
Thanks to Andras Salamon for supplying the perl script used to make
this change.
|
|
|
|
After committing aff8d62ebddb and taking a closer look at the tcbdb
documentation, I realized those functions don't set errno.
Change the error handling messages to instead get the ecode and
message using tcbdbecode() and tcbdberrmsg().
|
|
When the hcache open fails, it was trying to dprint. The dprint had a
%s where it was passing errno, leading to a crash in strlen.
Unify the dprint messages for tcdbopen and tcdbclose to report the
path, strerror, and errno.
Thanks to Will Yardley for capturing the stack trace!
|
|
The output of mutt_local_tz() was being passed to abs(). Technically
the return type is time_t, but it represents a small value: the timezone
offset in seconds. Add a safe explicit cast to int.
Change the txt parameter of mutt_make_help() to type const char *.
Typically all calls run the txt parameter through _(), which
accepts const char * and returns a char *. However, if NLS is not
enabled, _() is a noop, simply returning the parameter itself. In
mutt_compile_help(), items[i].name is const char *, so it will generate
a warning when passed as the txt parameter of mutt_make_help().
On some systems, e.g. OS X, snprintf is defined as a macro. One call
in hcache.c was embedding directives inside the snprintf call. This is
apparently undefined behavior, so duplicate the call instead.
|
|
This patch fixes the type punning warning by switching from (safe but
perhaps not elegant) casting to using a union.
Thanks to Vincent Lefevre for his input and suggestion to use the union
as a better solution to the problem!
|
|
|
|
gettimeofday() value should be substituted, so that a 0 uidvalidity can be used by the imap driver.
closes #3501
|
|
The variable was unused and clang warned that it was not emitted to the .o file.
|
|
User 'exg' on #mutt reported a problem when using header cache with IMAP
and spam rules. Spam tags are retrieved from cache and not updated when
spam rules change.
1. Enable header caching in muttrc
2. Set spam rules in muttrc
3. Use IMAP (or POP or Maildir). Your spam rules store spam tags into
your message headers, and these get cached.
4. Quit mutt
5. Change your spam rules in muttrc
6. Relaunch mutt
7. Because of header caching, the rfc822 headers are not reparsed, and
spam rules are not reapplied. User has outdated spam tags.
Spam rules are applied during rfc822 header parsing because it's the
only time we get a full and unadulterated view of all headers. Once
header parse is done we have only processed headers and 'user headers'
(X-headers). We might do spam rule matching against the struct HEADER
copy of headers, except that:
a. the header might not be in HEADER if it's non-standard and not an
X-header;
b. spam rules are regular expressions matching any arbitrary header
line, and we would need to map these regexps to the header used to
create the HEADER fields. This would change the syntax and behavior
of spam rules dramatically.
One solution, perhaps stopgap, is to invalidate the header cache when
spam rules change. That's what this patch does. It alters the hcache
versioning algorithm so that in addition to using the compiled-in
checksum of mutt's structures definitions, we also mix in the user's
runtime spam rules. Any time spam rules change the hcachever hash value
changes, causing the hcache to be rewritten.
|
|
If the color directive is removed from muttrc, the cached value from
the last directive would otherwise still be in effect.
|
|
Closes #3296.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This addresses the hcache safety issue but maybe doesn't fix it
completely, see #2942. This also prevents mutt from crashing when
using a hcache that was synced when syncing the mailbox (updating
changed and fully-parsed messages).
|
|
If iconv is unavailable, include the charset in effect as part of the
cache file name. Closes #3023.
|
|
|
|
|
|
|
|
|
|
|
|
|