Commit Graph

697 Commits

Author SHA1 Message Date
Dirk-Jan C. Binnema 6818c7df6c mu-msg: plug some leaks 2020-01-19 17:33:32 +02:00
Dirk-Jan C. Binnema a3d71dab91 utils: Update error exception, utils. 2020-01-18 13:40:15 +02:00
Dirk-Jan C. Binnema e203e26a38 mu-sexp: improve list-post regexp
Support more addresses.
2020-01-08 23:23:13 +02:00
Dirk-Jan C. Binnema b2014fe93e use g_snprintf instead of snprintf
Seems the latter cannot be found on some platforms; perhaps a
c++/namespace thing?

Use g_snprintf instead.
2020-01-07 23:17:15 +02:00
Dirk-Jan C. Binnema 38a91f3696 mu: include list-post address in message sexp
If there's a list-post address, include it in the message-sexp, so we
can use it when replying.
2020-01-07 22:45:20 +02:00
Dirk-Jan C. Binnema f4874cd7e1 lib/utils: Update 2020-01-05 17:46:21 +02:00
Dirk-Jan C. Binnema 12b34be3cf mu: allow for code-coverage reports 2020-01-01 15:56:48 +02:00
Dirk-Jan C. Binnema ad63044915 mu: Fix some compiler warnings 2020-01-01 15:56:48 +02:00
Dirk-Jan C. Binnema 80c5e25b08 mu: move mu/mu/tests, lib/tests one level up
Makes it easier to generator code-coverage reports
2020-01-01 15:56:48 +02:00
Dirk-Jan C. Binnema 97afdd9e3c lib: Use Mu:Error exception
Where applicable.
2020-01-01 13:25:07 +02:00
Dirk-Jan C. Binnema dfafecaf0c utils: add Mu::Error (runtime exception) 2020-01-01 13:25:07 +02:00
Dirk-Jan C. Binnema b1d4c5af79 mu: fix list-post email regexp
'_' is valid in email addresses.

Fix courtesy of jaknel; fixes #1529.
2019-12-22 15:26:45 +02:00
Dirk-Jan C. Binnema 9f93526884 move parser/utils to utils, Mux->Mu
Move the parser utils to utils/ and rename the Mux namespace into Mu.
2019-12-22 15:26:45 +02:00
Dirk-Jan C. Binnema b55e191421 update for lib/utils split
Update sources with the new paths
2019-12-22 15:26:45 +02:00
Dirk-Jan C. Binnema e5337e7658 lib: split out utils to lib/utils 2019-12-22 15:26:45 +02:00
Dirk-Jan C. Binnema 0c7831b5c9
Merge pull request #1511 from derekschrock/test-mu-maildir
lib: Allow hostname of newbase to match alnum
2019-11-17 14:20:17 +02:00
Derek Schrock 7d439928f5 lib: Use more portable locale en_US.UTF-8
On some systems (FreeBSD) en_US.utf8 doesn't exist.  Use a portable
locale en_US.UTF-8.
2019-11-16 23:01:18 -05:00
Derek Schrock 1585b933fb lib: Allow hostname of newbase to match alnum
Possible hostnames might have digits and - in them.  Crude regex to
allow hostnames that start with alnum followed by alnum or "-".

Fixes #1399
2019-11-16 22:59:04 -05:00
Dirk-Jan C. Binnema 0dab2b0faf
Merge pull request #1507 from tarsiiformes/typos
Fix typos
2019-11-09 13:06:23 +02:00
Alex Murray 5a450b1aee Treat text/markdown as plain text for issue #1503 2019-11-07 15:03:36 +10:30
Jonas Bernoulli f31d1b065d Fix typos 2019-11-06 16:13:39 +01:00
Yuri D'Elia b609080d77 Process personal flag when adding new contacts 2019-08-16 13:06:12 +02:00
Yuri D'Elia 230df78780 Avoid wrong type/warning in comparison 2019-08-16 11:50:40 +02:00
Yuri D'Elia b71b60704b Update internal cache in set_personal_addresses 2019-08-16 11:44:35 +02:00
Dirk-Jan C. Binnema 74f9f78ec0 lib: Don't use Xapian::DatabaseNotFoundError, it's too new
Xapian::DatabaseNotFoundError only arrived with Xapian 1.4.10.
2019-08-03 11:06:50 +03:00
Dirk-Jan C. Binnema 63b556da6d mu-util: fix warning 2019-08-01 22:44:03 +03:00
Dirk-Jan C. Binnema fc0ea805f5 mu-msg-fields: Mark contact fields as phrase-enabled 2019-08-01 22:11:39 +03:00
Dirk-Jan C. Binnema a8752e28c3 mu-store.hh: add it; it was missing 2019-07-31 17:19:23 +03:00
Dirk-Jan C. Binnema be4860befe tests: update for lib/mu-store changes 2019-07-30 08:51:04 +03:00
Dirk-Jan C. Binnema 83d6484f86 lib/mu-store: rework implementation
* mu-store.h, mu-store-read.cc, mu-store-write.cc, mu-store-priv.hh have been reworked
   in mu-store.{cc,hh}, it the mix of c/c++ improved
 * update all the dependent modules
 * make it easier to upgrade an database in place (without user intervention)
 * remove the xbatch-size option
2019-07-30 08:51:04 +03:00
Dirk-Jan C. Binnema b7cda29b96 mu-runtime: include string
Was missing, and breaks compilation in some environments.
2019-07-18 16:17:04 +03:00
Dirk-Jan C. Binnema 632f383c38 mu: Default to XDG Base Directory Specification
Instead of using ~/.mu, use the XDG Base Directory Specification, typically:
  ~/.cache/xapian
  ~/.cache/mu.log
  ~/.cache/parts
  ~/.config/bookmarks

Update dependencies, documentation.
2019-07-13 16:00:28 +03:00
Dirk-Jan C. Binnema 69229a4228 mu: remove contacts-path leftovers
The contacts are now embedded in the xapian database, so we don't need
the contact-path anymore. Let's remove some leftovers.
2019-07-13 13:43:57 +03:00
Dirk-Jan C. Binnema 125176d397 mu/lib: merge mu-contacts.h => mu-contacts.hh 2019-07-13 13:43:57 +03:00
Dirk-Jan C. Binnema 8ec8ab5380 mu-contacts: remove newlines from addresses
Seems gmime passes them on; and it causes havoc with our contacts cache.

Bump database schema version to force an rebuild (since that's what's
required.)
2019-07-11 23:30:27 +03:00
Dirk-Jan C. Binnema 5440747ba4 mu: require glib >= 2.38; remove g_type_init calls
Minor cleanup.
2019-07-11 23:30:27 +03:00
djcb dc271f4721 mu-contacts: fix some compiler warnings 2019-05-25 10:39:40 +03:00
djcb 9edcae0203 update store, msg for new contacts-cache handling 2019-05-11 13:41:03 +03:00
djcb bd52902290 contacts: update test cases for updated contacts
Remove the old ones, add new ones.
2019-05-11 13:41:03 +03:00
djcb 8193cc3e4c contacts: rework: install in database
Rewrite the contacts-cache backend in c++

