Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
80969e4
Loglevel Debug is sufficient as it gets retried (#337)
jrse Jul 6, 2022
690127d
Bugfix/339 rados config timeout (#340)
jrse Aug 25, 2022
dde2fb3
Feature/342 object search (#343)
jrse Sep 22, 2022
30798cd
Bugfix/342 logging multithreading (#344)
jrse Sep 27, 2022
a58c735
Bugfix/rbox copy context (#347)
jrse Oct 20, 2022
09311f7
Merge branch 'master' into develop
jrse Oct 20, 2022
574fa4a
#364 and code cleanup
jrse Oct 27, 2022
1ef3f70
Merge branch 'master' into develop
jrse Oct 27, 2022
364e18d
Feature/349 ceph object index (#350)
jrse Nov 21, 2022
f0741a6
#349 bugfix return code doveadm rmb (#351)
jrse Nov 22, 2022
eb41db1
Merge branch 'master' into develop
jrse Nov 22, 2022
4efa9f1
#349 validate object (#353)
jrse Nov 26, 2022
8eac746
Merge branch 'master' into develop
jrse Nov 26, 2022
d2366a2
Bugfix/355 fix gzip trailer for empty stream (#357)
jrse Dec 5, 2022
8aa1297
Merge branch 'master' into develop
jrse Dec 5, 2022
3be0cff
#349 fix threshold calc for ceph index file
jrse Dec 5, 2022
0cbb2c0
#355 fix buffersize for write method 1 and 2 (#360)
jrse Dec 5, 2022
c05d89e
Merge branch 'master' into develop
jrse Dec 5, 2022
e6e6685
Bugfix 355 fix buffersize write method (#363)
jrse Dec 16, 2022
6c47fd8
fix centos build
jrse Dec 19, 2022
ac6c9ec
TS-17 remvoed gzip tests
Sara681820 Dec 19, 2022
9dd67d9
changes in save_mail method now it is implemented in RadosStorage and…
Sara681820 Dec 24, 2022
3f4b4a1
save_mail RadosStorage
Sara681820 Dec 24, 2022
d7fb495
Read mail is changed in RadosStorage
Sara681820 Jan 1, 2023
18282e6
read_mail retry in RadosStorage
Sara681820 Jan 5, 2023
48ee523
save_mail has been tested and works now.
Sara681820 Jan 10, 2023
98c2520
RadosStorage independent from librados:1-get_recovery_io_ctx() has be…
Sara681820 Jan 10, 2023
44694ab
fix Fatal signal 11 crash
jrse Jan 10, 2023
73f759b
it_test_librmb has been fixed.Most likely read and save mail from Rad…
Sara681820 Jan 13, 2023
68c84be
gitlab-ci
jrse Jan 11, 2023
072a713
gitlab-ci
jrse Jan 11, 2023
e910923
fix gitlab
jrse Jan 11, 2023
1b51308
fix gitlab
jrse Jan 11, 2023
69522f8
fix gitlab
jrse Jan 11, 2023
49762c1
fix gitlab
jrse Jan 11, 2023
e532405
fix gitlab
jrse Jan 11, 2023
b00880f
fix gitlab
jrse Jan 11, 2023
2eb96ba
fix gitlab
jrse Jan 11, 2023
b1260e7
fix gitlab
jrse Jan 11, 2023
8e2dcbf
fix mock rbox bugs test
Jan 13, 2023
682c000
fix test_repair_rbox
Jan 13, 2023
87cef35
Makefile is changed to remove failed tests
Sara681820 Jan 19, 2023
fca081d
storage-mock-rbox : save and read test.
Sara681820 Jan 19, 2023
3bc2758
TS-17 unit test
jrse Jan 19, 2023
b2364dd
get_Io_Ctx is still null but there are some samples of mock tests.
Sara681820 Jan 22, 2023
72c3234
there is an error with last unit test related to read_mail
Sara681820 Jan 26, 2023
58e9402
Merge branch 'feature/TS-17-api' of github.com:jrse/dovecot-ceph-plug…
Sara681820 Jan 26, 2023
37c43cb
the save and read methods have been written and tested by some mock_u…
Sara681820 Feb 15, 2023
1764f89
io_ctx_sample is replaced
Sara681820 Feb 16, 2023
b0cb709
fix
jrse Feb 17, 2023
57c9ac5
save and read methods pass all test by direct use Io_Ctx
Sara681820 Feb 17, 2023
5bafbdd
Merge branch 'feature/TS-25-26-save-read' of http://gitlab.fritz.box/…
Sara681820 Feb 17, 2023
3afe5d9
smtp, imap, test_storage_mock_rbox, it_test_storage,it_test_read_mail…
Sara681820 Feb 21, 2023
1e69af0
smpt: pass imap:pass after 150s it_test_librabm,it_test_storage,it_te…
Sara681820 Feb 21, 2023
41cc399
the merge issues have been resolved,hopefully.
Sara681820 Feb 22, 2023
d1ae690
Update .travis.yml
Sara681820 Feb 23, 2023
73563b3
Update .gitlab-ci.yml
Sara681820 Feb 23, 2023
56a5667
Merge branch 'feature/TS-25-26-save-read' into 'master'
jrse Mar 6, 2023
5124306
RadosStorage API is now independent from librados objects. It is also…
Sara681820 Mar 7, 2023
99ae67a
Merge branch 'TS-28-RadosStorage' into 'master'
jrse Mar 7, 2023
0c3e7d2
RadosCluster and RadosDictionary
Sara681820 Mar 8, 2023
6749714
RadosCluster and RadosDictionary are now totally independent of libra…
Sara681820 Mar 8, 2023
5ee3b7e
RadosStorageMetadataModule is now totally independent from librados o…
Sara681820 Mar 9, 2023
7c93dd2
RadosDovecotCephConfig API now is independent from IoCtx and librados…
Sara681820 Mar 13, 2023
625de83
RadosMail is Clean
Sara681820 Mar 13, 2023
a4f52db
Merge branch 'TS-32' into 'master'
jrse Mar 13, 2023
5de6737
Merge branch 'TS-29' into 'master'
jrse Mar 13, 2023
ddf4153
Merge branch 'master' into 'TS-33'
Sara681820 Mar 13, 2023
0fe0153
Merge branch 'TS-31' into 'master'
jrse Mar 14, 2023
e49b2c0
Merge branch 'TS-33' into 'master'
jrse Mar 14, 2023
67ae5ee
It is not final version,In this branch librados::bufferlist has been …
Sara681820 Mar 29, 2023
b65b43a
DRAFT
Sara681820 Mar 30, 2023
10838e3
replace bufferlist with void*
jrse Mar 30, 2023
ee3abf5
void*
jrse Mar 30, 2023
edd2aa0
The RadosMail.mail_buffer which was a librados::bufferlist has been r…
Sara681820 Apr 2, 2023
3d3efba
Mentioned issues have been fixed.
Sara681820 Apr 3, 2023
c7b3735
Formating has been done.
Sara681820 Apr 3, 2023
d1c480e
It is not final version,In this branch librados::bufferlist has been …
jrse Apr 4, 2023
2e3a998
Merge branch 'TS-36' into 'master'
jrse Apr 4, 2023
fd5a36a
Merge branch 'master' of http://gitlab.fritz.box/dovecot/dovecot-ceph…
Sara681820 Apr 4, 2023
7e3fbe5
StorageBackendFactory: there is a new file on rbox package.
Sara681820 Apr 4, 2023
4300ad6
Singletone designe to get sure,there is only one instance.
Sara681820 Apr 4, 2023
c460d0d
Merge branch 'JAR-18' into 'master'
jrse Apr 4, 2023
14728a8
storage-interface has benn done.
Sara681820 Apr 6, 2023
83ca4b2
RadosMail interface has been extracted from previous implimentation. …
Sara681820 Apr 9, 2023
3ac34bc
RadosCephConfig interface has been extracted and added to interface p…
Sara681820 Apr 11, 2023
b302b34
RadosMetadata interface has been exteracted from previous version in …
Sara681820 Apr 13, 2023
8c87b7e
rmb-commands.h, rados-mail-box.h, mailbox_tools.h, ls_cmd_parser.h in…
Sara681820 Apr 20, 2023
36a7d36
rados-types.h file from librmb has been moved to storage_interface pa…
Sara681820 Apr 20, 2023
c85ff7d
Merge branch 'JAR-19' into 'master'
jrse Apr 28, 2023
ea5864c
there is a problem within set_metadata in rados_metadata_storage_defa…
Sara681820 Jun 2, 2023
e546406
Merge branch 'it_test_librmb' into 'master'
jrse Jun 2, 2023
6915ae2
there is a problem within set_metadata in rados_metadata_storage_defa…
Sara681820 Jun 5, 2023
ebe122a
Merge branch 'testing' into 'master'
jrse Jun 5, 2023
d0c15de
some added comment which are not used enymore have been deleted also …
jrse Oct 5, 2023
58d1b28
Merge branch 'JAR-116' into 'master'
jrse Oct 5, 2023
432e027
Feature/pipeline and local dev
jrse Oct 14, 2023
fa4a8c6
Merge branch 'feature/pipeline-and-local-dev' into 'master'
jrse Oct 14, 2023
f601387
Feature/cpp logging
jrse Oct 29, 2023
bb4f537
Merge branch 'feature/cpp_logging' into 'master'
jrse Oct 29, 2023
f4e8a47
cloude context
jrse Jul 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 110 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
image: 192.168.178.73:6088/ceph-dovecot-combined:fe6a06c8907bd7635018205c7eae05dc4c363575

services:
- docker:19.03.13-dind

variables:
DOCKER_REGISTRY_URL: "192.168.178.73:6088"
LC_ALL: "en_US.UTF-8"
LANG: "en_US.UTF-8"
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
PROJECT_NAME: dovecot-ceph-plugin
GIT_SUBMODULE_STRATEGY: recursive
ROOT_PATH: "apps/develop/apps/"

stages:
- build
- docker
- publish

build:
stage: build
tags: ["kubernetes"]
artifacts:
paths:
- imaptest.log
- dovecot.log
script:
- /opt/ceph-container/bin/entrypoint.sh demo &
- ./autogen.sh
- ./configure --with-dovecot=/usr/local/lib/dovecot --enable-maintainer-mode --enable-debug --with-integration-tests --enable-valgrind --enable-debug
- make clean install
- ps -aux
- ceph df
- ./setup.sh
- dovecot
- ldconfig
- smtp-source -v -L -s 1 -m 1 -c -F /root/lmtp_test_mail.tld -f [email protected] -t t1 inet:127.0.0.1:1024
- imaptest user=t%d pass=t port=10143 users=10 clients=10 error_quit secs=30 output=./imaptest.log
- doveadm -Dv backup -u t1 -m INBOX mdbox:/usr/local/var/mail/mdbox/t1
- doveadm -D fetch -u t1 "guid date.received date.sent flags pop3.uidl seq size.virtual uid user mailbox-guid mailbox" ALL > /root/rbox.t1.mails
- doveadm -D -c /usr/local/etc/dovecot_mdbox/dovecot.conf fetch -u t1 "guid date.received date.sent flags pop3.uidl seq size.virtual uid user mailbox-guid mailbox" ALL > /root/mdbox.t1.mails


- src/scripts/sort.sh /root/rbox.t1.mails /root/rbox.t1.mails.sorted
- src/scripts/sort.sh /root/mdbox.t1.mails /root/mdbox.t1.mails.sorted
- type diff
- diff -y -W 1500 /root/rbox.t1.mails.sorted /root/mdbox.t1.mails.sorted
- echo $?

- rm -rf /usr/local/var/mail/rbox/t1
- doveadm -Dv -c /usr/local/etc/dovecot_mdbox/dovecot.conf backup -u t1 -m INBOX rbox:/usr/local/var/mail/rbox/t1
- doveadm -D fetch -u t1 "guid date.received date.sent flags pop3.uidl seq size.virtual uid user mailbox-guid mailbox" ALL > /root/rbox.t1.mails
- src/scripts/sort.sh /root/rbox.t1.mails /root/rbox.t1.mails.sorted
- diff -y -W 1500 /root/rbox.t1.mails.sorted /root/mdbox.t1.mails.sorted
- echo $?
- rm -rf /usr/local/var/mail/rbox
- imaptest user=t%d pass=t port=10143 error_quit secs=15 copybox=INBOX.Drafts output=./imaptest.log
- doveadm -D force-resync -u t1 INBOX

# - git grep -c "Error" -- ./dovecot.log
# - git grep -c "failed" -- ./dovecot.log
# - git grep -c "Internal error" -- ./dovecot.log
# - git grep -c "killed" -- ./dovecot.log
# - git grep -c "Panic" -- ./dovecot.log
# - git grep -c "Fatal" -- ./dovecot.log
# - git grep -c "BUG" -- ./dovecot.log
# - ceph df
# - make check
build_image:
tags:
- kubernetes
stage: docker
image:
name: gcr.io/kaniko-project/executor:v1.14.0-debug
entrypoint: [""]
before_script:
- |
echo "$NEXUS_IMAGE_REGISTRY_SSH_KEY" >> /kaniko/ssl/certs/ca-certificates.crt
script:
- /kaniko/executor
--context "$CI_PROJECT_DIR"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile"
--destination "$DOCKER_REGISTRY_URL/$PROJECT_NAME:$CI_COMMIT_SHA"
--skip-tls-verify

publish_to_master:
dependencies:
- build_image
stage: publish
tags:
- shell
before_script:
- mkdir dev_temp
- cd dev_temp
- git clone http://${CI_USERNAME}:${CI_PUSH_TOKEN}@${CI_SERVER_HOST}/devops/dev.git
- git config --global user.email "[email protected]"
- git config --global user.name "GitLab CI/CD"
script:
- cd dev
- git checkout develop
- git stash
- cd $ROOT_PATH
- cd $PROJECT_NAME
- export image2="yq e -i '.spec.template.spec.containers[0].image = \""$DOCKER_REGISTRY_URL/$PROJECT_NAME:$CI_COMMIT_SHA\""' deployment.yaml"
- eval "$image2"
- git commit -am 'kubernetes-deployment.yaml has been updated with new image'
- git push origin develop
- cd ../../../../../..
- rm -r dev_temp
58 changes: 29 additions & 29 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,43 +23,43 @@ script:
- docker exec ceph_demo sh -c 'cp -r /etc/ceph/* /root/cfg'
- docker exec build sh -c 'chmod 777 /etc/ceph/*'
- docker exec ceph_demo sh -c 'ceph tell mon.\* injectargs "--mon-allow-pool-delete=true"'
- travis_wait 30 docker exec build sh -c 'cd repo/src/tests; make check-valgrind'
- docker exec build sh -c 'cd repo; cat src/tests/test-suite-memcheck.log'
#- travis_wait 30 docker exec build sh -c 'cd repo/src/tests; make check-valgrind'
#- docker exec build sh -c 'cd repo; cat src/tests/test-suite-memcheck.log'
#- travis_wait 30 docker exec build sh -c 'cd repo/src/tests; make check'
- docker exec build sh -c 'ldconfig'
- docker exec build sh -c 'chmod -R 777 /usr/local/var/'
- docker exec --detach build sh -c 'service dovecot.service start'
- docker exec build sh -c 'cd /usr/local/bin; ./imaptest user=t%d pass=t port=10143 users=100 clients=25 error_quit secs=15 output=/var/log/imaptest.log'
- docker exec build sh -c 'smtp-source -v -L -s 1 -m 1 -c -F /root/lmtp_test_mail.tld -f [email protected] -t t1 inet:127.0.0.1:1024'
- docker exec build sh -c 'doveadm -D altmove -u t2 ALL'
- docker exec build sh -c 'doveadm -D altmove -r -u t2 ALL'
#- docker exec build sh -c 'cd /usr/local/bin; ./imaptest user=t%d pass=t port=10143 users=100 clients=25 error_quit secs=15 output=/var/log/imaptest.log'
#- docker exec build sh -c 'smtp-source -v -L -s 1 -m 1 -c -F /root/lmtp_test_mail.tld -f [email protected] -t t1 inet:127.0.0.1:1024'
#- docker exec build sh -c 'doveadm -D altmove -u t2 ALL'
#- docker exec build sh -c 'doveadm -D altmove -r -u t2 ALL'

- docker exec build sh -c 'doveadm -Dv backup -u t1 -m INBOX mdbox:/usr/local/var/mail/mdbox/t1'
- docker exec build sh -c 'doveadm -D fetch -u t1 "guid date.received date.sent flags pop3.uidl seq size.virtual uid user mailbox-guid mailbox" ALL > /root/rbox.t1.mails'
- docker exec build sh -c 'doveadm -D -c /usr/local/etc/dovecot_mdbox/dovecot.conf fetch -u t1 "guid date.received date.sent flags pop3.uidl seq size.virtual uid user mailbox-guid mailbox" ALL > /root/mdbox.t1.mails'
- docker exec build sh -c 'cd repo/src/scripts; ./sort.sh /root/rbox.t1.mails /root/rbox.t1.mails.sorted'
- docker exec build sh -c 'cd repo/src/scripts; ./sort.sh /root/mdbox.t1.mails /root/mdbox.t1.mails.sorted'
#- docker exec build sh -c 'doveadm -Dv backup -u t1 -m INBOX mdbox:/usr/local/var/mail/mdbox/t1'
#- docker exec build sh -c 'doveadm -D fetch -u t1 "guid date.received date.sent flags pop3.uidl seq size.virtual uid user mailbox-guid mailbox" ALL > /root/rbox.t1.mails'
#- docker exec build sh -c 'doveadm -D -c /usr/local/etc/dovecot_mdbox/dovecot.conf fetch -u t1 "guid date.received date.sent flags pop3.uidl seq size.virtual uid user mailbox-guid mailbox" ALL > /root/mdbox.t1.mails'
#- docker exec build sh -c 'cd repo/src/scripts; ./sort.sh /root/rbox.t1.mails /root/rbox.t1.mails.sorted'
#- docker exec build sh -c 'cd repo/src/scripts; ./sort.sh /root/mdbox.t1.mails /root/mdbox.t1.mails.sorted'

- docker exec build sh -c 'diff -y -W 1500 /root/rbox.t1.mails.sorted /root/mdbox.t1.mails.sorted'
- docker exec build sh -c 'rm -r /usr/local/var/mail/rbox/t1'
- docker exec build sh -c 'doveadm -Dv -c /usr/local/etc/dovecot_mdbox/dovecot.conf backup -u t1 -m INBOX rbox:/usr/local/var/mail/rbox/t1'
- docker exec build sh -c 'doveadm -D fetch -u t1 "guid date.received date.sent flags pop3.uidl seq size.virtual uid user mailbox-guid mailbox" ALL > /root/rbox.t1.mails'
- docker exec build sh -c 'cd repo/src/scripts; ./sort.sh /root/rbox.t1.mails /root/rbox.t1.mails.sorted'
- docker exec build sh -c 'diff -y -W 1500 /root/rbox.t1.mails.sorted /root/mdbox.t1.mails.sorted'
#- docker exec build sh -c 'diff -y -W 1500 /root/rbox.t1.mails.sorted /root/mdbox.t1.mails.sorted'
#- docker exec build sh -c 'rm -r /usr/local/var/mail/rbox/t1'
#- docker exec build sh -c 'doveadm -Dv -c /usr/local/etc/dovecot_mdbox/dovecot.conf backup -u t1 -m INBOX rbox:/usr/local/var/mail/rbox/t1'
#- docker exec build sh -c 'doveadm -D fetch -u t1 "guid date.received date.sent flags pop3.uidl seq size.virtual uid user mailbox-guid mailbox" ALL > /root/rbox.t1.mails'
#- docker exec build sh -c 'cd repo/src/scripts; ./sort.sh /root/rbox.t1.mails /root/rbox.t1.mails.sorted'
#- docker exec build sh -c 'diff -y -W 1500 /root/rbox.t1.mails.sorted /root/mdbox.t1.mails.sorted'

- docker exec build sh -c 'rm -r /usr/local/var/mail/rbox'
- docker exec build sh -c 'cd /usr/local/bin; ./imaptest user=t%d pass=t port=10110 profile=/root/pop3-profile.conf users=100 clients=10 error_quit secs=15 output=/var/log/imaptest.log'
#- docker exec build sh -c 'rm -r /usr/local/var/mail/rbox'
#- docker exec build sh -c 'cd /usr/local/bin; ./imaptest user=t%d pass=t port=10110 profile=/root/pop3-profile.conf users=100 clients=10 error_quit secs=15 output=/var/log/imaptest.log'

- docker exec build sh -c 'rm -r /usr/local/var/mail/rbox'
- docker exec build sh -c 'cd /usr/local/bin; ./imaptest user=t%d pass=t port=10143 error_quit secs=15 copybox=INBOX.Drafts output=/var/log/imaptest.log'
- docker exec build sh -c 'doveadm -D force-resync -u t1 INBOX'
- docker exec build bash -c '/usr/local/bin/exec.sh "cat /var/log/dovecot.log | grep \"Error:\""'
- docker exec build bash -c '/usr/local/bin/exec.sh "cat /var/log/dovecot.log | grep \"failed:\""'
- docker exec build bash -c '/usr/local/bin/exec.sh "cat /var/log/dovecot.log | grep \"Internal error\""'
- docker exec build bash -c '/usr/local/bin/exec.sh "cat /var/log/dovecot.log | grep \"killed\""'
- docker exec build bash -c '/usr/local/bin/exec.sh "cat /var/log/dovecot.log | grep \"Panic:\""'
- docker exec build bash -c '/usr/local/bin/exec.sh "cat /var/log/dovecot.log | grep \"Fatal:\""'
- docker exec build bash -c '/usr/local/bin/exec.sh "cat /var/log/imaptest.log | grep \"BUG:\""'
#- docker exec build sh -c 'rm -r /usr/local/var/mail/rbox'
# #- docker exec build sh -c 'cd /usr/local/bin; ./imaptest user=t%d pass=t port=10143 error_quit secs=15 copybox=INBOX.Drafts output=/var/log/imaptest.log'
# - docker exec build sh -c 'doveadm -D force-resync -u t1 INBOX'
# - docker exec build bash -c '/usr/local/bin/exec.sh "cat /var/log/dovecot.log | grep \"Error:\""'
# - docker exec build bash -c '/usr/local/bin/exec.sh "cat /var/log/dovecot.log | grep \"failed:\""'
# - docker exec build bash -c '/usr/local/bin/exec.sh "cat /var/log/dovecot.log | grep \"Internal error\""'
# - docker exec build bash -c '/usr/local/bin/exec.sh "cat /var/log/dovecot.log | grep \"killed\""'
# - docker exec build bash -c '/usr/local/bin/exec.sh "cat /var/log/dovecot.log | grep \"Panic:\""'
# - docker exec build bash -c '/usr/local/bin/exec.sh "cat /var/log/dovecot.log | grep \"Fatal:\""'
# - docker exec build bash -c '/usr/local/bin/exec.sh "cat /var/log/imaptest.log | grep \"BUG:\""'

after_script:
- docker stop build ceph_demo
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Change Log
## [0.0.47](https://github.com/ceph-dovecot/dovecot-ceph-plugin/tree/0.0.47) (2022-12-05)
- #355 fix gzip trailer when stream is empty
fix save_method 1+2 buffersize (1 byte short)
bugfix-355-fix-buffersize-write-method


## [0.0.46](https://github.com/ceph-dovecot/dovecot-ceph-plugin/tree/0.0.45) (2022-11-22)
- #349 bugfix doveadm rmb create ceph index validate object metadata

## [0.0.45](https://github.com/ceph-dovecot/dovecot-ceph-plugin/tree/0.0.45) (2022-11-22)
Expand Down
141 changes: 141 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Project Overview

This is a Dovecot plugin that enables email storage in Ceph RADOS objects. It provides two main plugins:
- **RADOS Storage Plugin (rbox)**: Stores emails as RADOS objects while keeping metadata in filesystem/CephFS
- **RADOS Dictionary Plugin**: Stores Dovecot dictionaries in Ceph OMAP key/value store

The project uses a hybrid storage model where emails are immutable RADOS objects and index/cache data remains in the filesystem for performance.

## Build System

The project uses GNU Autotools (autoconf/automake) for configuration and building:

### Build Commands
```bash
# Generate build system
./autogen.sh

# Configure build (standard installation)
./configure

# Configure with custom dovecot location
./configure --with-dovecot=/path/to/dovecot

# Configure with custom prefix
./configure --prefix=/usr/local

# Build
make

# Install
make install
```

### Build Options
- `--with-dict=yes/no`: Build RADOS dictionary plugin (default: yes)
- `--with-storage=yes/no`: Build RADOS storage plugin (default: yes)
- `--with-tests=yes/no`: Build tests (default: yes)
- `--with-integration-tests=yes/no`: Build integration tests (default: no)

## Dependencies

Required packages:
- `libjansson-devel` (>= 2.9)
- `librados2-devel` (>= 10.2.5)
- `dovecot-devel`
- `spdlog` (optional, for logging)

## Testing

### Unit Tests
```bash
# Run individual test executables from src/tests/
./src/tests/storage-rbox/it_test_storage_rbox
./src/tests/storage-rbox/it_test_read_mail_rbox
./src/tests/librmb/it_test_librmb
```

### Integration Tests
Enable with `--with-integration-tests=yes` during configure.

### Docker Development Environment
```bash
cd docker
docker-compose up
# Access container: docker exec -it dovecot-dev bash
```

## Code Architecture

### Core Components

#### librmb (src/librmb/)
Core library providing RADOS abstractions:
- `rados-cluster-impl`: Ceph cluster connection management
- `rados-storage-impl`: RADOS storage operations
- `rados-mail-impl`: Mail object handling
- `rados-dictionary-impl`: Dictionary operations
- `rados-metadata-*`: Metadata storage implementations

#### Storage Plugin (src/storage-rbox/)
Dovecot storage plugin implementation:
- `rbox-storage.cpp`: Main storage backend
- `rbox-mail.cpp`: Mail object interface
- `rbox-save.cpp`: Mail saving logic
- `rbox-sync.cpp`: Mailbox synchronization
- `rbox-copy.cpp`: Mail copying operations

#### Dictionary Plugin (src/dict-rados/)
Dovecot dictionary plugin for OMAP storage:
- `dict-rados.cpp`: Dictionary implementation
- `libdict-rados-plugin.c`: Plugin interface

#### Tools (src/librmb/tools/rmb/)
Command-line tools for managing RADOS mailboxes:
- `rmb.cpp`: Main RMB tool
- `rmb-commands-impl.cpp`: Command implementations

### Key Interfaces

The code implements Dovecot's plugin interfaces:
- `mail_storage_vfuncs`: Storage operations
- `mail_vfuncs`: Mail object operations
- `dict_vfuncs`: Dictionary operations

### Configuration

Configuration is handled through:
- Dovecot configuration files
- Ceph configuration files (`ceph.conf`)
- JSON configuration for advanced settings

## Development Guidelines

### Code Style
- C++11 standard
- Line length: 120 characters (see CPPLINT.cfg)
- Use existing code patterns and conventions
- Headers are organized by component

### Testing Strategy
- Unit tests for individual components
- Integration tests for end-to-end functionality
- Manual testing with IMAP clients (Thunderbird, telnet)
- Performance testing with imaptest

### Memory Management
- RAII patterns for resource management
- Proper cleanup of Ceph contexts
- Buffer management for large mail objects

## Important Notes

- This is experimental code, not production-ready
- Mail objects are immutable once stored
- Index data should be on fast storage (SSD/CephFS)
- Mail objects can use erasure coding for efficiency
- The plugin supports both standalone and clustered Dovecot deployments
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM 192.168.178.73:6088/ceph-dovecot-runtime:f3031c31a2aae0bcfcb504d660a6d4dc555e804d
WORKDIR /repo
COPY ./ /repo
RUN ./autogen.sh
RUN ./configure --with-dovecot=/usr/local/lib/dovecot --enable-maintainer-mode --enable-debug --with-integration-tests --enable-valgrind --enable-debug
RUN make install
ENTRYPOINT ["/bin/bash", "-c", "./startup.sh" ]

7 changes: 7 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM 192.168.178.73:6088/ceph-dovecot-combined:f551f222f7890a89a2261dcc024e720ba9239bf9
WORKDIR /repo
COPY ./ /repo
RUN ./autogen.sh
RUN ./configure --with-dovecot=/usr/local/lib/dovecot --enable-maintainer-mode --enable-debug --with-integration-tests --enable-valgrind --enable-debug
RUN make clean install
RUN ./setup.sh
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ If you are using CentOS make sure you also have the following package installed:
./configure --with-dovecot=/home/user/workspace/core
make install

### Docker compose run with dovecot and ceph cluster
cd docker
docker-compose up
## Thanks

<table border="0">
Expand Down
19 changes: 19 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,22 @@ AC_CHECK_HEADER([rados/librados.h], [
LIBS="$LIBS -lrados"
], [AC_MSG_ERROR([cannot build without RADOS support: librados.h not found])])

AC_ARG_WITH([SPDLOG],
AS_HELP_STRING([--with-SPDLOG=warn|error], [set action for missing spdlog package]),
[SPDLOG_ACTION="$withval"],
[SPDLOG_ACTION="error"])

# Check for the presence of spdlog library
PKG_CHECK_MODULES([SPDLOG], [spdlog], [$SPDLOG_ACTION], [SPDLOG_ACTION="error"])

# Check if spdlog is found and add it to LDFLAGS
if test "x$SPDLOG_LIBS" != "x"; then
LDFLAGS="$LDFLAGS $SPDLOG_LIBS"
AC_DEFINE([SPD_LOGGING_FRAMEWORK], [1], [Define if spdlog is found])
else
AC_DEFINE([NO_LOGGING_FRAMEWORK], [1], [Define if spdlog is not found])
fi

AC_CHECK_FUNC(rados_read_op_omap_get_vals2, AC_DEFINE(HAVE_OMAP_GET_VALS2, 1, [Define if you have the `rados_read_op_omap_get_vals2' function]))
AC_CHECK_FUNC(rados_set_alloc_hint2, AC_DEFINE(HAVE_ALLOC_HINT_2, 1, [Define if you have the `set_alloc_hint2' function]))
AC_CHECK_FUNC(rados_read_op_omap_get_keys2, AC_DEFINE(HAVE_OMAP_GET_KEYS_2, 1, [Define if you have the `omap_get_keys2' function]))
Expand Down Expand Up @@ -232,6 +248,9 @@ src/storage-rbox/Makefile
src/librmb/tools/Makefile
src/librmb/tools/rmb/Makefile
src/tests/Makefile
src/storage-interface/Makefile
src/storage-interface/tools/Makefile
src/storage-interface/tools/rmb/Makefile
])

AC_OUTPUT
Expand Down
Loading