Skip to content

Commit

Permalink
Update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierGuilloux committed Feb 3, 2020
1 parent 977ef59 commit af74cf8
Show file tree
Hide file tree
Showing 9 changed files with 646 additions and 33 deletions.
51 changes: 18 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,26 @@
Image providing [Sympa](https://www.sympa.org/) mailing list service.
## Ready to use sympa docker image

You should make sure you mount spool and data volumes (`/var/spool/sympa`, `/var/spool/nullmailer`,
and `/var/lib/sympa`) so that you do not lose e-mails and mailing lists data when you are
recreating a container. If volumes are empty, image will initialize them at the first startup.

The intended use of this image is that it is extended (see [cloyne/sympa](https://github.com/cloyne/docker-sympa)
for an example) with customizations for your installation, and used together with
[tozd/postfix](https://github.com/tozd/docker-postfix) for receiving and sending e-mails
(see [cloyne/postfix](https://github.com/cloyne/docker-postfix) for an example how to integrate
them together). It is configured to be used with [tozd/postgresql](https://github.com/tozd/docker-postgresql)
PostgreSQL database, by default, running in a contained named `pgsql`. You can link containers together
or use [tozd/hosts](https://github.com/tozd/docker-hosts). Use `REMOTES` environment variable to
specify the container or server used for sending e-mails.

**The image contains only example values and cannot run without extending (or mounting necessary files into it).**

You should provide two volumes, `/etc/sympa/includes` and `/etc/sympa/shared`.

`/etc/sympa/includes` should contain two files:
* `database` – a password for `sympa` user with permissions over `sympa` PostgreSQL database at (by default) `pgsql` container
* `cookie` – a randomly generated string used for cookie string secret
Build the image:
```
git clone -b 6.2.38 https://github.com/OlivierGuilloux/docker-sympa
cd docker-sympa
docker build -t docker-sympa:6.2.38 .
```

`/etc/sympa/shared` is a volume shared with (for example) `cloyne/postfix`
container to provide necessary SSH keys for communication between containers.
Add your specifics (cf. sample/):
```
FROM docker-sympa-ws:6.2.38
When extending the image you should override files in the `/etc/sympa/conf.d` directory
with ones containing your values. Moreover you probably want to define your own Sympa robot.
# Update the configuration
COPY ./etc/sympa /etc/sympa
RUN chown sympa.sympa -R /etc/sympa
To create a database for Sympa, `exec` into your PostgreSQL container and run:
# Copy id_rsa.pub (when using ssh between postfix and sympa)
RUN mkdir /var/lib/sympa/.ssh/ && chmod 700 /var/lib/sympa/.ssh/ && mkdir -p /var/spool/sympa/wwsbounce && mkdir -p /var/spool/sympa/bulk
COPY ./shared/id_rsa.pub /var/lib/sympa/.ssh/
# Update Locale
RUN locale-gen fr_FR.UTF-8 && export LANG=fr_FR.UTF-8
```
$ createuser -U postgres -DRS -PE sympa
$ createdb -U postgres -O sympa sympa
```

You might have to initialize afterwards the database. Run from inside your Sympa container:

```
$ psql -h pgsql -U sympa -W -f /usr/share/sympa/bin/create_db.Pg
```
13 changes: 13 additions & 0 deletions sample/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM docker-sympa-ws:6.2.38

# Configuration
COPY ./etc/sympa /etc/sympa
RUN chown sympa.sympa -R /etc/sympa

# Copy id_rsa.pub (when using ssh between postfix and sympa)
RUN mkdir /var/lib/sympa/.ssh/ && chmod 700 /var/lib/sympa/.ssh/ && mkdir -p /var/spool/sympa/wwsbounce && mkdir -p /var/spool/sympa/bulk
COPY ./shared/id_rsa.pub /var/lib/sympa/.ssh/

# Update Locale
RUN locale-gen fr_FR.UTF-8 && export LANG=fr_FR.UTF-8

3 changes: 3 additions & 0 deletions sample/etc/mail/transport_regexp
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# postfix transport regexp
/^.*-owner\@mylist.mydomain$/ sympabounce:
/^.*\@mylist.mydomain$/ sympa:
2 changes: 2 additions & 0 deletions sample/etc/nullmailer/remotes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Postfix host and port
172.17.0.1 smtp --port=2525
Empty file.
4 changes: 4 additions & 0 deletions sample/etc/sympa/data_structure.version.afterUpdate
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This file is automatically created by sympa.pl after installation
# Unless you know what you are doing, you should not modify it
6.2.38

18 changes: 18 additions & 0 deletions sample/etc/sympa/mylist.mydomain/robot.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
host mylist.mydomain

http_host mylist.mydomain

listmaster [email protected]

title My Sympa Service for mydomain

create_list listmaster

supported_lang fr,en
lang fr

default_home lists

dark_color #00aa00
light_color #ddffdd
selected_color #0099cc
4 changes: 4 additions & 0 deletions sample/etc/sympa/mylist.mydomain/trusted_applications.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
trusted_application
name myapplication
md5password generateit
proxy_for_variables USER_EMAIL
Loading

0 comments on commit af74cf8

Please sign in to comment.