Store the contacts as metadata in the xapian database, rather than in a
separate file.

Update the Store to deal with this.
2019-05-11 13:41:03 +03:00
Evan Klitzke 0cc94468b3
Fix pedantic -Wparentheses warning emitted by gcc 9.0 2019-05-06 07:58:37 -07:00
djcb 6e8378ddcd mu: update crypto verify test 2019-03-24 11:54:12 +02:00
djcb bc891030f6 mu: fix utf-8 flatten 2019-03-24 11:43:51 +02:00
djcb da10f30adf utils: small optimization in utf8_flatten
In the common path, avoid building an unneeded std::string. This should
up in some profiles.
2019-03-23 17:00:25 +02:00
djcb 9bffb465bd mu: don't include text attachments as part of body
It's somewhat nice in some case, but not generally so; so let's not do
it.
2019-02-18 08:30:55 +02:00
Dirk-Jan C. Binnema d41242ff6c
Merge pull request #1359 from OnkelUlla/fix_compiler_warnings
Fix compiler warnings
2019-01-17 22:26:50 +02:00
Dirk-Jan C. Binnema 0903eaba79
Merge pull request #1284 from nicolasavru/limit-threading-set
Perform threading calculation on related set instead of entire result.
2019-01-13 22:53:45 +02:00
Ulrich Ölmann d37a961c8f parser: fix clang-7.0.1 warnings
Without this commit clang++-7.0.1 whines

|   CXX      parser.lo
| parser.cc:138:15: warning: braces around scalar initializer [-Wbraced-scalar-init]
|         return Tree({{Node::Type::Range},
|                      ^~~~~~~~~~~~~~~~~~~
2019-01-11 06:49:01 +01:00
Ulrich Ölmann 493a9efa7a mu, tests: fix gcc-8.2.0 warnings
Without this commit gcc-8.2.0 whines

|   CC       mu-msg-json.lo
| mu-msg-json.c: In function ‘get_temp_file_maybe’:
| mu-msg-json.c:254:14: warning: unused variable ‘tmpfile’ [-Wunused-variable]
|   char *tmp, *tmpfile;
|               ^~~~~~~
| mu-msg-json.c:254:8: warning: unused variable ‘tmp’ [-Wunused-variable]
|   char *tmp, *tmpfile;
|         ^~~
| mu-msg-json.c: In function ‘add_part_crypto’:
| mu-msg-json.c:276:21: warning: unused variable ‘s’ [-Wunused-variable]
|   char    *signers, *s;
|                      ^
| mu-msg-json.c:276:11: warning: unused variable ‘signers’ [-Wunused-variable]
|   char    *signers, *s;
|            ^~~~~~~
| mu-msg-json.c: In function ‘each_part’:
| mu-msg-json.c:332:14: warning: variable ‘cid’ set but not used [-Wunused-but-set-variable]
|   const char *cid;
|               ^~~

and

|   CC       test-mu-str.o
| test-mu-str.c: In function ‘test_mu_str_subject_normalize’:
| test-mu-str.c:282:5: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "test123", "test123" },
|      ^~~~~~~~~
| test-mu-str.c:282:16: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "test123", "test123" },
|                 ^~~~~~~~~
| test-mu-str.c:283:5: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "Re:test123", "test123" },
|      ^~~~~~~~~~~~
| test-mu-str.c:283:19: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "Re:test123", "test123" },
|                    ^~~~~~~~~
| test-mu-str.c:284:5: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "Re: Fwd: test123", "test123" },
|      ^~~~~~~~~~~~~~~~~~
| test-mu-str.c:284:25: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "Re: Fwd: test123", "test123" },
|                          ^~~~~~~~~
| test-mu-str.c:285:5: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "Re[3]: Fwd: test123", "test123" },
|      ^~~~~~~~~~~~~~~~~~~~~
| test-mu-str.c:285:28: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "Re[3]: Fwd: test123", "test123" },
|                             ^~~~~~~~~
| test-mu-str.c:286:5: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "operation: mindcrime", "operation: mindcrime" }, /*...*/
|      ^~~~~~~~~~~~~~~~~~~~~~
| test-mu-str.c:286:29: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "operation: mindcrime", "operation: mindcrime" }, /*...*/
|                              ^~~~~~~~~~~~~~~~~~~~~~
| test-mu-str.c:287:5: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "", "" }
|      ^~
| test-mu-str.c:287:9: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "", "" }
|          ^~
2019-01-11 06:48:51 +01:00
djcb 53c1b0a069 mu: make attachment test a bit looser
Consider all 'inline' text parts attachments too, unless they're
'text/plain' or something that looks like a signature.

It's a heuristic so we might get some new corner-cases.. let's see.
2018-12-30 18:46:43 +02:00
djcb 7b6bccd49a parser: avoid query parsing error
See #1261.
2018-11-11 13:15:08 +02:00
djcb a19b4ddb2d mu: implement mu_msg_to_json
Follows mu_msg_to_sexp, but instead uses json as the output format,
using json-glib.
2018-11-11 12:47:47 +02:00
djcb 93bd1b8ce7 mu: add soft dependency on json-glib
If it's available it will be used.
2018-11-11 12:12:36 +02:00
djcb 2aa299b3ac mu: add mu_msg_iter_is_(first|last)
This makes it a bit easier to process the output.
2018-11-11 12:11:06 +02:00
djcb e321d15c2a mu: fake reply-to for mailing-list posts
Some mailing lists do _not_ set reply-to, see e.g.,
   https://github.com/djcb/mu/pull/1278

In that case, use the 'List-Post' address instead, so the behavior is
the same (in mu4e) as for other mailing lists.
2018-11-04 12:31:32 +02:00
djcb 052a228be7 add optional support for building with asan 2018-11-04 12:31:32 +02:00
djcb aa70bf1920 Merge branch 'pr-1111'
Fix a bunch of conflicts, tests.
2018-08-18 10:29:40 +03:00
djcb aafeb82a6e mu: decode rfc-2047-encoded mailing lists
Fixes #1292.

Note: does require rebuilding the mu database (--rebuild).
2018-08-14 22:38:27 +03:00
djcb 93c6ff1f85 mu: protect against overly long keys
We got some errors when some of the key values exceeded the Xapian
maximum; in particular the message-id.

So make all the key-methods check, and truncate the message-id if
necessary.
2018-08-14 21:57:33 +03:00
Nicolas Avrutin eb9bfbb1ca Perform threading calculation on related set instead of entire result.
The current threading algorithm is applied to the entire result of a query, even
if maxnum is specified, and then the result of the threading algorithm is
truncated to maxnum. The improves threading results by returning the entire
thread even when only a single message makes it into the top maxnum results.

This commit applies the threading algorithm to the related message set of the
maxnum-truncated query result instead of to the entire query result. For a given
set of messages, the set of messages which will share threads with any of the
original messages is exactly the related message sets. Put another way, either
any messages returned by the original query but removed by the maxnum truncation
will also be returned by the related message query, or they would not have been
needed anyway because they would not be members of any visible thread.

To maintain backward compatibility and allow threading to be used without
including related messages, the related message set is found for the threading
calculation, but any messages which would not have matched the original query
are then pruned, resulting in a superset of the truncated query, but a subset of
the untruncated query.

