Skip to content

Commit

Permalink
feat: added ssl property based on socket
Browse files Browse the repository at this point in the history
Signed-off-by: madmath03 <[email protected]>
  • Loading branch information
madmath03 committed Feb 3, 2024
1 parent d5b3a34 commit 01e90a7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
9 changes: 8 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,21 @@ function *autodiscover() {
const popenc = settings.pop.socket === "STARTTLS" ? "TLS" : settings.pop.socket;
const smtpenc = settings.smtp.socket === "STARTTLS" ? "TLS" : settings.smtp.socket;

const imapssl = settings.imap.socket === "SSL" ? "on" : "off";
const popssl = settings.pop.socket === "SSL" ? "on" : "off";
const smtpssl = settings.smtp.socket === "SSL" ? "on" : "off";

yield this.render("autodiscover", {
schema: xmlns,
email,
username,
domain,
imapenc,
popenc,
smtpenc
smtpenc,
imapssl,
popssl,
smtpssl
});
}

Expand Down
6 changes: 3 additions & 3 deletions views/autodiscover.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<DomainRequired>on</DomainRequired>
<DomainName>{{domain}}</DomainName>
<SPA>on</SPA>
<SSL>on</SSL>
<SSL>{{imapssl}}</SSL>
<Encryption>{{imapenc}}</Encryption>
<AuthRequired>on</AuthRequired>
</Protocol>
Expand All @@ -34,7 +34,7 @@
<DomainRequired>on</DomainRequired>
<DomainName>{{domain}}</DomainName>
<SPA>on</SPA>
<SSL>on</SSL>
<SSL>{{popssl}}</SSL>
<Encryption>{{popenc}}</Encryption>
<AuthRequired>on</AuthRequired>
</Protocol>
Expand All @@ -48,7 +48,7 @@
<DomainRequired>on</DomainRequired>
<DomainName>{{domain}}</DomainName>
<SPA>on</SPA>
<SSL>on</SSL>
<SSL>{{smtpssl}}</SSL>
<Encryption>{{smtpenc}}</Encryption>
<AuthRequired>on</AuthRequired>
</Protocol>
Expand Down

0 comments on commit 01e90a7

Please sign in to comment.