Skip to content

Commit d0225f8

Browse files
ErisDSacburdine
authored andcommitted
fix(config): 🐛 don't enforce case for mail config
closes #421 - uses toLowerCase() and lists all config options in lowercase
1 parent 79100ee commit d0225f8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/commands/config/advanced.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ const url = require('url');
88

99
const BASE_PORT = '2368';
1010
const knownMailServices = [
11-
'AOL', 'DynectEmail', 'FastMail', 'Gmail', 'GoDaddy', 'GoDaddyAsia', 'GoDaddyEurope', 'hot.ee', 'Hotmail', 'iCloud',
12-
'mail.ee', 'Mail.Ru', 'Mailgun', 'Mailjet', 'Mandrill', 'Postmark', 'QQ', 'QQex', 'SendGrid',
13-
'SendCloud', 'SES', 'Yahoo', 'yandex', 'Zoho'
11+
'aol', 'dynectemail', 'fastmail', 'gmail', 'godaddy', 'godaddyasia', 'godaddyeurope', 'hot.ee', 'hotmail', 'icloud',
12+
'mail.ee', 'mail.ru', 'mailgun', 'mailjet', 'mandrill', 'postmark', 'qq', 'qqex', 'sendgrid',
13+
'sendcloud', 'ses', 'yahoo', 'yandex', 'zoho'
1414
];
1515

1616
/*
@@ -119,7 +119,7 @@ module.exports = {
119119
// Designed to support the most common mail configs, more advanced configs will require editing the config file
120120
mail: {
121121
description: 'Mail transport, E.g SMTP, Sendmail or Direct',
122-
validate: value => includes(['SMTP', 'Sendmail', 'Direct'], value) || 'Invalid mail transport',
122+
validate: value => includes(['smtp', 'sendmail', 'direct'], value.toLowerCase()) || 'Invalid mail transport',
123123
configPath: 'mail.transport',
124124
type: 'string',
125125
default: 'Direct',
@@ -128,7 +128,7 @@ module.exports = {
128128
mailservice: {
129129
description: 'Mail service (used with SMTP transport), E.g. Mailgun, Sendgrid, Gmail, SES...',
130130
configPath: 'mail.options.service',
131-
validate: value => includes(knownMailServices, value) || 'Invalid mail service',
131+
validate: value => includes(knownMailServices, value.toLowerCase()) || 'Invalid mail service',
132132
type: 'string',
133133
group: 'Mail Options:'
134134
},

0 commit comments

Comments
 (0)