This does not improve (or degrade) the run time of a threading calculation when
maxnum is not set, but significant improves it when maxnum is set by making it
scale (roughly) linearly in terms of maxnum. On a maildir with ~200k messages
and maxnum set to 500 (the default), the run time of a threading calculation is
lowered from ~1m to ~0.1s.

Perform threading calculation on related set instead of entire result.

The current threading algorithm is applied to the entire result of a query, even
if maxnum is specified, and then the result of the threading algorithm is
truncated to maxnum. The improves threading results by returning the entire
thread even when only a single message makes it into the top maxnum results.

This commit applies the threading algorithm to the related message set of the
maxnum-truncated query result instead of to the entire query result. For a given
set of messages, the set of messages which will share threads with any of the
original messages is exactly the related message sets. Put another way, either
any messages returned by the original query but removed by the maxnum truncation
will also be returned by the related message query, or they would not have been
needed anyway because they would not be members of any visible thread.

To maintain backward compatibility and allow threading to be used without
including related messages, the related message set is found for the threading
calculation, but any messages which would not have matched the original query
are then pruned, resulting in a superset of the truncated query, but a subset of
the untruncated query.

This does not improve (or degrade) the run time of a threading calculation when
maxnum is not set, but significant improves it when maxnum is set by making it
scale (roughly) linearly in terms of maxnum. On a maildir with ~200k messages
and maxnum set to 500 (the default), the run time of a threading calculation is
lowered from ~1m to ~0.1s.
2018-07-09 02:41:22 -04:00
djcb 2d954e9647 mu: fix strncpy usage
Ensure the resulting strings are \0-terminated.
2018-06-11 09:18:27 +03:00
djcb 7a8d43dc5f only use OP_WILDCARD for xapian >= 1.3.3
It's not available for earlier versions.
2018-05-19 22:22:41 +03:00
djcb 6290e4ad9a query-parser: special-case wildcards
We were transforming wild-card searches into regular-expression
searches; while that works, it's also significantly slower.

So, instead, special-case wildcards, and use the Xapian machinery for
wildcard queries.
2018-05-19 11:20:58 +03:00
Marcelo Henrique Cerri 297120dc6c lib: add last_child flag to thread information
With that flag it's possible to reconstruct the entire thread tree
structure in mu4e.
2018-04-23 01:05:54 -03:00
djcb b4cc67d455 parser/tests: allow for DST change
e.g. 21d / 2w are subject to DST; update the tolerance.
2018-03-31 18:44:17 +03:00
djcb 0356af5c98 mu: avoid runtime warning 2018-03-31 13:17:06 +03:00
djcb ebbe3ea023 mu: _XOPEN_SOURCE: fix typo 2018-03-10 13:05:44 +02:00
djcb 6fe67b354d lib/parser: fix month days
In the olden days, we stored dates like e.g. 20180131121234, and do a
lexicographical check. With that, we could use e.g. upper-limits
201802312359 for "all dates in Feb 2018", even if Feb doesn't have 31
days.

However, nowadays we use time_t values, and g_date_time_new_local raises
errors for non-existent days; easiest fix is to massage things a bit; so
let's do that.

Fixes issue #1197.
2018-02-17 18:07:13 +02:00
djcb 15ba4699ab lib/parser: use g_vasprintf, _XOPEN_SOURCE
Attempt to restore building on Cygwin.
2018-02-11 12:02:53 +02:00
djcb 620912c62b mu: support 'raw' query (internally)
Allow for passing 'raw' queries to xapian, without any parsing.
2017-12-03 22:16:32 +02:00
djcb f840d0deaa parser: promote single value to a range for range-fields
Treat e.g. 'date:20170101' as 'date:20170101..20170101', just like
the Xapian parser does.
2017-12-03 12:39:31 +02:00
djcb dbc162ef9b cosmetic 2017-11-05 13:47:30 +02:00
djcb f794cea6e7 parser: small regex optimization 2017-11-04 14:32:41 +02:00
djcb 6a0654c91b parser/utils: enforce 64-bit times on 32-bit platforms
don't assume a 64-bit platform.
2017-11-04 11:30:23 +00:00
djcb ec51f66da2 test-str: fix arglist test 2017-11-04 13:06:43 +02:00
djcb 3cd150f289 parser: handle implicit 'and not' 2017-11-04 12:59:48 +02:00
djcb d18e0a1d84 query: don't be too eager matching field names
only match shortcuts when the field length was 1.
2017-11-02 08:06:48 +02:00
djcb 65863e46cd parser: fix and-not precedence
For now, don't treat "and not" specially; this gets us back into a
somewhat working state. At some point, we probably _do_ want to
special-case and_not though (since Xapian supports it).
2017-10-31 07:18:14 +02:00
djcb ea2ffe23ae mu: fix quoting/unquoting parameters 2017-10-30 22:06:36 +02:00
djcb 363075a6fd doc: tickle
Don't error out when asked for tickle docs.
2017-10-30 21:15:47 +02:00
djcb 4ca6b527b7 mu: use correct conversion for size
This changed with the new parser.
2017-10-30 21:14:20 +02:00
djcb 6053c1ec1f mu: fix clang build
casting error
2017-10-30 08:25:43 +02:00
djcb 57b5fe6156 mu: some optimizations
add fast-path for (common) plain-ascii. fix silly static misuse.

should improve indexing with some single-digit percentage.
2017-10-29 13:34:57 +02:00
djcb 55ffb524db tokenizer: clean unicode-aware 2017-10-28 14:13:09 +03:00
djcb 0e5e8b6bce parser: add more tests 2017-10-28 14:12:50 +03:00
djcb 509500a9d2 server: update query processing
fix quoting issues with mu4e
2017-10-27 18:43:33 +03:00
djcb 6ce7c89488 phrases: only allow for index fields 2017-10-27 18:42:58 +03:00
djcb fe18603843 parser: fix some post-c++14 code
don't require anything post c++14
2017-10-27 18:40:37 +03:00
djcb 160d3ec036 query-parser: cleanup source string
Ensure there's no non-' ' whitespace, and no trailing/leading spaces.
2017-10-27 01:21:57 +03:00
djcb 7cd7d118e2 query-parser: support phrase queries 2017-10-26 21:31:22 +03:00
djcb 17c97d4606 mu: remove some dead code 2017-10-25 23:50:17 +03:00
djcb 2d966ee2ad tests: remove obsolete tests 2017-10-25 23:50:17 +03:00
djcb aa07c4a27c update commands for new query parser 2017-10-25 23:50:17 +03:00
djcb 5e9cafea59 integrate new query parser 2017-10-25 23:50:17 +03:00
djcb b75f9f508b lib: implement new query parser
mu's query parser is the piece of software that turns your queries
into something the Xapian database can understand. So, if you query
"maildir:/inbox and subject:bla" this must be translated into a
Xapian::Query object which will retrieve the sought after messages.

Since mu's beginning, almost a decade ago, this parser was based on
Xapian's default Xapian::QueryParser. It works okay, but wasn't really
designed for the mu use-case, and had a bit of trouble with anything
that's not A..Z (think: spaces, special characters, unicode etc.).

