feat(mail): allow setting of mailer identifying name

pull/5698/head
Nicolas Giard 2 years ago
parent 5d0f882fed
commit 4bfd9f5280
No known key found for this signature in database
GPG Key ID: 85061B8F9D55B7C8

@ -13,6 +13,7 @@ module.exports = {
let conf = {
host: WIKI.config.mail.host,
port: WIKI.config.mail.port,
name: WIKI.config.mail.name,
secure: WIKI.config.mail.secure,
tls: {
rejectUnauthorized: !(WIKI.config.mail.verifySSL === false)

@ -389,6 +389,7 @@ exports.up = async knex => {
senderEmail: '',
host: '',
port: 465,
name: '',
secure: true,
verifySSL: true,
user: '',

@ -43,6 +43,7 @@ module.exports = {
senderEmail: args.senderEmail,
host: args.host,
port: args.port,
name: args.name,
secure: args.secure,
verifySSL: args.verifySSL,
user: args.user,

@ -16,6 +16,7 @@ extend type Mutation {
senderEmail: String!
host: String!
port: Int!
name: String!
secure: Boolean!
verifySSL: Boolean!
user: String!
@ -36,6 +37,7 @@ type MailConfig {
senderEmail: String
host: String
port: Int
name: String
secure: Boolean
verifySSL: Boolean
user: String

@ -16,9 +16,7 @@ module.exports = class Setting extends Model {
required: ['key'],
properties: {
key: {type: 'string'},
createdAt: {type: 'string'},
updatedAt: {type: 'string'}
key: {type: 'string'}
}
}
}
@ -27,13 +25,6 @@ module.exports = class Setting extends Model {
return ['value']
}
$beforeUpdate() {
this.updatedAt = new Date().toISOString()
}
$beforeInsert() {
this.updatedAt = new Date().toISOString()
}
static async getConfig() {
const settings = await WIKI.models.settings.query()
if (settings.length > 0) {

@ -1422,5 +1422,7 @@
"tags.selectOneMoreTags": "Select one or more tags",
"tags.selectOneMoreTagsHint": "Select one or more tags on the left.",
"admin.general.sitemapHint": "Make a sitemap.xml available to search engines with all pages accessible to guests.",
"admin.groups.usersNone": "This group doesn't have any user yet."
"admin.groups.usersNone": "This group doesn't have any user yet.",
"admin.mail.smtpName": "Client Identifying Name",
"admin.mail.smtpNameHint": "An optional name to send to the SMTP server to identify your mailer. Leave empty to use server hostname. For Google Workspace customers, this should be your main domain name."
}

@ -98,6 +98,20 @@ q-page.admin-mail
:aria-label='t(`admin.mail.smtpPort`)'
)
q-separator.q-my-sm(inset)
q-item
blueprint-icon(icon='server')
q-item-section
q-item-label {{t(`admin.mail.smtpName`)}}
q-item-label(caption) {{t(`admin.mail.smtpNameHint`)}}
q-item-section
q-input(
outlined
v-model='state.config.name'
dense
hide-bottom-space
:aria-label='t(`admin.mail.smtpName`)'
)
q-separator.q-my-sm(inset)
q-item(tag='label', v-ripple)
blueprint-icon(icon='secure')
q-item-section
@ -390,6 +404,7 @@ async function save () {
$senderEmail: String!
$host: String!
$port: Int!
$name: String!
$secure: Boolean!
$verifySSL: Boolean!
$user: String!
@ -404,6 +419,7 @@ async function save () {
senderEmail: $senderEmail
host: $host
port: $port
name: $name
secure: $secure
verifySSL: $verifySSL
user: $user
@ -413,7 +429,7 @@ async function save () {
dkimKeySelector: $dkimKeySelector
dkimPrivateKey: $dkimPrivateKey
) {
status {
operation {
succeeded
slug
message
@ -426,6 +442,7 @@ async function save () {
senderEmail: state.config.senderEmail || '',
host: state.config.host || '',
port: toSafeInteger(state.config.port) || 0,
name: state.config.name || '',
secure: state.config.secure ?? false,
verifySSL: state.config.verifySSL ?? false,
user: state.config.user || '',

Loading…
Cancel
Save