Update autoconfig - step 2, apply updates from Thunderbird ISPDB

This commit is contained in:
Ben Gotow 2024-06-02 18:06:40 -05:00
parent 9b2c55b4cb
commit 6c3993aa93
3 changed files with 1060 additions and 286 deletions

View file

@ -17,9 +17,9 @@
], ],
"smtp": [ "smtp": [
{ {
"port": 587, "port": 465,
"hostname": "smtp.pobox.com", "hostname": "smtp.pobox.com",
"starttls": true "ssl": true
} }
] ]
}, },
@ -86,20 +86,10 @@
} }
], ],
"smtp": [ "smtp": [
{
"port": 587,
"hostname": "smtp.mail.com",
"ssl": true
},
{ {
"port": 465, "port": 465,
"hostname": "smtp.mail.com", "hostname": "smtp.mail.com",
"ssl": true "ssl": true
},
{
"port": 25,
"hostname": "smtp.mail.com",
"ssl": true
} }
] ]
}, },
@ -355,16 +345,16 @@
} }
], ],
"smtp": [ "smtp": [
{
"port": 587,
"hostname": "smtp.aol.com",
"starttls": true
},
{ {
"port": 465, "port": 465,
"hostname": "smtp.aol.com", "hostname": "smtp.aol.com",
"ssl": true "ssl": true
}, },
{
"port": 587,
"hostname": "smtp.aol.com",
"starttls": true
},
{ {
"port": 25, "port": 25,
"hostname": "smtp.aol.com", "hostname": "smtp.aol.com",
@ -964,9 +954,9 @@
"servers": { "servers": {
"imap": [ "imap": [
{ {
"port": 143, "port": 993,
"hostname": "imap.openmailbox.org", "hostname": "imap.openmailbox.org",
"starttls": true "ssl": true
} }
], ],
"smtp": [ "smtp": [
@ -989,11 +979,6 @@
"mailru": { "mailru": {
"servers": { "servers": {
"imap": [ "imap": [
{
"port": 143,
"hostname": "imap.mail.ru",
"starttls": true
},
{ {
"port": 993, "port": 993,
"hostname": "imap.mail.ru", "hostname": "imap.mail.ru",

View file

@ -125,14 +125,14 @@ export async function expandAccountWithCommonSettings(account: Account) {
imap_port: imap.port, imap_port: imap.port,
imap_username: usernameWithFormat('email'), imap_username: usernameWithFormat('email'),
imap_password: populated.settings.imap_password, imap_password: populated.settings.imap_password,
imap_security: imap.starttls ? 'STARTTLS' : imap.ssl ? 'SSL / TLS' : 'none', imap_security: imap.starttls ? 'STARTTLS' : imap.ssl || imap.tls ? 'SSL / TLS' : 'none',
imap_allow_insecure_ssl: false, imap_allow_insecure_ssl: false,
smtp_host: (smtp.hostname || '').replace('{domain}', domain), smtp_host: (smtp.hostname || '').replace('{domain}', domain),
smtp_port: smtp.port, smtp_port: smtp.port,
smtp_username: usernameWithFormat('email'), smtp_username: usernameWithFormat('email'),
smtp_password: populated.settings.smtp_password || populated.settings.imap_password, smtp_password: populated.settings.smtp_password || populated.settings.imap_password,
smtp_security: smtp.starttls ? 'STARTTLS' : smtp.ssl ? 'SSL / TLS' : 'none', smtp_security: smtp.starttls ? 'STARTTLS' : smtp.ssl || smtp.tls ? 'SSL / TLS' : 'none',
smtp_allow_insecure_ssl: false, smtp_allow_insecure_ssl: false,
container_folder: '', container_folder: '',
@ -156,18 +156,40 @@ export async function expandAccountWithCommonSettings(account: Account) {
mstemplate = {}; mstemplate = {};
} }
let imap_port = Number(mstemplate.imap_port);
let imap_security = mstemplate.imap_security;
if (!imap_security && !imap_port) {
imap_security = 'SSL / TLS';
imap_port = 993;
} else if (!imap_security && imap_port) {
imap_security = imap_port === 993 ? 'SSL / TLS' : 'none';
} else if (imap_security && !imap_port) {
imap_port = imap_security === 'SSL / TLS' ? 993 : 143;
}
let smtp_port = Number(mstemplate.smtp_port);
let smtp_security = mstemplate.smtp_security;
if (!smtp_security && !smtp_port) {
smtp_security = 'SSL / TLS';
smtp_port = 465;
} else if (!smtp_security && smtp_port) {
smtp_security = smtp_port === 587 ? 'STARTTLS' : smtp_port === 465 ? 'SSL / TLS' : 'none';
} else if (smtp_security && !smtp_port) {
smtp_port = smtp_security === 'STARTTLS' ? 587 : smtp_security === 'SSL / TLS' ? 465 : 25;
}
const defaults = { const defaults = {
imap_host: mstemplate.imap_host, imap_host: mstemplate.imap_host.replace('%EMAILDOMAIN%', domain),
imap_port: mstemplate.imap_port || 993, imap_port: imap_port,
imap_username: usernameWithFormat(mstemplate.imap_user_format), imap_username: usernameWithFormat(mstemplate.imap_user_format),
imap_password: populated.settings.imap_password, imap_password: populated.settings.imap_password,
imap_security: mstemplate.imap_security || 'SSL / TLS', imap_security: imap_security,
imap_allow_insecure_ssl: mstemplate.imap_allow_insecure_ssl || false, imap_allow_insecure_ssl: mstemplate.imap_allow_insecure_ssl || false,
smtp_host: mstemplate.smtp_host, smtp_host: mstemplate.smtp_host.replace('%EMAILDOMAIN%', domain),
smtp_port: mstemplate.smtp_port || 465, smtp_port: smtp_port,
smtp_username: usernameWithFormat(mstemplate.smtp_user_format), smtp_username: usernameWithFormat(mstemplate.smtp_user_format),
smtp_password: populated.settings.smtp_password || populated.settings.imap_password, smtp_password: populated.settings.smtp_password || populated.settings.imap_password,
smtp_security: mstemplate.smtp_security || 'SSL / TLS', smtp_security: smtp_security,
smtp_allow_insecure_ssl: mstemplate.smtp_allow_insecure_ssl || false, smtp_allow_insecure_ssl: mstemplate.smtp_allow_insecure_ssl || false,
container_folder: mstemplate.container_folder, container_folder: mstemplate.container_folder,
}; };