[pmg-devel] [PATCH] gui: add lmtp support

Julian Zehnter pmg-devel at j-z.it
Mon Dec 9 21:42:33 CET 2019


Signed-off-by: Julian Zehnter <pmg-devel at j-z.it>
---
 js/MailProxyRelaying.js | 26 ++++++++++++++++++++++----
 js/Transport.js         | 20 +++++++++++++++++++-
 2 files changed, 41 insertions(+), 5 deletions(-)

diff --git a/js/MailProxyRelaying.js b/js/MailProxyRelaying.js
index 1856130..7d82443 100644
--- a/js/MailProxyRelaying.js
+++ b/js/MailProxyRelaying.js
@@ -4,16 +4,34 @@ Ext.define('PMG.MailProxyRelaying', {
     alias: ['widget.pmgMailProxyRelaying'],
 
     monStoreErrors: true,
-    
+ 
+    transportprotocolTextHash: {
+		'smtp': gettext('SMTP'),
+		'lmtp': gettext('LMTP')
+	},
+		
     initComponent : function() {
 	var me = this;
 
 	me.add_text_row('relay', gettext('Default Relay'),
 			{ deleteEmpty: true, defaultValue: Proxmox.Utils.noneText });
 
-	me.add_integer_row('relayport', gettext('SMTP Port'),
-			   { defaultValue: 25, deleteEmpty: true,
-			     minValue: 1, maxValue: 65535 });
+	me.add_integer_row('relayport', gettext('Relay Port'),
+		{ defaultValue: 25, deleteEmpty: true,
+			minValue: 1, maxValue: 65535 });
+
+	var render_transportprotocol = function(value) {
+		return me.transportprotocolTextHash[value] || value;
+	};
+
+	me.add_combobox_row('transportprotocol', gettext('Transport Protocol'), {
+		defaultValue: 'smtp',
+		renderer: render_transportprotocol,
+		comboItems: [
+		['smtp', render_transportprotocol('smtp') ],
+		['lmtp', render_transportprotocol('lmtp') ]]
+	});
+
 
 	me.add_boolean_row('relaynomx', gettext('Disable MX lookup'));
 
diff --git a/js/Transport.js b/js/Transport.js
index c721da3..ceee64b 100644
--- a/js/Transport.js
+++ b/js/Transport.js
@@ -1,7 +1,7 @@
 /*global Proxmox*/
 Ext.define('pmg-transport', {
     extend: 'Ext.data.Model',
-    fields: [ 'domain', 'host', { name: 'port', type: 'integer' },
+    fields: [ 'domain', 'host',  'protocol', { name: 'port', type: 'integer' },
 	      { name: 'use_mx', type: 'boolean' }, 'comment' ],
     proxy: {
         type: 'proxmox',
@@ -44,6 +44,18 @@ Ext.define('PMG.Transport', {
 		name: 'host',
 		fieldLabel: gettext("Host")
 	    },
+	    {
+		xtype: 'proxmoxKVComboBox',
+		name: 'protocol',
+		fieldLabel: gettext('Protocol'),
+		deleteEmpty: false,
+		comboItems: [
+			[ 'smtp', 'SMTP' ],
+			[ 'lmtp', 'LMTP' ]
+		],
+		allowBlank: true,
+		value: 'smtp'
+		},
 	    {
 		xtype: 'proxmoxintegerfield',
 		name: 'port',
@@ -152,6 +164,12 @@ Ext.define('PMG.Transport', {
 		    sortable: true,
 		    dataIndex: 'host'
 		},
+		{
+		    header: gettext('Protocol'),
+		    width: 200,
+		    sortable: true,
+		    dataIndex: 'protocol'
+		},
 		{
 		    header: gettext('Port'),
 		    width: 80,
-- 
2.23.0.windows.1



More information about the pmg-devel mailing list