Over the years, mu added quite a bit of pre-processing trickery to
deal with that. Still, there were corner cases and bugs that were
practically unfixable.

The solution to all of this is to have a custom query processor that
replaces Xapian's, and write it from the ground up to deal with the
special characters etc. I wrote one, as part of my "future, post-1.0
mu" reseach project, and I have now backported it to the mu 0.9.19.

From a technical perspective, this is a major cleanup, and allows us
to get rid of much of the fragile preprocessing both for indexing and
querying. From and end-user perspective this (hopefully) means that
many of the little parsing issues are gone, and it opens the way for
some new features.

From an end-user perspective:
- better support for special characters.
- regexp search! yes, you can now search for regular expressions, e.g.
      subject:/h.ll?o/
  will find subjects with hallo, hello, halo,  philosophy, ...

  As you can imagine, this can be a _heavy_ operation on the database,
  and might take quite a bit longer than a normal query; but it can be
  quite useful.
2017-10-24 22:55:35 +03:00
djcb 97cb519788 cosmetic 2017-08-27 17:33:21 +03:00
djcb 6eceb5eee3 mu: include signers in signature report
Include the names/email address of signer in the reports, so we can use
them in mu4e.
2017-08-27 17:32:23 +03:00
Yuri D'Elia 61341486d2 Support gmime 3.0 2017-07-30 16:47:38 +02:00
djcb 4014e3d210 mu: cosmetics 2017-07-02 10:46:08 +03:00
Sean 'Shaleh' Perry 588d227171 Simplify logic of mu_str_remove_ctrl_in_place. Add tests. 2017-06-24 13:26:10 +02:00
djcb 99423234b8 mu: fix some compiler warnings 2017-06-24 12:20:16 +02:00
djcb 855a8a5c5e mu: properly escape include file-names (forward)
We weren't properly escaping filenames when returning them for
forwarding. Let's do so now.
2017-04-09 11:31:39 +03:00
Dirk-Jan C. Binnema d4b0b1c3b5 Merge pull request #1031 from avar/add-mu_home-env-variable
Add support for specifying --muhome via MU_HOME in the environment
2017-03-05 15:52:30 +02:00
djcb ce88e76569 cosmetics 2017-03-05 15:32:02 +02:00
djcb 11d0515376 mu: allow for negative first param in sexp date spec
The first parameter xx in a (:date xx yy zz) can be negative in some
cases, e.g. to specify pre-1970 dates.
2017-03-05 15:32:02 +02:00
Ævar Arnfjörð Bjarmason 18b8ce249f Add support for specifying --muhome via MU_HOME in the environment
When you have multiple mu home directories, e.g. for the use case
detailed in my "Changing mu4e-{maildir,mu-home} from a context hook"
post to the mailing list it's quite inconvenient to have to hammer out
"mu --muhome=.. find .." every time you want to run some ad-hoc
command.

This allows me to set up a screen session where I do searches in mu
directory A in some screen panes, and searches in directory B in
others.

I initially called this MU_MUHOME but then I noticed that the perl
plugin has MUP_MU_HOME for analogous functionality, so I'm just
following its example.

The code I'm adding in mu-util.c is just a copy/paste & adjustment of
the same sort of already tested functionality in
mu_util_guess_maildir() just a few lines earlier.
2017-02-17 11:28:45 +01:00
Stig Brautaset cdc2fa1bd8 Respect format=flowed and delsp=yes for viewing plain-text messages 2017-01-31 11:28:55 +00:00
djcb 786e7c3d1f mu: add 'tickle' command, for renaming messages
The new command 'tickle' renames message files in place, which can be
useful for 3rd-party tools.
2017-01-14 13:09:17 +02:00
djcb 688507f193 lib: fix a few compiler warnings
WARN_C(XX)FLAGS is really strict.
2017-01-03 00:37:19 +02:00
djcb 72a1da9da8 mu: fix some compiler warnings 2016-12-28 16:32:39 +02:00
Hong Xu 887e75c4ee Child processes should be session leaders.
If not, when the session of mu is killed, these child processes are also
killed. This scenario shows up when using mu4e: a PDF attachment, for
example, is opened by Evince, but as soon as Emacs exits, Evince is also
killed.
2016-12-28 13:51:20 +02:00
djcb 30dab7c312 cfind: uniquify nicks
Ensure uniqueness of nicks by adding a numerical suffix when the root
nicks are not unique (up to 1000).

Fixes issue #987.
2016-12-27 16:21:10 +02:00
djcb 78275278cf mu: fix some compiler warnings 2016-12-11 18:33:31 +02:00
Stig Brautaset e9c6568a57 mu: swap begin and end if begin is _numerically_ bigger than end
The old behaviour would compare the strings, so would swap the start and end
ranges if start was 3K and end was 2M.

Fixes: 964
2016-12-03 23:19:27 +00:00
djcb 902d081c88 mu: mark some more inline parts as attachments
Recognize some more inline parts as attachments.
2016-11-24 22:51:23 +02:00
djcb 1494923472 mu: fix broken clear_links
clear_links as used for the --clear-links option had some broken
filename generation, causing garbage data at the end.

Clean up this old code, and fix this problem as a side-effect.

Fixes issue #951.
2016-11-19 16:30:09 +02:00
djcb 98505aa23b mu: fix mu_util_fputs_encode for non-utf8
mu_util_fputs_encode was aborting on behalf of the stack-guard on
OpenBSD (seemingly only when compile with optimization). It appears as
if the root cause of this was a differences in sizes of the parameters
to g_locale_from_utf8. Fix this.
2016-11-16 20:23:03 +02:00
djcb d30e0ab2ba mu: fix contacts callback return value
The callbacks for the contacts functions should return TRUE (or be
terminated early), but were void. Seems on Linux this usually still
worked, not so on OpenBSD at least (unit test broke). So, fix this.
2016-11-16 20:20:15 +02:00
djcb 01a47effb0 mu: include text-part attachments in body
Include text-like attachments parts in the message-body, too
2016-11-15 23:51:38 +02:00
djcb 10b3352565 mu: include patch/diff files in plain-text body
Some text/... parts can be show inline as part of the body text; for
instance patches. So, treat those specially.
2016-11-12 13:50:32 +02:00
djcb 7526f118ba mu: some cosmetics / minor cleanup 2016-10-26 22:36:40 +03:00
djcb c9f8ac5beb crypto: prefer gpg2
Can't say I fully understand what's going on, but it seems gpg-before-2
has some trouble with its agent, at least when using
gnome-session (which stopped using gnome-keyring as a gpg-agent since
Fedora 23 at least).

Sanity seems to be restored when preferring gpg2 instead. "gpg" is used
when gpg2 isn't there; and there's the MU_GPG_PATH env variable to
override all of that.
2016-07-24 16:00:04 +03:00
djcb 9477071e63 mu: add '--lazy-check' option for indexing
Add an option --lazy-check to ignore any directories that don't have
their ctime changed since the last indexing operation.

