Commit Graph

69 Commits

Author SHA1 Message Date
micah
15f6248299 Merge branch 'DOVECOT_PREREQ-fix' into 'master'
Fixed #29: restore old macro and rename new one

Closes #29

See merge request liberate/trees!16
2023-09-17 14:34:48 +00:00
proplus
bf4d9ee05b Fixed #29: restore old macro and rename new one 2023-09-06 15:35:32 +02:00
micah
14fed7d1ff Merge branch 'install_from_debian_backports_enable_pop3' into 'master'
[trees] - install dovecot from debian backports, enable pop3

Closes #24

See merge request riseuplabs/trees!11
2018-08-10 08:41:18 -07:00
neutron
5caef1ed20
[trees] - install dovecot from debian backports, enable pop3
* adds compatibility for dovecots maildir
  * adds role for installing debian backports
  * installs newer version of dovecot 2.2.* from debian backports
  * in newer versions of dovecot >= 2.2.31 cache index corruption
    is fixed
  * adds note in README.md
  * adds POP3 functionality
2018-08-10 15:17:18 +02:00
micah
72aa259df2 Merge branch 'master' into 'master'
create vagrant testenvironment

Closes #21

See merge request riseuplabs/trees!9
2018-08-08 05:37:57 -07:00
neutron
83a6139730
[trees] - disable synced folder and updated README.md 2018-08-04 11:55:42 +02:00
neutron
211fdbfea6
[trees] - created external reachable mailserver
* mailserver accessable via ssl
  * domain: trees.testing
  * SSL cert needs to be accepted when used with thunderbird
  * changed vbox box name
2018-08-01 23:20:30 +02:00
neutron
03f11441b4
[trees] - added vagrant box for test environment
* creates testsetup with mariadb,postfix,dovecot,trees
   * for further information see vagrant/README.md
   * only works with pwhash_algo 0 yet
   * see limitations in vagrant/README.md
2018-07-13 12:00:11 +02:00
dgoulet
9b0758244c Merge branch 'master' into 'master'
[trees] - changed typo error in function name

See merge request riseuplabs/trees!6
2018-07-12 15:00:46 -07:00
dgoulet
1a5e271a69 Merge branch 'silence-init-messages' into 'master'
pure debug msg - fixes #19

Closes #19

See merge request riseuplabs/trees!5
2018-07-12 15:00:21 -07:00
David Goulet
db7aea1e9b istream: Request the minimal HEADER_SIZE and not MAGIC_SIZE
When looking at the header in an istream source, request from the parent
the HEADER_SIZE which contains the magic value and the version.

Else, it is possible to only have the MAGIC_SIZE and thus failing to
read the version.

This has been observed on Riseup email infrastructure leading to a
Permission denied to open the mbox because of the unknown version:

Error: [trees] Unknown version 0. Supporting 1 to 1

Signed-off-by: David Goulet <dgoulet@riseup.net>
2018-07-12 17:44:01 -04:00
neutron
5b0f2ed18f
[trees] - changed typo error in function name 2018-07-12 14:51:00 +02:00
ng
9e464381f7 pure debug msg - fixes #19 2018-07-06 18:41:29 +02:00
dgoulet
2ac4985298 Merge branch 'master' into 'master'
Fix for #17 build issue with libsodium <= 1.0.14 and password change option for trees-create

See merge request riseuplabs/trees!4
2018-06-11 13:00:21 -07:00
matthias
8a4458cde5 fix example configuration to match all fields 2018-05-19 13:12:33 +02:00
matthias
cc048ab937 add option to change password for locked_secretbox in trees-create 2018-05-19 12:12:30 +02:00
matthias
ed0bbfb274 libsodium <= 1.0.14 patch 2018-05-19 12:09:30 +02:00
David Goulet
e136c32a04 Support dovecot 2.3
Untested but it builds now properly. Thanks to "smorks" for the report!

Fixes #16

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2018-04-10 13:48:01 -04:00
David Goulet
e54c717bd4 Implement trees_secretbox_key
Fetched from the database, if this value is set and valid that is a 64
characters long HEX string decoded to a 32 bytes secret key, we go
directly to the secretbox opening by passing the password hashing.

This is useful for SSO support or/and secret key cache mechanism.

Ref #14

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2018-04-10 13:22:11 -04:00
David Goulet
d91b930a2a Support trees_pwhash_algo database entry
This value is fetched from the database and used to decide with
libsodium pwhash algorithm must be used for the account.

Untested for now but any future commit will fix issues if any.

Fixes #12

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2018-04-10 12:43:40 -04:00
micah
499cf53838 Merge branch 'master' into 'master'
Make `make install` honour `--with-moduledir`

See merge request riseuplabs/trees!3
2018-03-07 03:49:11 -08:00
Linus Nordberg
3e00f6a12d Update installation instructions in README. 2017-07-02 14:07:45 +02:00
Linus Nordberg
9cf5d2f08f Install to $(moduledir). 2017-07-02 14:00:47 +02:00
David Goulet
50feac9298
Update version to v2.1.0
Signed-off-by: David Goulet <dgoulet@riseup.net>
2017-03-17 12:43:49 -04:00
David Goulet
146993d0f4
Fix an overflow validation
The transition from assert() to if() used the wrong comparaison making
the plugin to not work.

Fixes #10

Signed-off-by: David Goulet <dgoulet@riseup.net>
2017-03-17 12:38:43 -04:00
elijah
006059c8a4 Merge branch 'master' into 'master'
unbreak link to scrambler in README.md (caused 404)

