Skip to content

Commit

Permalink
fix(config): 🐛 don't enforce case for mail config
Browse files Browse the repository at this point in the history
closes TryGhost#421

- uses toLowerCase() and lists all config options in lowercase
  • Loading branch information
ErisDS committed Aug 3, 2017
1 parent 2f1fcc6 commit 8113cb9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/commands/config/advanced.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ const url = require('url');

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

/*
Expand Down Expand Up @@ -119,7 +119,7 @@ module.exports = {
// Designed to support the most common mail configs, more advanced configs will require editing the config file
mail: {
description: 'Mail transport, E.g SMTP, Sendmail or Direct',
validate: value => includes(['SMTP', 'Sendmail', 'Direct'], value) || 'Invalid mail transport',
validate: value => includes(['smtp', 'sendmail', 'direct'], value.toLowerCase()) || 'Invalid mail transport',
configPath: 'mail.transport',
type: 'string',
default: 'Direct',
Expand All @@ -128,7 +128,7 @@ module.exports = {
mailservice: {
description: 'Mail service (used with SMTP transport), E.g. Mailgun, Sendgrid, Gmail, SES...',
configPath: 'mail.options.service',
validate: value => includes(knownMailServices, value) || 'Invalid mail service',
validate: value => includes(knownMailServices, value.toLowerCase()) || 'Invalid mail service',
type: 'string',
group: 'Mail Options:'
},
Expand Down

0 comments on commit 8113cb9

Please sign in to comment.