Compare commits
6 Commits
2
...
feature/mi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aa35e8568a | ||
|
|
82e5e1bff1 | ||
|
|
fefee26114 | ||
|
|
1f267a1aa4 | ||
|
|
8e3ddfa237 | ||
|
|
258b4a81a8 |
53
.drone.yml
53
.drone.yml
@@ -1,53 +0,0 @@
|
|||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
name: default
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: build and publish image
|
|
||||||
image: plugins/docker
|
|
||||||
settings:
|
|
||||||
repo: eumau/dovecot
|
|
||||||
auto_tag: true
|
|
||||||
username:
|
|
||||||
from_secret: dockerhub_username
|
|
||||||
password:
|
|
||||||
from_secret: dockerhub_password
|
|
||||||
when:
|
|
||||||
branch:
|
|
||||||
- master
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
name: pull_request
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: build image only
|
|
||||||
image: plugins/docker
|
|
||||||
settings:
|
|
||||||
repo: eumau/dovecot
|
|
||||||
auto_tag: true
|
|
||||||
dry_run: true
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
event:
|
|
||||||
- pull_request
|
|
||||||
|
|
||||||
---
|
|
||||||
kind: pipeline
|
|
||||||
name: tags
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: docker
|
|
||||||
image: plugins/docker
|
|
||||||
settings:
|
|
||||||
repo: eumau/dovecot
|
|
||||||
username:
|
|
||||||
from_secret: dockerhub_username
|
|
||||||
password:
|
|
||||||
from_secret: dockerhub_password
|
|
||||||
tags:
|
|
||||||
- ${DRONE_TAG}
|
|
||||||
|
|
||||||
trigger:
|
|
||||||
event:
|
|
||||||
- tag
|
|
||||||
38
.gitea/workflows/build.yml
Normal file
38
.gitea/workflows/build.yml
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
name: Build Docker images
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: true
|
||||||
|
matrix:
|
||||||
|
repo:
|
||||||
|
- "eumau/dovecot"
|
||||||
|
tag:
|
||||||
|
- "4-to-5"
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
-
|
||||||
|
name: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
-
|
||||||
|
name: Build and push image
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
push: true
|
||||||
|
tags: ${{ matrix.repo }}:${{ matrix.tag }}
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
##
|
##
|
||||||
## Mailbox locations and namespaces
|
## Mailbox locations and namespaces
|
||||||
##
|
##
|
||||||
mail_location = mdbox:~/dbox
|
mail_location = Maildir:~/maildir
|
||||||
mail_attribute_dict = file:~/dovecot-attributes
|
mail_attribute_dict = file:~/dovecot-attributes
|
||||||
|
|
||||||
namespace inbox {
|
namespace inbox {
|
||||||
@@ -287,7 +287,7 @@ mailbox_list_index = yes
|
|||||||
# this for now.
|
# this for now.
|
||||||
|
|
||||||
# Directory root where to store mail attachments. Disabled, if empty.
|
# Directory root where to store mail attachments. Disabled, if empty.
|
||||||
mail_attachment_dir = /vmail/attachments
|
mail_attachment_dir =
|
||||||
|
|
||||||
# Attachments smaller than this aren't saved externally. It's also possible to
|
# Attachments smaller than this aren't saved externally. It's also possible to
|
||||||
# write a plugin to disable saving specific attachments externally.
|
# write a plugin to disable saving specific attachments externally.
|
||||||
@@ -297,7 +297,7 @@ mail_attachment_min_size = 64k
|
|||||||
# posix : No SiS done by Dovecot (but this might help FS's own deduplication)
|
# posix : No SiS done by Dovecot (but this might help FS's own deduplication)
|
||||||
# sis posix : SiS with immediate byte-by-byte comparison during saving
|
# sis posix : SiS with immediate byte-by-byte comparison during saving
|
||||||
# sis-queue posix : SiS with delayed comparison and deduplication
|
# sis-queue posix : SiS with delayed comparison and deduplication
|
||||||
mail_attachment_fs = sis-queue /vmail/attachments-queue:posix
|
mail_attachment_fs =
|
||||||
|
|
||||||
# Hash format to use in attachment filenames. You can add any text and
|
# Hash format to use in attachment filenames. You can add any text and
|
||||||
# variables: %{md4}, %{md5}, %{sha1}, %{sha256}, %{sha512}, %{size}.
|
# variables: %{md4}, %{md5}, %{sha1}, %{sha256}, %{sha512}, %{size}.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM eumau/debian:bullseye-slim
|
FROM eumau/debian:bookworm-slim
|
||||||
LABEL maintainer "Mauro Torrez <mauro@mau.ro>"
|
LABEL maintainer "Mauro Torrez <mauro@mau.ro>"
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
ENV LC_ALL C
|
ENV LC_ALL C
|
||||||
@@ -54,12 +54,13 @@ ENV \
|
|||||||
LDAP_USER_FILTER="(&(objectClass=inetOrgPerson)(uid=%n))" \
|
LDAP_USER_FILTER="(&(objectClass=inetOrgPerson)(uid=%n))" \
|
||||||
LDAP_PASS_ATTRS="userPassword=password, =userdb_home=/vmail/mail/%d/%n, =userdb_uid=5000, =userdb_gid=5000" \
|
LDAP_PASS_ATTRS="userPassword=password, =userdb_home=/vmail/mail/%d/%n, =userdb_uid=5000, =userdb_gid=5000" \
|
||||||
LDAP_PASS_FILTER="(&(objectClass=inetOrgPerson)(uid=%n))" \
|
LDAP_PASS_FILTER="(&(objectClass=inetOrgPerson)(uid=%n))" \
|
||||||
LDAP_ITERATE_ATTRS="=user=%{ldap:uid}@%d" \
|
LDAP_ITERATE_ATTRS="=user=%{ldap:mail}" \
|
||||||
LDAP_ITERATE_FILTER="(objectClass=inetOrgPerson)" \
|
LDAP_ITERATE_FILTER="(objectClass=inetOrgPerson)" \
|
||||||
LDAP_DEFAULT_PASS_SCHEME=CRYPT \
|
LDAP_DEFAULT_PASS_SCHEME=CRYPT \
|
||||||
SINGLE_USER= \
|
SINGLE_USER= \
|
||||||
ANTISPAM_ENABLE=yes \
|
ANTISPAM_ENABLE=yes \
|
||||||
SIEVE_ENABLE=yes \
|
SIEVE_ENABLE=yes \
|
||||||
|
MANAGESIEVE_ENABLE=yes \
|
||||||
IMAP_URLAUTH_HOST="*" \
|
IMAP_URLAUTH_HOST="*" \
|
||||||
SSL_CLIENT_CA_DIR="/etc/ssl/certs" \
|
SSL_CLIENT_CA_DIR="/etc/ssl/certs" \
|
||||||
SSL_CLIENT_CA_FILE= \
|
SSL_CLIENT_CA_FILE= \
|
||||||
@@ -72,5 +73,5 @@ ADD junk-filter.sieve /etc/dovecot/sieve/before/
|
|||||||
ADD sievec /start.d/
|
ADD sievec /start.d/
|
||||||
|
|
||||||
VOLUME ["/ssl","/vmail"]
|
VOLUME ["/ssl","/vmail"]
|
||||||
EXPOSE 110/tcp 143/tcp 587/tcp 993/tcp 995/tcp 2000/tcp
|
EXPOSE 110/tcp 143/tcp 587/tcp 993/tcp 995/tcp 4190/tcp
|
||||||
CMD ["dovecot","-F"]
|
CMD ["dovecot","-F"]
|
||||||
|
|||||||
15
README.md
15
README.md
@@ -161,3 +161,18 @@ dovecot_antispam_pipe_program_notspam_arg: learn_ham
|
|||||||
alternativa de correo.
|
alternativa de correo.
|
||||||
* `dovecot_altstorage_directory` (`{{ vmail_home }}/alt-storage`):
|
* `dovecot_altstorage_directory` (`{{ vmail_home }}/alt-storage`):
|
||||||
carpeta alternativa de correo.
|
carpeta alternativa de correo.
|
||||||
|
|
||||||
|
## Migracion de mdbox a maildir
|
||||||
|
|
||||||
|
Decidí migrar porque el sis storage está deprecado. Adicionalmente al intentar sincronizar / hacer backup de la mdbox aparecen errores de integridad, seguramente por este storage
|
||||||
|
|
||||||
|
```
|
||||||
|
docker compose stop dovecot
|
||||||
|
docker run --rm -ti -v mail_mail:/vmail eumau/dovecot:4 bash
|
||||||
|
doveadm backup -f -u mauro@mau.ro Maildir:~/maildir
|
||||||
|
### repetir para todos los usuarios
|
||||||
|
exit
|
||||||
|
### Actualizar imagen a 4-to-5
|
||||||
|
docker compose up -d
|
||||||
|
### Ahora ya deberíamos tener maildir sin attachments externos
|
||||||
|
```
|
||||||
|
|||||||
6
confd/conf.d/managesieve.toml
Normal file
6
confd/conf.d/managesieve.toml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
[template]
|
||||||
|
src = "20-managesieve.conf.tmpl"
|
||||||
|
dest = "/etc/dovecot/local.d/20-managesieve.conf"
|
||||||
|
keys = [
|
||||||
|
"/managesieve/enable",
|
||||||
|
]
|
||||||
14
confd/templates/20-managesieve.conf.tmpl
Normal file
14
confd/templates/20-managesieve.conf.tmpl
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
# enable managesieve protocol
|
||||||
|
protocols = $protocols {{ if eq (getv "/managesieve/enable") "yes" }}sieve{{ end }}
|
||||||
|
|
||||||
|
service managesieve-login {
|
||||||
|
inet_listener sieve {
|
||||||
|
port = 4190
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
service managesieve {
|
||||||
|
}
|
||||||
|
|
||||||
|
protocol sieve {
|
||||||
|
}
|
||||||
@@ -1,10 +1,12 @@
|
|||||||
plugin {
|
plugin {
|
||||||
sieve_plugins = {{ if eq (getv "/sieve/enable") "yes" }}sieve_imapsieve{{ if eq (getv "/antispam/enable") "yes" }} sieve_extprograms{{ end }}{{ end }}
|
sieve = file:~/sieve;active=~/.dovecot.sieve
|
||||||
|
|
||||||
sieve_before = /etc/dovecot/sieve/before
|
sieve_before = /etc/dovecot/sieve/before
|
||||||
sieve_after = /etc/dovecot/sieve/after
|
sieve_after = /etc/dovecot/sieve/after
|
||||||
|
|
||||||
{{ if eq (getv "/antispam/enable") "yes" }}
|
{{ if eq (getv "/antispam/enable") "yes" }}
|
||||||
|
sieve_plugins = sieve_imapsieve sieve_extprograms
|
||||||
|
|
||||||
sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.environment
|
sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.environment
|
||||||
sieve_pipe_bin_dir = /etc/dovecot/sieve
|
sieve_pipe_bin_dir = /etc/dovecot/sieve
|
||||||
|
|
||||||
|
|||||||
@@ -3,11 +3,13 @@
|
|||||||
# arg 1 - spam or ham
|
# arg 1 - spam or ham
|
||||||
|
|
||||||
if [ "$1" == "ham" ]; then
|
if [ "$1" == "ham" ]; then
|
||||||
/usr/bin/bogofilter -d /vmail/bogofilter -e -p -Sn
|
/usr/bin/bogofilter -d /vmail/bogofilter -p -Sn
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$1" == "spam" ]; then
|
if [ "$1" == "spam" ]; then
|
||||||
/usr/bin/bogofilter -d /vmail/bogofilter -e -p -Ns
|
/usr/bin/bogofilter -d /vmail/bogofilter -p -Ns
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user