There are a few corner-cases (such as editing a message outside mu's
control) where this might miss a change, but apart from that, makes
indexing in for a maildir (and its sub-maildirs) almost a no-op if there
were no changes.
2016-07-23 21:33:10 +03:00
djcb 2a83b02ce2 mu: cosmetic 2016-07-23 19:14:13 +03:00
djcb 3e6267fd05 mu-maildir: ignore backup/temporary files
Ignore backup/temporary files, i.e., files ending in ~ or #.

Fixes #855.
2016-06-05 19:29:53 +03:00
Aaron LI 297df938d6 Use Unicode characters when cleaning up attachment filename
Improve the function ``cleanup_filename()`` of ``lib/mu-msg-part.c`` to
use Unicode characters when replacing the control characters, slashes
and colons with ``-``.

Originally, this function just use plain C characters (i.e., assuming
ASCII string) when checking each character is or not a control character,
slash or colon.  However, when the attachment filename contains non-ASCII
(e.g., Chinese characters), all the non-ASCII characters are replaced
with ``-``.

For example:
* Before:
```
> mu view test_chinese_attachment_filename.eml
From: Tester <tester@example.com>
To: Example <example@example.com>
Subject: Test email with attachment of Chinese filename
Date: Mon 23 May 2016 05:22:09 PM CST
Attachments: 'attachment-test.txt', '------------.txt', '-------test.txt'
Hello,

This is a simple test email with three attachments:

1. `attachment:test.txt`: filename is all English;
2. `测试附件.txt`: filename is all Chinese (exclude the extension);
3. `附件-test.txt`: filename mixes Chinese and English.
```

* After:
```
> ./build/mu/mu/mu view test_chinese_attachment_filename.eml
From: Tester <tester@example.com>
To: Example <example@example.com>
Subject: Test email with attachment of Chinese filename
Date: Mon 23 May 2016 05:22:09 PM CST
Attachments: 'attachment-test.txt', '测试附件.txt', '附件-test.txt'
Hello,

This is a simple test email with three attachments:

1. `attachment:test.txt`: filename is all English;
2. `测试附件.txt`: filename is all Chinese (exclude the extension);
3. `附件-test.txt`: filename mixes Chinese and English.
```
2016-05-23 19:26:04 +08:00
djcb a81270583f Add unit-test for multi-to/cc recipients
To check for the report in Issue #826.
2016-05-15 16:21:20 +03:00
Jun Hao f998a0ad1e mu: expose content id to attachment plist 2016-05-07 09:07:11 +08:00
djcb c46dda206f mu: fix a few mem leaks 2016-05-06 22:08:12 +03:00
djcb 66f205f6c5 mu: improve filename escaping
Sanitize attachment-names by replacing all control characters, '/' and
':'' by '-', but leave spaces alone.
2016-03-15 06:59:35 +02:00
djcb acd00a0b3f mu: add user-agent property to msg plist
Add a user-agent property to the full message sexps (i.e., the ones
available in mu4e-view). This property contains either the User-Agent or
X-Mailer string (and is absent otherwise)
2016-03-14 22:53:42 +02:00
djcb 68f5dc3973 mu: Change default max msg size to 500 Mb
Seems people are getting really big mails these days, so let's up the
default (which is also what mu4e uses) to 500 Mb (which should be enough
for everyone, always)
2016-03-13 19:07:49 +02:00
djcb 775eb3f715 mu: write contacts-cache a bit sooner
Write the changes to the cache file after any indexing operation, so `mu
cfind` gets new contacts a bit sooner.
2016-02-21 19:48:21 +02:00
djcb 02e26c9cb4 mu: attachment names are already quoted
Fixes #796.
2016-02-15 20:14:24 +02:00
djcb 8d4b866383 Fix some compiler warnings 2016-02-14 12:13:11 +02:00
Nicolas Richard f9d174af57 mu: escape the name of the part 2016-02-10 15:03:31 +01:00
djcb 413d0e1f49 fix make-dist
Silence a few tests that pass, but not with make-dist. Obviously, this
needs some more investigation.
2016-01-20 20:18:07 +02:00
djcb 02620af4c2 mu/mu4e: improve in contacts completion
mu: cleanup server side; make sure not to loose 'personal' flag when
    seeing same contact in non-personal context
mu4e: tweak the sorting algorithm a bit to take the personal flag into
    account
2015-12-30 15:33:27 +02:00
djcb b21eabf954 mu: overwrite duplicate target files
over write target files when moving (when they seem to be the
same). Should make the case where you have copies a bit smoother.
2015-12-24 16:06:51 +02:00
Ævar Arnfjörð Bjarmason f7245d2372 mu-store: Silence confusing code that's throwing a clang warning
Doing:

    !access(...) == 0

Is equivalent to:

    (!access(...)) == 0

Not:

    !(access(...) == 0)

