Added domain autconfig detection of @benbucksch

https://datatracker.ietf.org/doc/draft-bucksch-autoconfig/
This commit is contained in:
the-djmaze 2024-02-05 19:56:58 +01:00
parent d4cdfb8fa5
commit 5e0d52b9e7
5 changed files with 158 additions and 0 deletions

View file

@ -306,6 +306,28 @@ export class DomainPopupView extends AbstractViewPopup {
this.testingSmtpError(false);
}
autoconfig() {
let domain = this.name();
Remote.request('AdminDomainAutoconfig', (iError, oData) => {
console.dir({iError, oData});
if (!iError) {
let server = oData.Result.config.incomingServer[0];
this.imapHost(server.hostname);
this.imapPort(server.port);
this.imapType('STARTTLS' === server.socketType ? 2 : ('SSL' === server.socketType ? 1 : 0));
this.imapShortLogin('%EMAILADDRESS%' !== server.username);
server = oData.Result.config.outgoingServer[0];
this.smtpHost(server.hostname);
this.smtpPort(server.port);
this.smtpType('STARTTLS' === server.socketType ? 2 : ('SSL' === server.socketType ? 1 : 0));
this.smtpShortLogin('%EMAILADDRESS%' !== server.username);
this.smtpUseAuth(!!server.authentication);
this.smtpUsePhpMail(false);
}
}, {domain});
}
onShow(oDomain) {
this.saving(false);
this.clearTesting();