From 09eef645144f6d928f2b79a55b3cbef84f8b281c Mon Sep 17 00:00:00 2001 From: Xavier Michelon Date: Wed, 21 Jun 2023 10:21:19 +0200 Subject: [PATCH] feat(GODT-2703): got rid of account details dialog with Apple Mail autoconf. --- internal/clientconfig/applemail.go | 8 +++++--- pkg/mobileconfig/config.go | 1 + pkg/mobileconfig/template.go | 4 ++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/internal/clientconfig/applemail.go b/internal/clientconfig/applemail.go index 1a16fdb5..4d8c3626 100644 --- a/internal/clientconfig/applemail.go +++ b/internal/clientconfig/applemail.go @@ -70,9 +70,11 @@ func prepareMobileConfig( password []byte, ) *mobileconfig.Config { return &mobileconfig.Config{ - DisplayName: username, - EmailAddress: addresses, - Identifier: "protonmail " + username + strconv.FormatInt(time.Now().Unix(), 10), + DisplayName: username, + EmailAddress: addresses, + AccountName: username, + AccountDescription: username, + Identifier: "protonmail " + username + strconv.FormatInt(time.Now().Unix(), 10), IMAP: &mobileconfig.IMAP{ Hostname: hostname, Port: imapPort, diff --git a/pkg/mobileconfig/config.go b/pkg/mobileconfig/config.go index 6c0f4e53..bf21d9f9 100644 --- a/pkg/mobileconfig/config.go +++ b/pkg/mobileconfig/config.go @@ -30,6 +30,7 @@ type Config struct { DisplayName string Identifier string Organization string + AccountName string AccountDescription string IMAP *IMAP diff --git a/pkg/mobileconfig/template.go b/pkg/mobileconfig/template.go index 8ff11aff..be80f555 100644 --- a/pkg/mobileconfig/template.go +++ b/pkg/mobileconfig/template.go @@ -24,6 +24,10 @@ const mailTemplate = ` PayloadContent + {{- if .AccountName}} + EmailAccountName + {{.AccountName}} + {{- end}} {{- if .AccountDescription}} EmailAccountDescription {{.AccountDescription}}