fix: Mail server configuration cannot be performed when the domain name does not have a built-in template.

Create a fallback template. When the built-in template corresponding to the domain name cannot be found, use the fallback template to configure the server.
This commit is contained in:
xml 2024-09-06 11:05:43 +08:00
parent 56f581ff46
commit 95567b5503

View file

@ -152,8 +152,14 @@ export async function expandAccountWithCommonSettings(account: Account) {
}
console.log(`Using Mailspring Template: ${JSON.stringify(mstemplate, null, 2)}`);
} else {
console.log(`Using Empty Template`);
mstemplate = {};
console.log(`Using Fallback Template`);
mstemplate = {
"imap_host": `imap.${domain}`,
"imap_user_format": "email",
"smtp_host": `smtp.${domain}`,
"smtp_user_format": "email",
"container_folder": "",
};
}
let imap_port = Number(mstemplate.imap_port);