diff --git a/core/README.md b/core/README.md index a3df964..a79403b 100644 --- a/core/README.md +++ b/core/README.md @@ -109,10 +109,17 @@ api_key: $HYPERKITTY_API_KEY MTA === -[Exim4][2] is the recommended MTA for this image. The [recommended -configuration][3] to run exim for this image can be found on github repository. +You can use Postfix or [Exim][2] with this image to send emails. Mailman Core +can interact with any modern MTA which can deliver emails over LMTP. The +documentation for Mailman Core has configuration settigs for using them. +Only Exim and Postfix has been tested with these images and are supported as of +now. There _might_ be some limitations with using other MTAs in a containerized +environments. Contributions are welcome for anything additional needed to +support other MTAs. + +To setup Exim or Posfix, checkout the [documentation][3]. [1]: https://github.com/maxking/docker-mailman [2]: http://www.exim.org -[3]: https://github.com/maxking/docker-mailman#setting-up-your-mta +[3]: https://asynchronous.in/docker-mailman#setting-up-your-mta diff --git a/core/assets/run.sh b/core/assets/run.sh index df4700f..e4ff893 100755 --- a/core/assets/run.sh +++ b/core/assets/run.sh @@ -22,34 +22,13 @@ function wait_for_postgres () { >&2 echo "Postgres is up - continuing" } - -# Check if $DATABASE_URL is defined, if not, use a standard sqlite database. -# -# If the $DATABASE_URL is defined and is postgres, check if it is available -# yet. Do not start the container before the postgresql boots up. -# -# TODO: If the $DATABASE_URL is defined and is mysql, check if the database is -# available before the container boots up. -# -# TODO: Check the database type and detect if it is up based on that. For now, -# assume that postgres is being used if DATABASE_URL is defined. -if [[ ! -v DATABASE_URL ]]; then - echo "DATABASE_URL is not defined. Using sqlite database..." - export DATABASE_URL=sqlite:///mailman.db - export DATABASE_TYPE='sqlite' - export DATABASE_CLASS='mailman.database.sqlite.SQLiteDatabase' -fi - - -if [[ "$DATABASE_TYPE" = 'postgres' ]] -then - wait_for_postgres -fi +# Empty the config file. +echo "# This file is autogenerated at container startup." > /etc/mailman.cfg # Check if $MM_HOSTNAME is set, if not, set it to a default value. # TODO: Factor this out to a function. if [[ ! -v MM_HOSTNAME ]]; then - export MM_HOSTNAME=mailman-core + export MM_HOSTNAME='172.19.199.2' fi if [[ ! -v SMTP_HOST ]]; then @@ -64,8 +43,46 @@ if [[ ! -v HYPERKITTY_URL ]]; then export HYPERKITTY_URL=http://mailman-web:8000/ fi + +function setup_database () { + if [[ ! -v DATABASE_URL ]] + then + echo "Environemnt variable DATABASE_URL should be defined..." + exit 1 + fi + + cat >> /etc/mailman.cfg < /etc/mailman.cfg <> /etc/mailman.cfg <