[pmg-devel] [PATCH v2 pmg-gui] Feature #2438 add support for lmtp delivery to downstream servers

Stoiko Ivanov s.ivanov at proxmox.com
Wed Jan 8 20:38:40 CET 2020


On Sun,  5 Jan 2020 15:53:09 +0100
Julian Zehnter <pmg-devel at j-z.it> wrote:

> new feature lmtp support for simplifying setups
> with lmtp capable downstream servers (e.g. dovecot)
> Postfix support lmtp out of the box and can now deliver
> mails directly to internal mailbox servers without
> one more smtp connection
> 
> extending the gui code for new lmtp option:
> MailProxyConfiguration & MailProxyConfiguration:Transport:
> Adding combobox "smtp" / "lmtp" as a new option
> Generalizing some "SMTP" keywords
> 
> Signed-off-by: Julian Zehnter <pmg-devel at j-z.it>
> ---
>  js/MailProxyRelaying.js | 18 +++++++++++++-----
>  js/Transport.js         | 24 +++++++++++++++++++++---
>  2 files changed, 34 insertions(+), 8 deletions(-)
> 
> diff --git a/js/MailProxyRelaying.js b/js/MailProxyRelaying.js
> index 1856130..5403836 100644
> --- a/js/MailProxyRelaying.js
> +++ b/js/MailProxyRelaying.js
> @@ -4,18 +4,26 @@ Ext.define('PMG.MailProxyRelaying', {
>      alias: ['widget.pmgMailProxyRelaying'],
>  
>      monStoreErrors: true,
> -    
> + 
cosmetic: this introduces a whitespace error on applying
if possible don't add such hunks (for future contributions)
I like using `git add -p` to select what to commit)

>      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 });
>  
> -	me.add_boolean_row('relaynomx', gettext('Disable MX lookup'));
> +	me.add_combobox_row('relayprotocol', gettext('Relay Protocol'), {
> +		defaultValue: 'smtp',
> +		comboItems: [
> +		['smtp', 'SMTP' ],
> +		['lmtp', 'LMTP' ]]
> +	});
> +
> +
> +	me.add_boolean_row('relaynomx', gettext('Disable MX lookup (SMTP)'));
>  
>  	me.rows.smarthost = {
>  	    required: true,
> diff --git a/js/Transport.js b/js/Transport.js
> index c721da3..2571a4a 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',
> @@ -57,7 +69,7 @@ Ext.define('PMG.Transport', {
>  		name: 'use_mx',
>  		checked: true,
>  		uncheckedValue: 0,
> -		fieldLabel: gettext("Use MX")
> +		fieldLabel: gettext("Use MX (SMTP)")
here it would be beneficial to split it up like so:
gettext("Use MX") + " (SMTP)"
that would keep existing translations working
(since we would not translate SMTP anyways)

>  	    },
>  	    {
>  		xtype: 'textfield',
> @@ -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,
> @@ -159,7 +177,7 @@ Ext.define('PMG.Transport', {
>  		    dataIndex: 'port'
>  		},
>  		{
> -		    header: gettext('Use MX'),
> +		    header: gettext('Use MX (SMTP)'),
nit/suggestion: maybe don't add the '(SMTP)' for the column header
(might give users with smaller screens a better overview) ?
>  		    width: 80,
>  		    renderer: Proxmox.Utils.format_boolean,
>  		    sortable: false,


Reviewed-By: Stoiko Ivanov <s.ivanov at proxmox.com>
Tested-By: Stoiko Ivanov <s.ivanov at proxmox.com>



More information about the pmg-devel mailing list