Implement initial support for shared mailboxes.#1643
Implement initial support for shared mailboxes.#1643matejak wants to merge 3 commits intodocker-mailserver:masterfrom
Conversation
|
Great work. I'm looking forward to merging this when it's done! PS: Be aware that there are two tests in particular which will fail for no apparent reason. This is PPS: Please also note this feature in the features list in the |
|
Great feature addition! I just jumped in to see if I could work this addition as well.. |
a9cfb66 to
6abc768
Compare
|
The first version of this PR was broken, but it should work now. |
6abc768 to
f1ad39a
Compare
|
@matejak Not sure why, but the build / test is somehow completely broken!? :D |
f1ad39a to
c96c20a
Compare
|
Local build worked for me, but I think that those checks require config files to be valid even before |
c96c20a to
2938300
Compare
2938300 to
7b06eba
Compare
|
What's the current status on this PR? Checks are failing. |
|
Could you help me to pinpoint what's wrong? I am pretty sure that it is possible to build the image defined by the PR and to run it, and I was unable to spot what went wrong in my last modification. |
|
I think I can. Could you provide a dummy commit (please change the README line where is says This test ( |
|
@casperklein you think all is good here? @erik-wramner ? I think this looks fine. |
|
Alright, this PR looks fine. If we receive a review from @erik-wramner this can be merged into latest and will effectively be on stable in ~2 weeks. |
|
It just occured to me (because of the label I set). I cannot see any tests. But I think this feature could be tested. I'm sorry to bother you again @matejak, but could you provide some? PS: The conflct is due to a commit I put on master and can easily be resolved by just using the current |
I would love to, but I will need some help from you how to get started. Is there some kind of documentation on how to write tests, and is there a "closest test" that could be used as a starting point? |
|
I've not yet written any tests myself, just altered them. But I guess I can provide you with a starting point:
tests:
./test/bats/bin/bats test/*.bats
load 'test_helper/common'
function setup() {
run_setup_file_if_necessary
}
function teardown() {
run_teardown_file_if_necessary
}
function setup_file() {
local PRIVATE_CONFIG
PRIVATE_CONFIG="$(duplicate_config_for_container .)"
docker run -d --name mail_pop3 \
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
-e ENABLE_POP3=1 \
-e DMS_DEBUG=0 \
-h mail.my-domain.com -t "${NAME}"
wait_for_finished_setup_in_container mail_pop3
}
function teardown_file() {
docker rm -f mail_pop3
}
@test "first" {
skip 'this test must come first to reliably identify when to run setup_file'
}
#
# pop
#
@test "checking pop: server is ready" {
run docker exec mail_pop3 /bin/bash -c "nc -w 1 0.0.0.0 110 | grep '+OK'"
assert_success
}
...
@test "last" {
skip 'this test is only there to reliably mark the end for the teardown_file'
}where you can start a Container if you need one, remove it afterwards. The first and last test are markers, you could just copy-paste them if you like.
I will mention @martin-schulze-vireso here so he can read this as well. He might provide you with more information if I missed something:) I think it's best if you just have a look at some test files in the beginning. As they are named in relation to what they are testing, you will most likely find one closely related to this topic. I would have to guess, but I'd start with There is this "special case" with PS EDIT: I have also removed the version 7.2 label and favor of the 7.3 as we have no hurry. |
I have nothing to add here. :)
I did not really call dibs on that one. However, I concur that we should strive to get it smaller, so if there is no need to add to this file we should avoid it. |
|
What's the status on this PR? |
|
I approved it, but it seems to be waiting for tests? |
It is - I'm waiting on the authors response :) |
|
Please bear with me, I am still interested, and I put high hopes into the X-mas break :-) |
|
Closed due to migration to docker-mailserver/docker-mailserver. Please re-open over there :D |
|
@matejak Since the old repository was merged, this could be re-opened. But there would be merge conflicts. Could you re-implement your changes from the current state of Do we see a new PR from you? :) |
|
I would love to see this issue re-activated. |
It's a PR, not an issue 😉 There have been too many changes since this was closed I'm afraid. I'd like to see the changes from this PR being applied to the current PS: There are already many many changes for the next major release (v12.0.0), so this may not be going into v12.0.0 (for which we already have a rough time frame too). We're currently waiting on reviews and we still need to refactor some tests, then we can release v12. So, unless the work for this is done this week and a new PR ready to be reviewed, the changes will go into v12.1.0 or later. |
|
A feature request was raised, a contributor is interested in reviving this PR 👍 |
This PR aims to evolve into a mergeable implementation of support needed to run docker-mailserver with shared inboxes. See #1625 This PR is a draft, so if you decide to give feedback, go for the big picture - a more thorough feedback will become appropriate as the PR gets polished and tested.
The PR uses following means to implement the functionality:
The
10-mail.confhas been split in two - the original10-mail.confand11-shared.conf. The new file contains configuration that has been commented out in the former file. Contents of the file are commented in a specific way that allows for fully automated uncomment in case of automated setup, or for noop in case that the file is persistent and you have edited it manually.New env variables have been added:
DOVECOT_NAMESPACE_SEPARATOR- historically, this has not been defined, but you need to define it to use shared inboxes. Slash seems to be a good separator.DOVECOT_ENABLE_INBOX_SHARING- leave blank or set to 0 to disable, anything else means enable.If those are left untouched, the newly implemented functionality doesn't change the setup in any way, i.e. the change is backwards-compatible.
The startup script substitutes the value of the namespace separator into both new config files, and it uncomments sections of the sharing-related config file if this functionality is requested.
A script that facilitates inbox sharing has been introduced -
share_inbox.shSteps that the user is supposed to take:
Define sharing dictionaries - that could be maybe outsourced to a variable as well, but I don't have the expertise to propose this ATM. It is enough to have this snippet in
dovecot.cf:Share inboxes by executing the script in the container (or calling the container's
doveadmdirectly), e.g.Make the sharing config file persistent, and customize it (optional).
Anyway, if you configure the inbox that can access shared inboxes with Thunderbird, you will be able to subscribe to inboxes that are shared to you.