From 8f70860f8ebeba58d27c361afc965c318672ae71 Mon Sep 17 00:00:00 2001 From: Markus Hauschild Date: Fri, 8 Apr 2016 20:00:21 +0200 Subject: [PATCH] Adjust mail role to reality (now with working fcgi). --- roles/mail/tasks/main.yml | 4 +-- roles/mail/templates/mailman/mm_cfg.py.j2 | 2 +- roles/mail/templates/nginx/vhost.j2 | 25 ++++++++++++++----- .../templates/postfix/recipient_access.j2 | 2 +- 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/roles/mail/tasks/main.yml b/roles/mail/tasks/main.yml index 9be68f9..87c6e90 100644 --- a/roles/mail/tasks/main.yml +++ b/roles/mail/tasks/main.yml @@ -51,7 +51,7 @@ notify: Restart dovecot - name: Ensure correct dovecot certificate permissions - file: path=/etc/dovecot/ssl/{{ mail_server }}.key owner=root mode=0400 + file: path=/etc/dovecot/ssl/{{ mail_server }}.key owner=dovecot mode=0400 notify: Restart dovecot - name: Configure mailman @@ -113,7 +113,7 @@ notify: Restart postfix - name: Ensure correct postfix certificate permissions - file: path=/etc/postfix/ssl/{{ mail_server }}.key owner=root mode=0400 + file: path=/etc/postfix/ssl/{{ mail_server }}.key owner=postfix mode=0400 notify: Restart postfix - name: Create razor directory structure diff --git a/roles/mail/templates/mailman/mm_cfg.py.j2 b/roles/mail/templates/mailman/mm_cfg.py.j2 index 2d46b6f..3e0efb6 100644 --- a/roles/mail/templates/mailman/mm_cfg.py.j2 +++ b/roles/mail/templates/mailman/mm_cfg.py.j2 @@ -73,7 +73,7 @@ add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST) #------------------------------------------------------------- # The default language for this server. -DEFAULT_SERVER_LANGUAGE = 'en' +DEFAULT_SERVER_LANGUAGE = 'de' #------------------------------------------------------------- # Iirc this was used in pre 2.1, leave it for now diff --git a/roles/mail/templates/nginx/vhost.j2 b/roles/mail/templates/nginx/vhost.j2 index 8e2d384..0fb6773 100644 --- a/roles/mail/templates/nginx/vhost.j2 +++ b/roles/mail/templates/nginx/vhost.j2 @@ -7,19 +7,32 @@ server { server_name {{ mailman_domain }}; + root /usr/lib/cgi-bin/mailman/; + + location /.well-known/acme-challenge { + default_type "text/plain"; + alias /var/www/acme-challenge; + } + location = / { - rewrite ^ /listinfo permanent; + rewrite ^ /mailman/listinfo permanent; } location / { - root /usr/lib/cgi-bin/mailman/; - fastcgi_split_path_info (^/[^/]*)(.*)$; + rewrite ^ /mailman$uri?$args; + } + + location = /mailman/ { + rewrite ^ /mailman/listinfo permanent; + } + + location /mailman { + root /usr/lib/cgi-bin; + fastcgi_split_path_info (^/mailman/[^/]+)(/.*)$; + fastcgi_pass unix:///var/run/fcgiwrap.socket; include /etc/nginx/fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; - fastcgi_intercept_errors on; - fastcgi_pass unix:/var/run/fcgiwrap.socket; } location /images/mailman { diff --git a/roles/mail/templates/postfix/recipient_access.j2 b/roles/mail/templates/postfix/recipient_access.j2 index 19287cf..9ac7225 100644 --- a/roles/mail/templates/postfix/recipient_access.j2 +++ b/roles/mail/templates/postfix/recipient_access.j2 @@ -1 +1 @@ -mrks@binary-kitchen.com rblgrey +mrks@binary-kitchen.com greylisting