[GH-ISSUE #1204] Something wrong with automx configuration #982

Closed
opened 2026-02-27 11:14:35 +03:00 by kerem · 1 comment
Owner

Originally created by @danielsatanik on GitHub (Jul 29, 2017).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/1204

Impacted versions

  • Modoboa: 1.8.2
  • installer used: Yes (without amavis)
  • Webserver: Nginx
  • I change the domain infos

Steps to reproduce

$ su - automx
$ source env/bin/activate
$ automx-test automx@automx.com

Current behavior

best is if I just give the output, but it uses the default vhost instead of the autoconf one

Testing Autoconfig ...
Connecting to http://autoconfig.automx.com/mail/config-v1.1.xml?emailaddress= automx@automx.com ...

  HTTP/1.1 307 Temporary Redirect
  Server: nginx/1.10.3 (Ubuntu)
  Date: Sat, 29 Jul 2017 09:58:26 GMT
  Content-Type: text/html
  Content-Length: 196
  Connection: keep-alive
  Location: https://autoconfig.automx.com/mail/config-v1.1.xml?emailaddress=automx@automx.com
  HTTP/1.1 404 Not Found
  Server: nginx/1.10.3 (Ubuntu)
  Date: Sat, 29 Jul 2017 09:58:26 GMT
  Content-Type: text/html
  Content-Length: 178
  Connection: keep-alive
Trying fallback URL ...
Connecting to http://automx.com/.well-known/autoconfig/mail/config-v1.1.xml?emailaddress=automx@automx.com ...

Expected behavior

  • email configuration should be resolved

Video/Screenshot link (optional)

here is the current autoconfig.automx.com.conf in /etc/nginx/sites-enabled/
I added the second block because it was completely missing

upstream automx {
    server unix:/run/uwsgi/app/automx_instance/socket fail_timeout=0;
}

server {
    listen 80;
    listen [::]:80;
    server_name autoconfig.automx.com;
    root /srv/automx/instance;

    access_log /var/log/nginx/autoconfig.automx.com-access.log;
    error_log /var/log/nginx/autoconfig.automx.com-error.log;

    location /mail/config-v1.1.xml {
        include uwsgi_params;
        uwsgi_pass automx;
    }
}

server {
    listen 443 ssl http2;
    server_name autodiscover.automx.com;
    root /srv/automx/instance;

    ssl_certificate /etc/letsencrypt/live/automx.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/automx.com/privkey.pem; # managed by Certbot
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
    ssl_prefer_server_ciphers on;
    ssl_session_cache shared:SSL:10m;
    ssl_ecdh_curve secp384r1;
    ssl_verify_depth 3;
    ssl_dhparam /etc/ssl/certs/dhparam.pem;
    ssl_session_timeout 10m;
    ssl_session_tickets off;
    ssl_stapling on;
    ssl_stapling_verify on;
    resolver 8.8.8.8 8.8.4.4 valid=300s;
    resolver_timeout 5s;

    add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload";
#    add_header X-Frame-Options DENY;
    add_header X-Content-Type-Options nosniff;

#    client_max_body_size 10M;

    access_log /var/log/nginx/autodiscover.automx.com-access.log;
    error_log /var/log/nginx/autodiscover.automx.com-error.log;

    location /mail/config-v1.1.xml {
        include uwsgi_params;
        uwsgi_pass automx;
    }

    location /mobileconfig {
    	include uwsgi_params;
        uwsgi_pass automx;
    }
}

for clarification I give the default configuration in nginx

# Default server configuration
server {
	listen 80 default_server;
	listen [::]:80 default_server;
	server_name _;
	return 307 https://$host$request_uri;
}

server {
	# SSL configuration
	listen 443 ssl http2 default_server; # managed by Certbot

	set $basepath "/var/www";

	server_name ~^(\w+\.)?\w+\.\w+$;
	if ( -d $basepath/$host/public ) {
		set $rootpath $basepath/$host/public;
	}
	if ( !-d $basepath/$host/public ) {
		set $rootpath $basepath/$host;
	}

	root $rootpath;

	access_log "/var/log/nginx/${host}.access.log";
	error_log "/var/log/nginx/error.log" debug;

	index index.php index.html index.htm index.nginx-debian.html;

	location / {
		try_files $uri $uri/ /index.php?$query_string;
	}

	location ~ \.php$ {
		include snippets/fastcgi-php.conf;
		fastcgi_pass unix:/run/php/php7.0-fpm.sock;
	}

	location ~ /\.ht {
		deny all; 
	}

	location ~ /.well-known {
		allow all;
	}

	ssl_certificate /etc/letsencrypt/live/automx.com/fullchain.pem; # managed by Certbot
	ssl_certificate_key /etc/letsencrypt/live/automx.com/privkey.pem; # managed by Certbot
	# ssl_session_cache shared:le_nginx_SSL:1m; # managed by Certbot
	# ssl_session_timeout 1440m; # managed by Certbot

	ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # managed by Certbot
	ssl_prefer_server_ciphers on; # managed by Certbot

	ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";

	ssl_ecdh_curve secp384r1;
	ssl_session_cache shared:SSL:10m;
	ssl_session_timeout 10m;
	ssl_session_tickets off;
	ssl_stapling on;
	ssl_stapling_verify on;
	resolver 8.8.8.8 8.8.4.4 valid=300s;
	resolver_timeout 5s;
	# disable HSTS header for now
	add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload";
	add_header X-Frame-Options DENY;
	add_header X-Content-Type-Options nosniff;

	ssl_dhparam /etc/ssl/certs/dhparam.pem;

	gzip off;
}
Originally created by @danielsatanik on GitHub (Jul 29, 2017). Original GitHub issue: https://github.com/modoboa/modoboa/issues/1204 # Impacted versions * Modoboa: 1.8.2 * installer used: Yes (without amavis) * Webserver: Nginx * I change the domain infos # Steps to reproduce ``` $ su - automx $ source env/bin/activate $ automx-test automx@automx.com ``` # Current behavior best is if I just give the output, but it uses the default vhost instead of the autoconf one ``` Testing Autoconfig ... Connecting to http://autoconfig.automx.com/mail/config-v1.1.xml?emailaddress= automx@automx.com ... HTTP/1.1 307 Temporary Redirect Server: nginx/1.10.3 (Ubuntu) Date: Sat, 29 Jul 2017 09:58:26 GMT Content-Type: text/html Content-Length: 196 Connection: keep-alive Location: https://autoconfig.automx.com/mail/config-v1.1.xml?emailaddress=automx@automx.com HTTP/1.1 404 Not Found Server: nginx/1.10.3 (Ubuntu) Date: Sat, 29 Jul 2017 09:58:26 GMT Content-Type: text/html Content-Length: 178 Connection: keep-alive Trying fallback URL ... Connecting to http://automx.com/.well-known/autoconfig/mail/config-v1.1.xml?emailaddress=automx@automx.com ... ``` # Expected behavior * email configuration should be resolved # Video/Screenshot link (optional) here is the current autoconfig.automx.com.conf in `/etc/nginx/sites-enabled/` I added the second block because it was completely missing ``` upstream automx { server unix:/run/uwsgi/app/automx_instance/socket fail_timeout=0; } server { listen 80; listen [::]:80; server_name autoconfig.automx.com; root /srv/automx/instance; access_log /var/log/nginx/autoconfig.automx.com-access.log; error_log /var/log/nginx/autoconfig.automx.com-error.log; location /mail/config-v1.1.xml { include uwsgi_params; uwsgi_pass automx; } } server { listen 443 ssl http2; server_name autodiscover.automx.com; root /srv/automx/instance; ssl_certificate /etc/letsencrypt/live/automx.com/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/automx.com/privkey.pem; # managed by Certbot ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH"; ssl_prefer_server_ciphers on; ssl_session_cache shared:SSL:10m; ssl_ecdh_curve secp384r1; ssl_verify_depth 3; ssl_dhparam /etc/ssl/certs/dhparam.pem; ssl_session_timeout 10m; ssl_session_tickets off; ssl_stapling on; ssl_stapling_verify on; resolver 8.8.8.8 8.8.4.4 valid=300s; resolver_timeout 5s; add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"; # add_header X-Frame-Options DENY; add_header X-Content-Type-Options nosniff; # client_max_body_size 10M; access_log /var/log/nginx/autodiscover.automx.com-access.log; error_log /var/log/nginx/autodiscover.automx.com-error.log; location /mail/config-v1.1.xml { include uwsgi_params; uwsgi_pass automx; } location /mobileconfig { include uwsgi_params; uwsgi_pass automx; } } ``` for clarification I give the default configuration in nginx ``` # Default server configuration server { listen 80 default_server; listen [::]:80 default_server; server_name _; return 307 https://$host$request_uri; } server { # SSL configuration listen 443 ssl http2 default_server; # managed by Certbot set $basepath "/var/www"; server_name ~^(\w+\.)?\w+\.\w+$; if ( -d $basepath/$host/public ) { set $rootpath $basepath/$host/public; } if ( !-d $basepath/$host/public ) { set $rootpath $basepath/$host; } root $rootpath; access_log "/var/log/nginx/${host}.access.log"; error_log "/var/log/nginx/error.log" debug; index index.php index.html index.htm index.nginx-debian.html; location / { try_files $uri $uri/ /index.php?$query_string; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php7.0-fpm.sock; } location ~ /\.ht { deny all; } location ~ /.well-known { allow all; } ssl_certificate /etc/letsencrypt/live/automx.com/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/automx.com/privkey.pem; # managed by Certbot # ssl_session_cache shared:le_nginx_SSL:1m; # managed by Certbot # ssl_session_timeout 1440m; # managed by Certbot ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # managed by Certbot ssl_prefer_server_ciphers on; # managed by Certbot ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH"; ssl_ecdh_curve secp384r1; ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; ssl_session_tickets off; ssl_stapling on; ssl_stapling_verify on; resolver 8.8.8.8 8.8.4.4 valid=300s; resolver_timeout 5s; # disable HSTS header for now add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"; add_header X-Frame-Options DENY; add_header X-Content-Type-Options nosniff; ssl_dhparam /etc/ssl/certs/dhparam.pem; gzip off; } ```
kerem closed this issue 2026-02-27 11:14:35 +03:00
Author
Owner

@tonioo commented on GitHub (Jul 29, 2017):

This issue was moved to modoboa/modoboa-installer#151

<!-- gh-comment-id:318827188 --> @tonioo commented on GitHub (Jul 29, 2017): This issue was moved to modoboa/modoboa-installer#151
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/modoboa-modoboa#982
No description provided.