• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Issue Mail AutoConfig not working, returns 400 Bad Request

TimReeves

Regular Pleskian
This new feature is attractive, so I wanted to activate it. I did, but Thunderbird was obviously not getting the data.
I debugged the feature, trying to call the URL which Thunderbird would use: 400 Bad Request.

I tried this on 2 different servers, one with an external FW in front of it, the other just a normal vServer at a major hoster. Same in both cases.

Both servers run debian 9 and have Plesk Web Admin Edition - could that be a problem?

I do use custom/domain templates (mainly to get rid of all that unused Apache Config), so I tried reconfiguring using the default templates, and temp. removing my extra Nginx config - still the same problem. I don't know how to move forward.

Here is the relevant nginx config as generated:

# mailconfig
location ~* ^/autodiscover/autodiscover\.xml$ {
try_files $uri @mad;
}
location ~* ^(/\.well-known/autoconfig)?/mail/config\-v1\.1\.xml$ {
try_files $uri @mad;
}
location @mad {
rewrite ^(.*)$ /mailconfig/ break;

proxy_pass http://127.0.0.1:8880;
proxy_set_header X-Host $host;
proxy_set_header X-Request-URI $request_uri;
}
# mailconfig

My "Apache & nginx Settings" have ALL the checkboxes for Nginx OFF.

Help would be much appreciated!
 
Well now I'm bamboozled: I tried adding a new account in Thunderbird anyway, and it looked like TB had got the data. So I checked the TB console log, and yes:

2019-11-07 18:21:57 mail.setup INFO call 1 took 130ms and succeeded at <https://(redacted).space/autodiscover/autodiscover.xml>
2019-11-07 18:21:57 mail.setup INFO call 1 took 141ms and succeeded at <http://(redacted).space/.well-known/autoconfig/mail/config-v1.1.xml>
2019-11-07 18:21:57 mail.setup INFO status msg: Einstellungen wurden bei Ihrem Anbieter des E-Mail-Diensts gefunden

The exactly same URLs (copy-paste) entered in a Browser (FF and Chromium) fail with "400 Bad Request".

Obviously there is something happening here that I'm missing - can someone please enlighten me?

Thanks,
Tim
 
I have the problem too with Plesk Obsidian 18.0.24

Every check returns Error 400 (not 404), I have tried:

- Direct access
- Thunderbird
- Outlook
- Microsoft Remote Connectivity Analyzer

I have activated debug log and is this:

[Wed Mar 11 11:14:31.808548 2020] [ssl:debug] [pid 6902] ssl_engine_kernel.c(366): [client *.*.*.*:53914] AH02034: Initial (No.1) HTTPS request received for child 0 (server ***.com:443)
[Wed Mar 11 11:14:31.808685 2020] [authz_core:debug] [pid 6902] mod_authz_core.c(835): [client *.*.*.*:53914] AH01628: authorization result: granted (no directives)
[Wed Mar 11 11:14:31.808768 2020] [proxy:debug] [pid 6902] mod_proxy.c(1229): [client *.*.*.*:53914] AH01143: Running scheme http handler (attempt 0)
[Wed Mar 11 11:14:31.808788 2020] [proxy_fcgi:debug] [pid 6902] mod_proxy_fcgi.c(913): [client *.*.*.*:53914] AH01076: url: http://127.0.0.1:8880/mailconfig/[email protected] proxyname: (null) proxyport: 0
[Wed Mar 11 11:14:31.808801 2020] [proxy_fcgi:debug] [pid 6902] mod_proxy_fcgi.c(916): [client *.*.*.*:53914] AH01077: declining URL http://127.0.0.1:8880/mailconfig/[email protected]
[Wed Mar 11 11:14:31.808812 2020] [proxy:debug] [pid 6902] proxy_util.c(2153): AH00942: HTTP: has acquired connection for (*)
[Wed Mar 11 11:14:31.808827 2020] [proxy:debug] [pid 6902] proxy_util.c(2206): [client *.*.*.*:53914] AH00944: connecting http://127.0.0.1:8880/mailconfig/[email protected] to 127.0.0.1:8880
[Wed Mar 11 11:14:31.808940 2020] [proxy:debug] [pid 6902] proxy_util.c(2415): [client *.*.*.*:53914] AH00947: connected /mailconfig/?emailaddress=[email protected] to 127.0.0.1:8880
[Wed Mar 11 11:14:31.809186 2020] [proxy:debug] [pid 6902] proxy_util.c(2881): AH02824: HTTP: connection established with 127.0.0.1:8880 (*)
[Wed Mar 11 11:14:31.809223 2020] [proxy:debug] [pid 6902] proxy_util.c(3048): AH00962: HTTP: connection complete to 127.0.0.1:8880 (127.0.0.1)
[Wed Mar 11 11:14:31.817283 2020] [proxy:debug] [pid 6902] proxy_util.c(2168): AH00943: *: has released connection for (*)
[Wed Mar 11 11:14:31.817301 2020] [proxy:debug] [pid 6902] proxy_util.c(2988): [remote 127.0.0.1:8880] AH02642: proxy: connection shutdown
[Wed Mar 11 11:14:31.817395 2020] [ssl:debug] [pid 6902] ssl_engine_io.c(1044): [client *.*.*.*:53914] AH02001: Connection closed to child 0 with standard shutdown (server ***.com:443)
 
