@@ -7,6 +7,11 @@ const validator = require('validator');
7
7
const url = require ( 'url' ) ;
8
8
9
9
const BASE_PORT = '2368' ;
10
+ const knownMailServices = [
11
+ 'AOL' , 'DynectEmail' , 'Gmail' , 'hot.ee' , 'Hotmail' , 'iCloud' , 'mail.ee' , 'Mail.Ru' , 'Mailgun' ,
12
+ 'Mailjet' , 'Mandrill' , 'Postmark' , 'QQ' , 'QQex (Tencent Business Email)' , 'SendGrid' ,
13
+ 'SendCloud' , 'SES' , 'Yahoo' , 'yandex' , 'Zoho'
14
+ ] ;
10
15
11
16
/*
12
17
Note: these options are handled serially, i.e. one after the other.
@@ -58,6 +63,8 @@ module.exports = {
58
63
defaultValue : ( c , env ) => env === 'production' ? 'systemd' : 'local' ,
59
64
type : 'string'
60
65
} ,
66
+
67
+ // Database options
61
68
db : {
62
69
description : 'Type of database Ghost should use' ,
63
70
validate : value => includes ( [ 'sqlite3' , 'mysql' ] , value ) ,
@@ -89,6 +96,45 @@ module.exports = {
89
96
configPath : 'database.connection.database' ,
90
97
type : 'string'
91
98
} ,
99
+
100
+ // Mail options:
101
+ // Designed to support the most common mail configs, more advanced configs will require editing the config file
102
+ mail : {
103
+ description : 'Mail transport, E.g SMTP, Sendmail or Direct' ,
104
+ validate : value => includes ( [ 'SMTP' , 'Sendmail' , 'Direct' ] , value ) ,
105
+ configPath : 'mail.transport' ,
106
+ type : 'string' ,
107
+ default : 'Direct'
108
+ } ,
109
+ mailservice : {
110
+ description : 'Mail service (used with SMTP transport), E.g. Mailgun, Sendgrid, Gmail, SES...' ,
111
+ configPath : 'mail.options.service' ,
112
+ validate : value => includes ( knownMailServices , value ) ,
113
+ type : 'string'
114
+ } ,
115
+ mailuser : {
116
+ description : 'Mail auth user (used with SMTP transport)' ,
117
+ configPath : 'mail.options.auth.user' ,
118
+ type : 'string' ,
119
+ implies : 'mailpass'
120
+ } ,
121
+ mailpass : {
122
+ description : 'Mail auth pass (used with SMTP transport)' ,
123
+ configPath : 'mail.options.auth.pass' ,
124
+ type : 'string' ,
125
+ implies : 'mailuser'
126
+ } ,
127
+ mailhost : {
128
+ description : 'Mail host (used with SMTP transport)' ,
129
+ configPath : 'mail.options.host' ,
130
+ type : 'string'
131
+ } ,
132
+ mailport : {
133
+ description : 'Mail port (used with SMTP transport)' ,
134
+ configPath : 'mail.options.port' ,
135
+ type : 'number'
136
+ } ,
137
+
92
138
sslemail : {
93
139
description : 'SSL email address' ,
94
140
configPath : 'ssl.email' ,
0 commit comments