Configure mailman vhost.
This commit is contained in:
parent
3859a3912b
commit
e711819e2f
@ -6,6 +6,9 @@
|
||||
- name: Restart dovecot
|
||||
service: name=dovecot state=restarted
|
||||
|
||||
- name: Restart nginx
|
||||
service: name=nginx state=restarted
|
||||
|
||||
- name: Restart postfix
|
||||
service: name=postfix state=restarted
|
||||
|
||||
|
@ -10,6 +10,7 @@
|
||||
- dovecot-ldap
|
||||
- dovecot-managesieved
|
||||
- dovecot-sieve
|
||||
- fcgiwrap
|
||||
- mailman
|
||||
- postfix
|
||||
- postfix-ldap
|
||||
@ -59,6 +60,16 @@
|
||||
notify: Restart postfix
|
||||
tags: mail
|
||||
|
||||
- name: Configure mailman vhost
|
||||
template: src=mailman/vhost.j2 dest=/etc/nginx/sites-available/mailman
|
||||
notify: Restart nginx
|
||||
tags: mail
|
||||
|
||||
- name: Enable mailman vhost
|
||||
file: src=/etc/nginx/sites-available/mailman dest=/etc/nginx/sites-enabled/mailman state=link
|
||||
notify: Restart nginx
|
||||
tags: mail
|
||||
|
||||
- name: Configure policyd
|
||||
copy: src={{ item }} dest=/etc/postfix-policyd-spf-python/{{ item }}
|
||||
with_items:
|
||||
@ -113,6 +124,10 @@
|
||||
service: name=dovecot state=started enabled=yes
|
||||
tags: mail
|
||||
|
||||
- name: Start fcgiwrap
|
||||
service: name=fcgiwrap state=started enabled=yes
|
||||
tags: mail
|
||||
|
||||
- name: Start postfix
|
||||
service: name=postfix state=started enabled=yes
|
||||
tags: mail
|
||||
|
34
roles/mail/templates/nginx/vhost.j2
Normal file
34
roles/mail/templates/nginx/vhost.j2
Normal file
@ -0,0 +1,34 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name {{ mailman_domain }};
|
||||
root /usr/lib/;
|
||||
|
||||
location = / {
|
||||
rewrite ^ /mailman/listinfo permanent;
|
||||
}
|
||||
|
||||
location / {
|
||||
rewrite ^ /mailman$uri?$args;
|
||||
}
|
||||
|
||||
location = /mailman/ {
|
||||
rewrite ^ /mailman/listinfo permanent;
|
||||
}
|
||||
|
||||
location /mailman {
|
||||
fastcgi_split_path_info (^/mailman/[^/]*)(.*)$;
|
||||
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 {
|
||||
alias /usr/share/images/mailman;
|
||||
}
|
||||
location /pipermail {
|
||||
alias /var/lib/mailman/archives/public;
|
||||
autoindex on;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user