I have the same problem on our servers. Already removed the clientConfig lines from the panel.ini and tried 'plesk repair' on web, mail and installation.

When I send a test XML directly to the process at 127.0.0.1:8880 I get the same error 400 Bad Request:

test.xml

XML:
<?xml version="1.0" encoding="utf-8"?>
<Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/mobilesync/requestschema/2006">
<Request>
<EMailAddress>[email protected]</EMailAddress>
<AcceptableResponseSchema>http://schemas.microsoft.com/exchange/autodiscover/mobilesync/responseschema/2006</AcceptableResponseSchema>
</Request>
</Autodiscover>

Bash:
curl -X POST -k -v -d @test.xml http://127.0.0.1:8880/Autodiscover/Autodiscover.xml

HTML:
* About to connect() to 127.0.0.1 port 8880 (#0)
*   Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 8880 (#0)
> Post /Autodiscover/Autodiscover.xml HTTP/1.1
> User-Agent: curl/7.29.0
> Host: 127.0.0.1:8880
> Accept: */*
> Content-Length: 361
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 361 out of 361 bytes
< HTTP/1.1 400 Bad Request
< Server: sw-cp-server
< Date: Sat, 28 Mar 2020 07:55:33 GMT
< Content-Type: text/html
< Content-Length: 915
< Connection: close
< ETag: "5e7b5aa8-393"
<
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>400 Bad Request</title>
    <link rel="shortcut icon" href="/favicon.ico">
    <link rel="stylesheet" href="/ui-library/plesk-ui-library.css?3.5.0">
    <script type="text/javascript" src="/ui-library/plesk-ui-library.min.js?3.5.0"></script>
    <script type="text/javascript" src="/cp/javascript/vendors.js"></script>
    <script type="text/javascript" src="/cp/javascript/main.js"></script>
    <script type="text/javascript" src="/error_docs/uat.js?v1"></script>
<link href="/error_docs/app.css" rel="stylesheet"></head>
<body>
<div id="app"></div>
<script>window.__INITIAL_DATA__ = {"code":"400","message":"Bad Request"}</script>
<script type="text/javascript" src="/error_docs/app.js?89d33edd4917eae77067"></script></body>
</html>
* Closing connection 0
 
I solved it on our end by going to Tools & Settings > Mail > Outgoing mail control > Server-wilde settings > Change settings. There I cleared the custom domain and checked Reconfigure DNS.

My guess is this somehow rebuilt the autodiscover config for the proxy, or there is a problem with custom domain configuration.
 
Back
Top