The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

autoconfig/autodiscover 400 Bad Request X-Forwarded-Host

Discussion in 'E-mail Discussions' started by mattin, Feb 10, 2013.

  1. mattin

    mattin Member

    Joined:
    Feb 10, 2013
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Bratislava, Slovakia
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    I tried to enable autodiscover/autoconfig feature for outlook/mozilla and other clients. But after enabling this feature in tweaks options, when i test to load f.e. http://autodiscover.mydomain.com/autodiscover/autodiscover.xml I get only HTTP400 with this error:

    Code:
    Bad Request
    
    Your browser sent a request that this server could not understand.
    Size of a request header field exceeds server limit.
    X-Forwarded-Host
    /n
    It's the same for http://autodiscover.domain.com or http://autoconfig.domain.com

    I'm using the newest cPanel 11.36.0.6

    Proxies, redirects and everything works. When I open directly http://ip/cgi-sys/autoconfig.cgi it serves XML with right configuration for mail client.

    http://ip/cgi-sys/autodiscover.cgi will redirect to https://cpanelemaildiscovery.cpanel.net/autodiscover/autodiscover.xml but I think this is just because it's called directly.

    So the problem is somewhere between apache redirects/proxy.

    Code:
       RewriteCond %{HTTP_HOST} ^autodiscover\.
        RewriteRule ^[^?]*(\?.*)? http://127.0.0.1/cgi-sys/autodiscover.cgi [P]
        RewriteCond %{HTTP_HOST} ^autoconfig\.
        RewriteRule ^[^?]*(\?.*)? http://127.0.0.1/cgi-sys/autoconfig.cgi [P]
    Thanks for any suggestions.
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,453
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Do you see any issues with mydomain.com here?
    /http://www.intodns.com/
     
  3. mattin

    mattin Member

    Joined:
    Feb 10, 2013
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Bratislava, Slovakia
    cPanel Access Level:
    Root Administrator
    Twitter:
    Only SOA EXPIRE Your SOA EXPIRE number is: 3601. That is NOT OK.

    I managed to get functional autoconfig via hook in nginx configuration.

    Code:
    ###### To redirect autoconfig.yourdomain.com ###########################
    server {
    access_log off;
    error_log  logs/vhost-error_log warn;
    listen    80;
    server_name  autoconfig.* www.autoconfig.*;
    location / {
            client_max_body_size    10m;
            client_body_buffer_size 128k;
            proxy_send_timeout   90;
            proxy_read_timeout   90;
            proxy_buffer_size    4k;
            proxy_buffers     16 32k;
            proxy_busy_buffers_size 64k;
            proxy_temp_file_write_size 64k;
            proxy_connect_timeout 30s;
            proxy_redirect  http://www.autoconfig.*:8888   http://www.autoconfig.*;
            proxy_redirect  http://autoconfig.*:8888   http://autoconfig.*;
            proxy_pass   http://ip/cgi-sys/autoconfig.cgi/;
            }
    
    }
    
    now autoconfig works because I override apache proxy redirect and use direct url.

    autodiscover still redirect to cpanel... This is bug I think. I found this http://forums.cpanel.net/f5/autodiscover-dns-records-299412.html. There's path form cpanel staff, but it's from october 2012. Should I try it? Or it's already implemented in my version? I checked also domain SRV record and its pointing to cpanelemaildiscovery.cpanel.net.
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,453
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    You might want to open a ticket to cPanel on this for clarification.


    GL!
     
Loading...

Share This Page