sendmail: smtp: allow one to override the default mail author

In PBS, we obviously don't have "Proxmox VE" as a default sender, so
we need a mechanism to change the default author.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Lukas Wagner 2024-04-23 13:51:52 +02:00 committed by Thomas Lamprecht
parent 3a4432a6e4
commit f95fcc26b6
4 changed files with 12 additions and 2 deletions

View File

@ -52,11 +52,13 @@ Ext.define('Proxmox.Schema', { // a singleton
name: 'Sendmail', name: 'Sendmail',
ipanel: 'pmxSendmailEditPanel', ipanel: 'pmxSendmailEditPanel',
iconCls: 'fa-envelope-o', iconCls: 'fa-envelope-o',
defaultMailAuthor: 'Proxmox VE',
}, },
smtp: { smtp: {
name: 'SMTP', name: 'SMTP',
ipanel: 'pmxSmtpEditPanel', ipanel: 'pmxSmtpEditPanel',
iconCls: 'fa-envelope-o', iconCls: 'fa-envelope-o',
defaultMailAuthor: 'Proxmox VE',
}, },
gotify: { gotify: {
name: 'Gotify', name: 'Gotify',
@ -65,6 +67,13 @@ Ext.define('Proxmox.Schema', { // a singleton
}, },
}, },
// to add or change existing for product specific ones
overrideEndpointTypes: function(extra) {
for (const [key, value] of Object.entries(extra)) {
Proxmox.Schema.notificationEndpointTypes[key] = value;
}
},
pxarFileTypes: { pxarFileTypes: {
b: { icon: 'cube', label: gettext('Block Device') }, b: { icon: 'cube', label: gettext('Block Device') },
c: { icon: 'tty', label: gettext('Character Device') }, c: { icon: 'tty', label: gettext('Character Device') },

View File

@ -58,8 +58,8 @@ Ext.define('Proxmox.panel.SendmailEditPanel', {
fieldLabel: gettext('Author'), fieldLabel: gettext('Author'),
name: 'author', name: 'author',
allowBlank: true, allowBlank: true,
emptyText: 'Proxmox VE',
cbind: { cbind: {
emptyText: '{defaultMailAuthor}',
deleteEmpty: '{!isCreate}', deleteEmpty: '{!isCreate}',
}, },
}, },

View File

@ -161,8 +161,8 @@ Ext.define('Proxmox.panel.SmtpEditPanel', {
fieldLabel: gettext('Author'), fieldLabel: gettext('Author'),
name: 'author', name: 'author',
allowBlank: true, allowBlank: true,
emptyText: gettext('Proxmox VE'),
cbind: { cbind: {
emptyText: '{defaultMailAuthor}',
deleteEmpty: '{!isCreate}', deleteEmpty: '{!isCreate}',
}, },
}, },

View File

@ -45,6 +45,7 @@ Ext.define('Proxmox.window.EndpointEditBase', {
isCreate: me.isCreate, isCreate: me.isCreate,
baseUrl: me.baseUrl, baseUrl: me.baseUrl,
type: me.type, type: me.type,
defaultMailAuthor: endpointConfig.defaultMailAuthor,
}], }],
}); });