Skip to content

Commit

Permalink
Use a local domain reverse proxy for accessing mailman
Browse files Browse the repository at this point in the history
By default alternc panel runs as a uid which is not accepted by the
debian version of mailman. This takes any requests are proxies it
through mailman.localdomain which runs as the default www-data user.

Refs AlternC#14
  • Loading branch information
kienanstewart committed Jun 22, 2018
1 parent de0d41d commit 669970e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ install:
chown 1999:1999 -R $(DESTDIR)/usr/share/alternc/panel/
install -m 0644 mm_cfg.py \
$(DESTDIR)/etc/alternc/templates/mailman/
install -m 0644 alternc-mailman.conf $(DESTDIR)/etc/alternc/alternc-mailman.conf
install -m 0644 -o root -g root src/get_url_alternc.py src/set_url_alternc.py \
$(DESTDIR)/usr/lib/mailman/bin/
install -m 0755 src/update_mailman.sh \
Expand Down
13 changes: 7 additions & 6 deletions alternc-mailman-install
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@ then
echo "ensuring apache2 symlink is setup in /etc/apache2/conf.d/"
# compatibility with both Apache 2.2 and 2.4 makes it Wheezy AND Jessie-compliant :
if [ -d "/etc/apache2/conf.d" ]
then
ln -sf /etc/mailman/apache.conf /etc/apache2/conf.d/mailman.conf
then
ln -sf /etc/alternc/alternc-mailman.conf /etc/apache2/conf.d/mailman.conf
fi
if [ -d "/etc/apache2/conf-enabled" ]
then
ln -sf /etc/mailman/apache.conf /etc/apache2/conf-enabled/mailman.conf
if [ -d "/etc/apache2/conf-available" ]
then
ln -sf /etc/alternc/alternc-mailman.conf /etc/apache2/conf-enabled/mailman.conf
a2enconf mailman.conf
fi
fi
fi

if [ "$1" = "before-reload" ]
then
Expand Down
1 change: 1 addition & 0 deletions debian/alternc-mailman.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ case "$1" in

echo "installing required apache modules"
a2enmod rewrite
a2enmod proxy
# only necessary on Jessie:
a2enmod cgi || true

Expand Down
7 changes: 7 additions & 0 deletions mm_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@
DEFAULT_MSG_FOOTER for an example."""


# This is some trickery to reverse proxies to work with list creation
# and when restarting mailman.
import os
if os.environ.get('REQUEST_URI') is not None:
os.environ["REQUEST_URI"] = os.environ["REQUEST_URI"].replace("/cgi/", "/cgi-bin/")

#######################################################
# Here's where we get the distributed defaults. #

Expand Down Expand Up @@ -86,3 +92,4 @@
# Alternc-mailman does the job of creating aliases for us.
MTA = None # So that mailman skips aliases generation

VIRTUAL_HOST_OVERVIEW = False

0 comments on commit 669970e

Please sign in to comment.