See merge request !2
2017-02-18 07:42:24 +00:00
David Goulet
84c0978a3e Update version to v2.0.0
Signed-off-by: David Goulet <dgoulet@riseup.net>
2017-02-17 15:13:52 -05:00
David Goulet
2d77a432a3 Don't use assert() for an overflow check
assert() can be removed so let's not rely on that to detect the possible
overflow.

Signed-off-by: David Goulet <dgoulet@riseup.net>
2017-02-17 14:27:57 -05:00
David Goulet
619b7e463a Use SSIZE_MAX in trees_ostream_send_chunk() check
The overflow check should use SSIZE_MAX since the function returns the
chunk_size of size_t which in theory "could be" bigger but in practice
very unlikely.

Reported-by: Tomasz Miąsko <tomasz.miasko@gmail.com>
Signed-off-by: David Goulet <dgoulet@riseup.net>
2017-02-17 14:24:55 -05:00
David Goulet
5a81de94f2 Handle error code in trees_ostream_send_header()
Properly handle the returned value of o_stream_send() so we make sure
the entire header was sent else error on that.

Reported-by: Tomasz Miąsko <tomasz.miasko@gmail.com>
Signed-off-by: David Goulet <dgoulet@riseup.net>
2017-02-17 14:20:29 -05:00
David Goulet
6838535f3a Handle error code in trees_ostream_send_chunk()
In trees_ostream_send_chunk result of o_stream_send was not checked for
errors, and function always returns chunk_size it was given. Instead,
properly set the errno value from the parent stream and return an error.

Reported-by: Tomasz Miąsko <tomasz.miasko@gmail.com>
Signed-off-by: David Goulet <dgoulet@riseup.net>
2017-02-17 14:20:29 -05:00
David Goulet
e9c4588659 Remove buggy use of trees_password_fd
Tomasz Miąsko reported multiple issues with the trees_read_line_fd using
the trees_password_fd field. It is currently unused which used to be
used by the unit tests and dovadm in the Posteo scrambler plugin.

The issues are:

    In trees_read_line_fd(), this check is bad:

        if (bytes_read > MAXIMAL_PASSWORD_LENGTH)

    Currently it is incorrect because when "bytes_read >
    MAXIMAL_PASSWORD_LENGTH" is true, then buffer capacity is already
    exceeded (or just right if you take into account one byte slack
    allocated in str_new for terminating null). Moreover, the buffer
    will be overrun by one more byte in "pointer[0] = 0;" after leaving
    the loop.

Reported-by: Tomasz Miąsko <tomasz.miasko@gmail.com>
Signed-off-by: David Goulet <dgoulet@riseup.net>
2017-02-17 14:20:29 -05:00
Christian
4acea66ade unbreak link to scrambler in README.md (caused 404) 2017-02-17 13:11:27 +00:00
David Goulet
300f0dbf69 Rename project from tofu-scrambler to trees
Signed-off-by: David Goulet <dgoulet@riseup.net>
2017-02-12 13:19:45 -05:00
David Goulet
cc076fec13 Fix README with compile instruction
Signed-off-by: David Goulet <dgoulet@riseup.net>
2017-02-06 20:15:45 -05:00
David Goulet
41d9edec47 Update README with latest info
Signed-off-by: David Goulet <dgoulet@riseup.net>
2017-02-06 18:57:11 -05:00
David Goulet
02de935b88 Update author and remove uneeded CONTRIBUTORS file
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2017-02-06 18:52:39 -05:00
David Goulet
c3b35b51b7 Massive cleanup of unused files
Those files were useful for the old scrambler version made by Posteo
found here https://github.com/posteo/scrambler-plugin.

Now, the plugin has considerably changed thus all those aren't needed
anymore.

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2017-02-06 18:45:56 -05:00
David Goulet
86087de471 Handle missing switch case found by GCC
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2017-02-06 18:43:09 -05:00
David Goulet
c68e3a9772 Add autoconf support for a proper build system
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2017-02-06 18:40:31 -05:00
David Goulet
754ac580a7 Validate the version from the header
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2017-01-25 11:58:55 -05:00
David Goulet
b89c16a077 Actually write the version in the email header
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2017-01-23 19:57:02 -05:00
David Goulet
b4b348a430 Add version capability
This version is extracted from the user data and put in the email header
but currently not used at all.

Future version will probably use it in order to do different actions
based on that value.

Currently version should be a 1.

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2017-01-20 14:40:00 -05:00
micah
f7fb97a364 Merge branch 'feature/tofu-create' into 'master'
added tofu-create script, for testing purposes

See merge request !1
2016-12-19 15:47:39 +00:00
elijah
15a583c0aa fix typos in README.md 2016-12-15 10:35:39 -08:00
elijah
17d04e75f4 updated README.md 2016-12-15 10:20:43 -08:00
David Goulet
95302087ee Don't check private key if detecting header
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2016-12-10 11:37:41 -05:00
David Goulet
7ae2ab49ba Pass a NULL pointer if no private key set
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2016-12-08 19:50:56 -05:00
David Goulet
47eded2b2b Extra protection on the private key when decrypting
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2016-12-08 19:33:41 -05:00
David Goulet
1acf27e3dc Don't fail if private key not found. Also, set errno on decrypt error
Signed-off-by: David Goulet <dgoulet@ev0ke.net>
2016-12-08 19:25:10 -05:00