Comments (2)
I am currently running this on multiple domains but it requires some manual changes to configuration files which are obviously a bit annoying because they do not survive the respawn of a container via docker or docker compose. The changes needed are the following:
- Add a line for each extra domain to
mm_cfg.py
in the following way:add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST) add_virtualhost('lists.additional_domain_1.org', 'additional_domain_1.org') add_virtualhost('lists.additional_domain_2.org', 'additional_domain_2.org')
- add all the relevant hostnames to
/etc/exim4/update-exim4.conf.conf
# this is necessary otherwise exim will throw error 550 and reject relay dc_other_hostnames=primary_domain.org:additional_domain_1.org:additional_domain_2.org
and to
/etc/exim4/conf.d/main/04_mailman_options
domainlist mm_domains=primary_domain.org:additional_domain_1.org:additional_domain_2.org
With these changes mailman can handle multiple lists just fine. It would be nice if we could please integrate this with the current
RUN.sh
script. Probably the easiest would be to introduce two new ENV variables: URL_VIRTUAL_HOSTS and EMAIL_VIRTUAL_HOSTSThen in RUN.sh something like that:
# Convert comma-separated lists into arrays IFS=',' read -r -a url_hosts_array <<< "$URL_VIRTUAL_HOSTS" IFS=',' read -r -a email_hosts_array <<< "$EMAIL_VIRTUAL_HOSTS" # Check if the arrays have the same length if [ ${#url_hosts_array[@]} -ne ${#email_hosts_array[@]} ]; then echo "The lists have different lengths." exit 1 fi # Add virtual hosts to /etc/mailman/mm_cfg.py for ((i = 0; i < ${#url_hosts_array[@]}; ++i)); do echo "add_virtualhost('${url_hosts_array[$i]}', '${email_hosts_array[$i]}')" >> $mailmancfg done # Construct the domain list for Exim configuration domain_list="$PRIMARY_DOMAIN" for email_host in "${email_hosts_array[@]}"; do domain_list+=":$email_host" done # Update /etc/exim4/update-exim4.conf.conf - not quite compatible with the current strategy based on sed echo "dc_other_hostnames='$domain_list'" >> /etc/exim4/update-exim4.conf.conf # Update /etc/exim4/conf.d/main/04_mailman_options echo "domainlist mm_domains='$domain_list'" >> /etc/exim4/conf.d/main/04_mailman_options echo "Configuration updated successfully."
Thanks!! You saved my life!!
from mailman2.
Sorry for the long delay, I've finally found time to have a look at your request and have considered the implications of the suggested environment variables and script changes for supporting multiple domains in the d3fk/mailman2
container image.
I assume you have considered the possibility of deploying several containers on the same server for your use case. This approach, while feasible, introduces the inconvenience of managing a distinct web interface for each domain and requires additional configurations, such as setting up a load balancer, reverse proxy, or ingress to correctly redirect the requests to the appropriate container based on the domain name.
While your modifications are indeed valuable for a specific use case, I've decided not to integrate them into the main repository. The goal of this container is to provide a quick and straightforward setup. Introducing additional environment variables for multi-domain support could complicate the configuration process, which we aim to keep as simple as possible for the majority of users.
Given your specific needs, I recommend creating a custom Docker image based on the d3fk/mailman2
image. This way, you can include your configurations directly in the image rather than relying on manual changes to configuration for each deployment. Hereβs a simple example of how to set up your Dockerfile:
FROM d3fk/mailman2
COPY {LOCAL_PATH}/mm_cfg.py /etc/mailman/mm_cfg.py
RUN echo "dc_other_hostnames=primary_domain.org:additional_domain_1.org:additional_domain_2.org" >> /etc/exim4/update-exim4.conf.conf \
&& echo "domainlist mm_domains=primary_domain.org:additional_domain_1.org:additional_domain_2.org" >> /etc/exim4/conf.d/main/04_mailman_options
You can then build and run your customized container with the following basic commands, modifying them as necessary:
docker build -t yourcustommailman .
docker run yourcustomailman
This approach ensures that your modifications are preserved across container restarts and deployments, maintaining consistency through different versions, without altering the core simplicity of the original container setup.
Hope this helps!
from mailman2.
Related Issues (13)
- exim4 relay not permitted error HOT 27
- syntax error in DKIM record with BIND 9.16.1-Ubuntu (Stable Release) HOT 3
- migrating from another server HOT 3
- Any docker-compose file for this tool? HOT 12
- Apache SSL certificate are not exposed as a docker volume HOT 2
- Admin interface crashed without prior config HOT 5
- Generated DKIM is too long for a TXT record HOT 1
- Digests don't work because run.sh doesn't start cron HOT 1
- mailman-request@ doesn't work because SYSTEM_ALIASES_PIPE_TRANSPORT is not set HOT 1
- Stops sending emails after rebooting the docker host HOT 3
- DEFAULT_URL_PATTERN variable line added to /etc/mm_cfg.py each time the container is restarted HOT 4
- How to Disable TLS 1.0 and 1.1 For Exim? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mailman2.