And throws this warning under clang:

    mu-store.cc:77:6: warning: logical not is only applied to the left hand
    side of this comparison [-Wlogical-not-parentheses]
            if (!access(xpath, F_OK) == 0) {
                ^                    ~~
    mu-store.cc:77:6: note: add parentheses after the '!' to evaluate the
    comparison first
            if (!access(xpath, F_OK) == 0) {
                ^
                 (                       )
    mu-store.cc:77:6: note: add parentheses around left hand side expression
    to silence this warning
            if (!access(xpath, F_OK) == 0) {
                ^
                (                   )

It ends up doing what the author intended anyway since access() returns
-1 on error, and !-1 == 0, but just do the more obvious check and check
that we don't get 0 here with !=.
2015-12-15 12:40:40 +01:00
djcb 3cf96899ef mu: decode mailing-list headers
MIME-decode mailing list headers, too. Also add a unit test. This fixes
issue #728.
2015-12-15 07:21:26 +02:00
djcb 6df9322257 Fix typo near get_new_basename
And clear op the function a bit.
2015-11-18 15:55:34 +02:00
djcb 539bd9be19 Fix message file creation
Make sure we 0-pad the numeric parts in message file names; this was
breaking some unit test.
2015-11-18 09:50:36 +02:00
djcb fe8b3430c6 mu: optimize indexing (get_uid_term)
Some users were report seeing get_uid_term high in the profiles; so
optimize this:

- make mu_util_get_hash a static inline function (used by get_uid_term)
- don't use 'realpath' in get_uid_term, seem that's the main culprit
- some slight faster string handling there too.
2015-11-17 10:55:56 +02:00
djcb 50d25ce0e0 mu: use '.msgpart' as extension
We were using '.part', but some desktop software interprets that as a
partial download.
2015-10-24 11:45:50 +03:00
djcb 0678d31056 mu: special-case text/calendar parts
Set the name for (otherwise unnamed) mime-parts of type text/calendar to
"vcal-<n>.vcs"; this allows for easier processing with external tools.
2015-10-21 08:06:40 +03:00
djcb 67f74d44b0 cosmetic 2015-10-07 10:34:55 +03:00
djcb a350e2047d Change format for filenames
It seems some tools try to interpret the filename of message files,
even though they shouldn't:
   "Do not try to extract information from unique names."

In particular, they seem to interpret the first part of the name (before
the first dot) as the # of seconds since the Unix epoch (ie.,
time(NULL)). That's not what mu/mu4e put there.

So, let's conform a bit more to the expected filename (as per the
maildir spec), so we're not confusing those tools.
2015-10-02 17:43:38 +03:00
Dirk-Jan C. Binnema 4774429ad6 Merge pull request #668 from ptroja/minor
Minor whitespace and comment fixes
2015-09-26 10:29:11 +03:00
Adam Sampson b44039eda9 Ensure tests have unique names.
glib 2.46 complains if this isn't the case:
(test-mu-str:28790): GLib-ERROR **: duplicate test case path: /mu-str/mu-str-esc-to-list
2015-09-23 12:01:19 +01:00
djcb 518b160025 mu: fix `make distcheck`
We were not including some of the test files in the tarballs; add them.
2015-09-22 12:03:44 +03:00
Piotr Trojanek d35d21a812 Misleading comment removed
Removed a comment which seemed to be copy-pasted from
add_terms_values_str. It did not applied to add_terms_values_msgid.
2015-09-22 09:09:39 +01:00
Piotr Trojanek 804a25d668 minor whitespace fixes 2015-09-22 09:09:39 +01:00
djcb fd557aeac8 mu: add in-reply-to/references to non-body sexp
Add the in-reply-to and references fields to the header-only sexps.
2015-07-05 20:46:11 +03:00
attila a0640a0532 Fix call to c_str() that sometimes dumps core on OpenBSD i386-current
The core dump only seems to occur if mu4e-headers-include-related is
set to t.

Apparently, std::string's c_str() method is confusing to many
people, c.f.
  http://stackoverflow.com/questions/22330250/how-to-return-a-stdstring-c-str

The answer seems to be that the pointer c_str() returns may not be
valid past the current statement; returning it, or even using it
subsequently can have you sending a wild pointer into e.g. g_strdup().

In short, it seems idioms like this are okay:

    return g_strcmp0 (s1.c_str(), s2.c_str()) < 0;

Whereas idioms like this are not:

    const char *msgid (iter->msgid().c_str());

    return msgid ? g_strdup (msgid) : NULL;

At least in my environment by the time we get to g_strdup() the
pointer returned by c_str() is wild and points at garbage.  Since
g_strdup() returns NULL if passed NULL, it seems collapsing it into a
single line is not only possible but necessary.

I've looked at all of the calls to c_str() in mu and it appears to
me this was the one remaining one that was bad.
2015-07-02 15:14:29 -05:00
attila f5a5cde965 Fix core dump in mu-server (at least) for cmd:extract index:0 ... 2015-06-30 16:28:26 -05:00
djcb 7eb244b3b0 mu: don't use __FUNCTION__, use __func__
__FUNCTION__ is deprecated and gives compilation warnings. __func__ is
standardized in c99.
2015-04-22 21:06:31 +03:00
djcb 455582401e date-parsing: don't lowercase date range strings
Allow them to be received unmolested in mu_date_parse_hdwmy
2015-03-22 10:24:14 +02:00
djcb 3c104dfdf4 mu: deactivate unit test for mu_util_dir_expand
The test fails in some cases with interesting directory setups, although
the function does work. So de-activate the test for now, until we come
up with a better one.
2015-03-15 13:26:56 +02:00
djcb 9d8dfcaedd Merge branch 'master' of github.com:djcb/mu 2015-03-06 00:14:59 +02:00
djcb baebd53fb8 Fix a core dump under OpenBSD
Based on a patch by StAlphonsos
2015-03-06 00:12:34 +02:00
djcb d3457ec56c fix compiler warning 2015-02-21 14:18:24 -08:00
Sebastien Le Maguer 2e027c57ed fix for #587 2015-02-20 14:50:11 +01:00
Foivos S. Zakkak 3cfb5b0795 Add FIXME comment for lost "signed" flag 2015-02-16 02:12:16 +02:00
Foivos S. Zakkak edd463186e Fix handling of only signed messages 2015-02-16 01:56:11 +02:00
Foivos S. Zakkak 8456c1c2dc Fix #280
Since `parent` is not really used as a parent, I use it as the last
visited encrypted part while going down the parts-tree.

At the decryption of a part (`mu_msg_crypto_decrypt_part`) I check,
through the GMimeDecryptResult, for signatures (`check_decrypt_result`)
and add them to the part (`tag_with_sig_status`).  Any nested parts hold
that encrypted part as their parent.  Finally at `handle_part`, for each
part I check if it a descendent of an encrypted part.  If so, I proceed
checking for signatures and adding them to the `msgpart`.
2015-02-16 01:19:32 +02:00
djcb c6dd538975 mu-msg-part.c: some cosmetic changes 2014-10-19 11:38:49 +03:00
Foivos S. Zakkak 8f8bc52023 Revert "Do not handle signature parts after verification"
This reverts commit 6e9b9ad2d0.

Unfortunately the reverted commit breaks the Signature field for
encrypted and, at the same time, signed messages.

TODO: details button in the Signatures field does not work for such
cases because the signature is encrypted.

Conflicts:
	lib/mu-msg-part.c
2014-10-19 03:39:32 +03:00
Foivos S. Zakkak 2d843ca887 Add Decryption field
Add a decryption field of the form

Decryption: 2 part(s) decrypted 1 part(s) failed

Meaning that 2 encrypted mime parts where successfully decrypted and 1
part failed.  Note that the number 2 refers to the number of
successfully decrypted mime parts and not the number of successfully
decrypted encryptes multiparts, i.e., if an encrypted multipart
contains 4 parts and decryption is successful the field will be

Decryption: 4 part(s) decrypted

TODO: Add details button listing the names and indexes of the
decrypted (or not) mime-parts
2014-10-19 03:27:58 +03:00
Dirk-Jan C. Binnema ae75060b6a Merge pull request #498 from zakkak/skip_signatures
Do not handle signature parts after verification
2014-10-18 13:16:44 +03:00
Foivos S. Zakkak 6e9b9ad2d0 Do not handle signature parts after verification
Since signatures are not listed as attachments there is no reason to
handle them after the verification.
2014-10-18 12:44:33 +03:00
Foivos S. Zakkak a79cd23cd1 Improve decrypt failure handling
On failure to decrypt, list the encrypted part as an attachment
2014-10-18 12:33:20 +03:00
Foivos S. Zakkak c40522b632 Fix #494. Start indexing from 1 instead of 0 2014-10-17 15:53:32 +03:00
Dirk-Jan C. Binnema ee7eb9c142 Merge pull request #487 from zakkak/master
Fix encrypted multiparts and attachments indexing
2014-10-14 11:46:39 +03:00
Foivos S. Zakkak a6a58b65f1 Remove left over argument from merge 2014-10-13 13:27:47 +03:00
djcb ace922317f threader: try to handle pathless messages 2014-10-13 09:56:39 +03:00
Foivos S. Zakkak 6f50298667 Fix encrypted multiparts and attachments indexing
Pull request #483 does not handle encrypted multiparts properly.  It
used to just verify the signature and not process the parts of the
multipart.  This commit resolves this issue.

Additionally it did not index attachments properly and in the case of a
multipart directly containing more than one multiparts resulted on non
unique indexing of attachments/parts.  This commit resolves this issue
as well.
2014-10-12 22:43:58 +03:00
djcb ac023b74a7 mu-msg-crypto: give better error when gpg is not found
also fixes some other warnings
2014-10-11 14:05:08 +03:00
djcb 99f08c50c4 mu-threader: debugging for some reported problem in find_or_create 2014-10-11 14:04:17 +03:00
Foivos S. Zakkak 51037be7fb Fix #186 Part 3
This patch fixes the attachment extraction (open, save, temp) when using
`mu4e`.  `mu4e` used to not notify the mu-server about the
mu4e-decryption-policy.  As a result mu-server did not decrypt the
attachments for extract, open, or temp.
2014-10-10 18:34:57 +03:00
Foivos S. Zakkak 29e53d2eba Fix gpg decryption (#186)
After a multipart/encrypted part gets decrypted the result is usually a
`multipart/mixed` part (see enigmail).

Before this commit mime multiparts where handled only by
`g_mime_message_foreach`.  As a result the decrypted mime multiparts
where not processed.

This patch handles mime multiparts explicitly by removing the
`g_mime_message_foreach` invocations.  This might come at the cost of
reduced maintainability, in the case of radical gmime changes.  However,
gmime is pretty stable and that scenario is highly unlikely.

TODO: After decryption make any attachments available
2014-10-10 07:48:24 +03:00
djcb ff25bf1a25 Don't use g_clear_pointer yet, it's too new.
Do it the old way.
2014-09-26 15:22:07 +03:00
djcb 3c7061338d Rework getting database version (#469)
It seems we don't get the correct database version in some case with
some compilers, optimization flags. Suspecting some stale ->c_str().
2014-09-23 07:32:39 +03:00
Jakub Sitnicki c9cb27be11 mu: Make mu_container_splice_grandchildren() do only one thing
Don't kill the resultant childless container when promoting its
children. This unifies the behavior of mu_container_splice_*()
functions.
2014-08-15 10:11:21 +02:00
Jakub Sitnicki bb0cc542b8 mu: Prune empty containers from the root set after splicing their children
When the root set contains only one empty container with one child
first promote the child container to the root set and only then
remove the empty parent container so that the root set never goes
empty.

Also make mu_container_splice_children() do only one thing, that is
promote one container's children to be another container's siblings.
The resultant childless container is no longer removed by this
function.

Fixes #460.
2014-08-15 10:10:39 +02:00
Jakub Sitnicki ede481d4c0 mu: Test splicing child containers when there is only one thread
This test reproduces a regression introduced by commit 97101f1f82
("mu: Prune empty container when an only child gets promoted to the
root set").

When the results of a mu-find query contain only a one thread:

$ mu find --threads --fields 'd s' ''
Sat 09 Aug 2014 07:00:00 PM CEST [mu4e] Test Message
  `-> Sat 09 Aug 2014 08:30:00 PM CEST Re: [mu4e] Test Message

... and we narrow down the query in such a way that the root message
gets excluded, then a crash occurs:

$ mu find --threads --fields 'd s' '' date:2014-08-09/20:00..2014-08-09/21:00
**
ERROR:mu-container.c:117:mu_container_append_siblings: assertion failed: (c)
Aborted (core dumped)

Reported-by: Josiah Schwab <jschwab@gmail.com>
2014-08-15 10:10:39 +02:00
Jakub Sitnicki 32f5c8b1f6 mu: Sort containers by comparing their subtree leaders
Traverse the container tree depth first and for each container find
the node in the subtree rooted at this container which comes first in
the descending sort order. Remember it as the subtree leader. Then,
while sorting siblings, compare their subtree leaders instead of the
sibling containers themselves.

IOW, make threads containing the newest message float to the top when
sorting by date in the descending order.

There is no significant performance degradation when sorting a
mailbox with ~16k messages:

$ mu find maildir:/INBOX | wc -l
16503

Current state:

$ perf stat --event=task-clock --repeat=10 -- \
  mu find maildir:/INBOX -n 1 -t > /dev/null

 Performance counter stats for 'mu find maildir:/INBOX -n 1 -t' (10 runs):

       1231.761588      task-clock (msec)         #    0.996 CPUs utilized            ( +-  1.02% )

       1.236209133 seconds time elapsed                                          ( +-  1.08% )

With patch applied:

$ perf stat --event=task-clock --repeat=10 -- \
  mu find maildir:/INBOX -n 1 -t > /dev/null

 Performance counter stats for 'mu find maildir:/INBOX -n 1 -t' (10 runs):

       1459.883316      task-clock (msec)         #    0.998 CPUs utilized            ( +-  0.72% )

       1.462540088 seconds time elapsed                                          ( +-  0.77% )

This implements https://github.com/djcb/mu/issues/164.
2014-07-15 07:25:51 +02:00
Jakub Sitnicki 619fb86885 mu: Update container's pointer to last sibling when converting from a list 2014-07-15 07:25:51 +02:00
Jakub Sitnicki 97101f1f82 mu: Prune empty container when an only child gets promoted to the root set 2014-07-15 07:25:51 +02:00
Jakub Sitnicki f724f4a57d mu: Consider an empty container to be less than anything else
Reasoning being that, arguably, it is the least surprising thing to do.
2014-07-15 07:25:50 +02:00
Jakub Sitnicki dc3be515af mu: Extract function for comparing two containers 2014-07-15 07:25:50 +02:00
Jakub Sitnicki d93b8135a6 Revert "* bugfix for issue 164"
This reverts commit c7b28419ab.

The reverted change fails to sort threads correctly when there is an
empty container, serving as a parent to orphan messages, in the thread
tree as demonstrated by the test in commit f49296759e ("tests:
threads: Test if orphan message promotes its thread").

Also, the reverted commit introduces a performance hit. The time it
takes to sort threads has increased roughly by a factor of 4.

Current state:

$ perf stat --event=task-clock --repeat=10 -- \
  mu find maildir:/INBOX -n 1 -t > /dev/null

 Performance counter stats for 'mu find maildir:/INBOX -n 1 -t' (10 runs):

       4967.692519      task-clock (msec)         #    1.000 CPUs utilized            ( +-  0.14% )

       4.969247128 seconds time elapsed                                          ( +-  0.14% )

With the reverted patch applied:

$ perf stat --event=task-clock --repeat=10 -- \
  mu find maildir:/INBOX -n 1 -t > /dev/null

 Performance counter stats for 'mu find maildir:/INBOX -n 1 -t' (10 runs):

       1231.761588      task-clock (msec)         #    0.996 CPUs utilized            ( +-  1.02% )

       1.236209133 seconds time elapsed                                          ( +-  1.08% )

The benchmark was ran on a maildir with ~16k messages:

$ mu find maildir:/INBOX | wc -l
16503
2014-07-15 07:24:56 +02:00
Jakub Sitnicki 856a651d38 tests: threads: Test if grandchild message promotes only its subthread 2014-07-15 07:24:47 +02:00
Jakub Sitnicki cbfe28b885 tests: threads: Test if grandchild message promotes its thread 2014-07-15 07:24:21 +02:00
Jakub Sitnicki b0357a2d7a tests: threads: Test if child message doesn't promote its thread 2014-07-15 07:23:53 +02:00
Jakub Sitnicki c5d4f7f338 tests: threads: Test if 2nd child message promotes its subthread 2014-07-15 07:22:53 +02:00
Jakub Sitnicki 22927a7dcf tests: threads: Test if 1st child message promotes its thread 2014-07-15 07:22:11 +02:00
David C Sterratt f0510fbf35 Potential fix for issue #433: make check fails on Scientific Linux 6 2014-06-05 14:07:13 +01:00
Alex Bennée 29a16d7ae1 lib/mu-str.c: squash white space ctrl chars to spaces
When processing multiple lines for a subject line separated by TAB
characters we don't want to eliminate the control character totally but
replace it with a simple space. I've left the control handling as before
for non-white space characters.

Signed-off-by: Alex Bennée <alex@bennee.com>
2014-05-06 10:04:26 +01:00
djcb 0c18a0b816 * mu: store date as 0 if it does not exist; this allows searching 2014-03-22 18:51:39 +02:00
omfgroflbbq c7b28419ab * bugfix for issue 164 2014-03-20 16:22:50 +01:00
djcb 3edf950fc2 * mu_str_asciify_in_place: fix test to decide whether to replace 2014-02-15 13:20:17 +02:00
djcb 599d641034 * lib: fix broken unit test 2014-01-15 21:27:18 +02:00
djcb 0277967b53 * mu-store-read: cleanup function a bit
(fruitlessly trying to track down
       https://code.google.com/p/mu0/issues/detail?id=80)
2013-12-21 10:14:31 -08:00
djcb c48d290699 * minor update 2013-12-21 10:01:04 -08:00
djcb 0364433cc1 * minor 2013-12-01 20:21:44 +02:00
djcb c36030a086 * handle message-ids a bit specially, update unit tests 2013-10-13 20:05:29 +03:00
djcb edfdef44a4 index: improve error message when file does not seem to be an email 2013-10-13 19:58:25 +03:00
djcb c898265ee5 * use timegm instead of the tzset hack 2013-10-07 00:50:36 +03:00
djcb cdb1af046f * fix the mu_util_fputs_encoded/bsd heisenbug
it seems g_locale_from_utf8 behaves a bit differently on bsd/macosx,
  causing a segfault (but when run under gdb!). this code path was hit
  for messages with encoding problems in non-utf8 locales
2013-09-07 18:39:00 +03:00
djcb af55f4cf9e * update mu_date_str_to_time_t for macos
at macos this function /seemed/ to massively leak, when looking at the
  valgrind output on macos (but not linux). with this update, this
  leak(?) is gone.
2013-09-07 13:12:28 +03:00
djcb 827dfbecdb * mu-date: small optimization 2013-09-07 12:57:53 +03:00
djcb 13bad9a889 * better error message for some broken queries 2013-09-07 09:43:33 +03:00
djcb c30ffeea72 * small cleanups (macos) 2013-08-25 20:05:57 +03:00
djcb f89447e65c * mu_util_fputs_encoded: updated; perhaps helps with freebsd crash? 2013-08-14 21:59:31 +03:00
djcb 885554757a * mu: some improvement in script handling 2013-07-23 22:23:27 +03:00
djcb b7324d5af6 * cleanup: drop gmime-2.4 support 2013-07-21 14:44:44 +03:00
djcb b17f26537b * mu: unbreak unit test after flag changes (fixes #247) 2013-07-07 10:46:35 +03:00
djcb 312c3a4b20 * cosmetic 2013-07-03 21:56:42 +03:00
djcb 3c3cd31607 * mu-str: fix a leak 2013-07-03 21:56:04 +03:00
djcb 1fcedf742c * mu-mgs-store: support the MU_FLAG_LIST flag 2013-07-03 21:55:41 +03:00
djcb 3eb748737c * mu-msg-file: set the MU_FLAG_LIST flag, if the message looks like an ML-message 2013-07-03 21:55:17 +03:00
djcb 81c3e11c48 * mu-flags: add MU_FLAG_LIST, clean-up code a bit 2013-07-03 21:54:08 +03:00
djcb 7fe37334b5 * cosmetics 2013-06-24 22:44:36 +03:00
djcb 97909566df * mu-contacts, mu-msg-file: better deal with contacts with control chars 2013-06-24 22:42:18 +03:00
djcb 6783e448aa * mu-str: add mu_str_remove_ctrl_in_place 2013-06-24 22:41:34 +03:00
djcb bfe74d1d11 * mu: add the backend for freq information for contacts 2013-06-16 23:02:19 +03:00
djcb 42604fee00 * lib: mu-contacts: store frequency 2013-06-16 13:14:39 +03:00
djcb fa514435ea * merge branch 'master' of github.com:djcb/mu 2013-06-13 23:56:35 +03:00
djcb 13efc74793 * mu-query: better handle empty lhs/rhs in date intervals 2013-06-03 22:29:50 +03:00
djcb 844790a2df * lib: mu date: better handling of date fields in newer xapians 2013-06-01 07:40:15 -07:00
djcb d57b109557 * mu-str: treat '..' in non-range fields differently 2013-06-01 06:07:29 -07:00
djcb e7c63cee47 * update some unit tests 2013-05-30 06:15:22 -07:00
djcb b136ca0411 * try harder to match special strings 2013-05-29 07:33:17 -07:00
djcb e97ec2d51c * fix matching backslashes, add some tests 2013-05-27 05:49:43 -07:00
djcb bdf7ca65c7 * test-mu-maildir: fix regexp 2013-05-27 05:48:19 -07:00
djcb c50c0695e4 * fix CSV quoting (fields with commas) 2013-05-27 04:23:49 -07:00
djcb 3dae623879 * add mu_str_replace 2013-05-26 11:16:02 -07:00
djcb ad6b3d8f0f * add unit test for the optional message file renaming 2013-05-25 19:28:40 +03:00
djcb 7cb3bb9e36 * lib: make renaming messages upon moving them optional 2013-05-25 19:27:54 +03:00
djcb 33e6bf0184 * mu-str: comment-out debug print 2013-05-23 07:47:39 +03:00
djcb 2ae389afe1 * typo 2013-05-22 00:07:01 +03:00
djcb 89bdaafb15 * create a new filename (basename) when copying 2013-05-22 00:06:10 +03:00
djcb 10b64bb654 * cosmetic 2013-05-21 08:05:14 +03:00
djcb e70101f058 * lib: fix compiler warning 2013-05-20 05:15:11 +03:00
djcb 59f855b39b * lib: add mu_str_parse_arglist + unit tests 2013-05-20 05:14:35 +03:00
djcb a2eef4fa41 * handle invalid utf8; fixes #211 (hopefully) 2013-05-15 21:36:27 +03:00
djcb f270847182 * lib: fix body layout 2013-05-15 00:42:33 +03:00
djcb 00d0cb0f28 * the query parser update (few commits back) fixes #210 too, this is unit test for it. 2013-05-15 00:17:36 +03:00
djcb f787f3b9ee * lib: cleanup header fields a bit more; fixes #209 2013-05-15 00:08:38 +03:00