mail/postfix: domain masq and bcc maps (#1025)

This commit is contained in:
Michael
2018-11-28 07:57:02 +01:00
committed by Franco Fichtner
parent 3ee1ce7fb8
commit 9068502091
25 changed files with 606 additions and 115 deletions
@@ -0,0 +1,67 @@
<?php
/*
* Copyright (C) 2018 Michael Muenz <m.muenz@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
namespace OPNsense\Postfix\Api;
use \OPNsense\Base\ApiMutableModelControllerBase;
class RecipientbccController extends ApiMutableModelControllerBase
{
static protected $internalModelName = 'recipientbcc';
static protected $internalModelClass = '\OPNsense\Postfix\Recipientbcc';
public function searchRecipientbccAction()
{
return $this->searchBase('recipientbccs.recipientbcc', array("enabled", "from", "to"));
}
public function getRecipientbccAction($uuid = null)
{
return $this->getBase('recipientbcc', 'recipientbccs.recipientbcc', $uuid);
}
public function addRecipientbccAction()
{
return $this->addBase('recipientbcc', 'recipientbccs.recipientbcc');
}
public function delRecipientbccAction($uuid)
{
return $this->delBase('recipientbccs.recipientbcc', $uuid);
}
public function setRecipientbccAction($uuid)
{
return $this->setBase('recipientbcc', 'recipientbccs.recipientbcc', $uuid);
}
public function toggleRecipientbccAction($uuid)
{
return $this->toggleBase('recipientbccs.recipientbcc', $uuid);
}
}
@@ -0,0 +1,67 @@
<?php
/*
* Copyright (C) 2018 Michael Muenz <m.muenz@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
namespace OPNsense\Postfix\Api;
use \OPNsense\Base\ApiMutableModelControllerBase;
class SenderbccController extends ApiMutableModelControllerBase
{
static protected $internalModelName = 'senderbcc';
static protected $internalModelClass = '\OPNsense\Postfix\Senderbcc';
public function searchSenderbccAction()
{
return $this->searchBase('senderbccs.senderbcc', array("enabled", "from", "to"));
}
public function getSenderbccAction($uuid = null)
{
return $this->getBase('senderbcc', 'senderbccs.senderbcc', $uuid);
}
public function addSenderbccAction()
{
return $this->addBase('senderbcc', 'senderbccs.senderbcc');
}
public function delSenderbccAction($uuid)
{
return $this->delBase('senderbccs.senderbcc', $uuid);
}
public function setSenderbccAction($uuid)
{
return $this->setBase('senderbcc', 'senderbccs.senderbcc', $uuid);
}
public function toggleSenderbccAction($uuid)
{
return $this->toggleBase('senderbccs.senderbcc', $uuid);
}
}
@@ -0,0 +1,38 @@
<?php
/*
* Copyright (C) 2018 Michael Muenz <m.muenz@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
namespace OPNsense\Postfix;
class RecipientbccController extends \OPNsense\Base\IndexController
{
public function indexAction()
{
$this->view->formDialogEditPostfixRecipientbcc = $this->getForm("dialogEditPostfixRecipientbcc");
$this->view->pick('OPNsense/Postfix/recipientbcc');
}
}
@@ -0,0 +1,38 @@
<?php
/*
* Copyright (C) 2018 Michael Muenz <m.muenz@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
namespace OPNsense\Postfix;
class SenderbccController extends \OPNsense\Base\IndexController
{
public function indexAction()
{
$this->view->formDialogEditPostfixSenderbcc = $this->getForm("dialogEditPostfixSenderbcc");
$this->view->pick('OPNsense/Postfix/senderbcc');
}
}
@@ -0,0 +1,22 @@
<form>
<field>
<id>recipientbcc.enabled</id>
<label>Enabled</label>
<type>checkbox</type>
<help>This will enable or disable the BCC sender rewriting setting.</help>
</field>
<field>
<id>recipientbcc.from</id>
<label>Recipient Address</label>
<type>text</type>
<help>Set a pattern to match like user@example.com</help>
</field>
<field>
<id>recipientbcc.to</id>
<label>BCC To</label>
<style>tokenize</style>
<type>select_multiple</type>
<allownew>true</allownew>
<help>Set here the recipient address to send the mail as BCC.</help>
</field>
</form>
@@ -0,0 +1,22 @@
<form>
<field>
<id>senderbcc.enabled</id>
<label>Enabled</label>
<type>checkbox</type>
<help>This will enable or disable the BCC sender rewriting setting.</help>
</field>
<field>
<id>senderbcc.from</id>
<label>Sender Address</label>
<type>text</type>
<help>Set a pattern to match like user@example.com</help>
</field>
<field>
<id>senderbcc.to</id>
<label>BCC To</label>
<style>tokenize</style>
<type>select_multiple</type>
<allownew>true</allownew>
<help>Set here the recipient address to send the mail as BCC.</help>
</field>
</form>
@@ -69,6 +69,14 @@
<type>text</type>
<help>Set the max size for messages to accept, default is 501200000 Byte which is 50MB. Values must be entered in Bytes.</help>
</field>
<field>
<id>general.masquerade_domains</id>
<label>Masquerade Domains</label>
<style>tokenize</style>
<type>select_multiple</type>
<allownew>true</allownew>
<help>Masquerade internal domains to the outside. When you set example.com, the domain host.internal.example.com will be rewritten to exmaple.com when mail leaves the system.</help>
</field>
<field>
<id>general.disable_ssl</id>
<label>Allow TLS Only</label>
@@ -47,6 +47,11 @@
<default>51200000</default>
<Required>Y</Required>
</message_size_limit>
<masquerade_domains type="CSVListField">
<Required>N</Required>
<mask>/^([0-9a-z\.\-\_]{1,128})(,[0-9a-z\.\-\_]{1,128})*$/ui</mask>
<ValidationMessage>Only up to 128 of the following characters are allowed: 0-9a-zA-Z.-_</ValidationMessage>
</masquerade_domains>
<disable_ssl type="BooleanField">
<default>1</default>
<Required>Y</Required>
@@ -4,7 +4,9 @@
<General url="/ui/postfix/general/index" order="10"/>
<Domains url="/ui/postfix/domain/index" order="20"/>
<Recipients url="/ui/postfix/recipient/index" order="30"/>
<Recipientbcc VisibleName="Recipient BCC" url="/ui/postfix/recipientbcc/index" order="35"/>
<Senders url="/ui/postfix/sender/index" order="40"/>
<Senderbcc VisibleName="Sender BCC" url="/ui/postfix/senderbcc/index" order="45"/>
<Address VisibleName="Address Rewriting" url="/ui/postfix/address/index" order="50"/>
<LogFile VisibleName="Log File" order="50" url="/diag_logs_postfix.php"/>
</Postfix>
@@ -0,0 +1,30 @@
<?php
namespace OPNsense\Postfix;
use OPNsense\Base\BaseModel;
/*
Copyright (C) 2018 Michael Muenz <m.muenz@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
class Recipientbcc extends BaseModel
{
}
@@ -0,0 +1,21 @@
<model>
<mount>//OPNsense/postfix/recipientbcc</mount>
<description>Postfix Recipient BCC configuration</description>
<version>1.0.0</version>
<items>
<recipientbccs>
<recipientbcc type="ArrayField">
<enabled type="BooleanField">
<default>1</default>
<Required>Y</Required>
</enabled>
<from type="TextField">
<Required>Y</Required>
</from>
<to type="CSVListField">
<Required>Y</Required>
</to>
</recipientbcc>
</recipientbccs>
</items>
</model>
@@ -0,0 +1,30 @@
<?php
namespace OPNsense\Postfix;
use OPNsense\Base\BaseModel;
/*
Copyright (C) 2018 Michael Muenz <m.muenz@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
class Senderbcc extends BaseModel
{
}
@@ -0,0 +1,21 @@
<model>
<mount>//OPNsense/postfix/senderbcc</mount>
<description>Postfix Sender BCC configuration</description>
<version>1.0.0</version>
<items>
<senderbccs>
<senderbcc type="ArrayField">
<enabled type="BooleanField">
<default>1</default>
<Required>Y</Required>
</enabled>
<from type="TextField">
<Required>Y</Required>
</from>
<to type="CSVListField">
<Required>Y</Required>
</to>
</senderbcc>
</senderbccs>
</items>
</model>
@@ -44,48 +44,24 @@ POSSIBILITY OF SUCH DAMAGE.
}
);
/*************************************************************************************************************
* Commands
*************************************************************************************************************/
/**
* Reconfigure
*/
$("#reconfigureAct").click(function(){
$("#reconfigureAct_progress").addClass("fa fa-spinner fa-pulse");
ajaxCall("/api/postfix/service/reconfigure", {}, function(data,status) {
// when done, disable progress animation.
$("#reconfigureAct_progress").removeClass("fa fa-spinner fa-pulse");
if (status != "success" || data['status'] != 'ok') {
BootstrapDialog.show({
type: BootstrapDialog.TYPE_WARNING,
title: "{{ lang._('Error reconfiguring Postfix') }}",
message: data['status'],
draggable: true
});
} else {
ajaxCall("/api/postfix/service/reconfigure", {});
}
});
});
{% include 'OPNsense/Postfix/apply.volt' %}
});
</script>
<div class="tab-content content-box tab-content">
<div id="addresses" class="tab-pane fade in active">
<!-- tab page "addresses" -->
<table id="grid-addresses" class="table table-condensed table-hover table-striped table-responsive" data-editDialog="dialogEditPostfixAddress">
<table id="grid-addresses" class="table table-responsive" data-editDialog="dialogEditPostfixAddress">
<thead>
<tr>
<th data-column-id="enabled" data-type="string" data-formatter="rowtoggle">{{ lang._('Enabled') }}</th>
<th data-column-id="from" data-type="string" data-visible="true">{{ lang._('Rewrite From') }}</th>
<th data-column-id="to" data-type="string" data-visible="true">{{ lang._('Rewrite To') }}</th>
<th data-column-id="uuid" data-type="string" data-identifier="true" data-visible="false">{{ lang._('ID') }}</th>
<th data-column-id="commands" data-formatter="commands" data-sortable="false">{{ lang._('Commands') }}</th> </tr>
<th data-column-id="commands" data-formatter="commands" data-sortable="false">{{ lang._('Commands') }}</th>
</tr>
</thead>
<tbody>
</tbody>
@@ -99,12 +75,12 @@ POSSIBILITY OF SUCH DAMAGE.
</tr>
</tfoot>
</table>
</div>
<div class="col-md-12">
<hr/>
<button class="btn btn-primary" id="reconfigureAct" type="button"><b>{{ lang._('Apply') }}</b> <i id="reconfigureAct_progress" class=""></i></button>
<br/><br/>
<div class="col-md-12">
<hr/>
<button class="btn btn-primary" id="reconfigureAct" type="button"><b>{{ lang._('Apply') }}</b> <i id="reconfigureAct_progress" class=""></i></button>
<br/><br/>
</div>
</div>
</div>
{{ partial("layout_partials/base_dialog",['fields':formDialogEditPostfixAddress,'id':'dialogEditPostfixAddress','label':lang._('Edit Address Rewriting')])}}
{{ partial("layout_partials/base_dialog",['fields':formDialogEditPostfixAddress,'id':'dialogEditPostfixAddress','label':lang._('Edit Address Rewriting')])}}
@@ -0,0 +1,20 @@
/**
* Reconfigure
*/
$("#reconfigureAct").click(function(){
$("#reconfigureAct_progress").addClass("fa fa-spinner fa-pulse");
ajaxCall("/api/postfix/service/reconfigure", {}, function(data,status) {
// when done, disable progress animation.
$("#reconfigureAct_progress").removeClass("fa fa-spinner fa-pulse");
if (status != "success" || data['status'] != 'ok') {
BootstrapDialog.show({
type: BootstrapDialog.TYPE_WARNING,
title: "{{ lang._('Error reconfiguring Postfix') }}",
message: data['status'],
draggable: true
});
} else {
ajaxCall("/api/postfix/service/reconfigure", {});
}
});
});
@@ -1,7 +1,7 @@
{#
OPNsense® is Copyright © 2014 2017 by Deciso B.V.
Copyright (C) 2017 Michael Muenz <m.muenz@gmail.com>
Copyright (C) 2017-2018 Michael Muenz <m.muenz@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
@@ -44,35 +44,10 @@ POSSIBILITY OF SUCH DAMAGE.
}
);
/*************************************************************************************************************
* Commands
*************************************************************************************************************/
/**
* Reconfigure
*/
$("#reconfigureAct").click(function(){
$("#reconfigureAct_progress").addClass("fa fa-spinner fa-pulse");
ajaxCall(url="/api/postfix/service/reconfigure", sendData={}, callback=function(data,status) {
// when done, disable progress animation.
$("#reconfigureAct_progress").removeClass("fa fa-spinner fa-pulse");
if (status != "success" || data['status'] != 'ok') {
BootstrapDialog.show({
type: BootstrapDialog.TYPE_WARNING,
title: "{{ lang._('Error reconfiguring Postfix') }}",
message: data['status'],
draggable: true
});
} else {
ajaxCall(url="/api/postfix/service/reconfigure", sendData={});
}
});
});
{% include 'OPNsense/Postfix/apply.volt' %}
});
</script>
<div class="tab-content content-box tab-content">
@@ -1,7 +1,7 @@
{#
OPNsense® is Copyright © 2014 2017 by Deciso B.V.
Copyright (C) 2017 Michael Muenz <m.muenz@gmail.com>
Copyright (C) 2017-2018 Michael Muenz <m.muenz@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
@@ -44,35 +44,10 @@ POSSIBILITY OF SUCH DAMAGE.
}
);
/*************************************************************************************************************
* Commands
*************************************************************************************************************/
/**
* Reconfigure
*/
$("#reconfigureAct").click(function(){
$("#reconfigureAct_progress").addClass("fa fa-spinner fa-pulse");
ajaxCall(url="/api/postfix/service/reconfigure", sendData={}, callback=function(data,status) {
// when done, disable progress animation.
$("#reconfigureAct_progress").removeClass("fa fa-spinner fa-pulse");
if (status != "success" || data['status'] != 'ok') {
BootstrapDialog.show({
type: BootstrapDialog.TYPE_WARNING,
title: "{{ lang._('Error reconfiguring Postfix') }}",
message: data['status'],
draggable: true
});
} else {
ajaxCall(url="/api/postfix/service/reconfigure", sendData={});
}
});
});
{% include 'OPNsense/Postfix/apply.volt' %}
});
</script>
<div class="tab-content content-box tab-content">
@@ -0,0 +1,86 @@
{#
OPNsense® is Copyright © 2014 2017 by Deciso B.V.
Copyright (C) 2018 Michael Muenz <m.muenz@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
#}
<script>
$( document ).ready(function() {
/*************************************************************************************************************
* link grid actions
*************************************************************************************************************/
$("#grid-recipientbccs").UIBootgrid(
{ 'search':'/api/postfix/recipientbcc/searchRecipientbcc',
'get':'/api/postfix/recipientbcc/getRecipientbcc/',
'set':'/api/postfix/recipientbcc/setRecipientbcc/',
'add':'/api/postfix/recipientbcc/addRecipientbcc/',
'del':'/api/postfix/recipientbcc/delRecipientbcc/',
'toggle':'/api/postfix/recipientbcc/toggleRecipientbcc/'
}
);
{% include 'OPNsense/Postfix/apply.volt' %}
});
</script>
<div class="tab-content content-box tab-content">
<div id="recipientbccs" class="tab-pane fade in active">
<!-- tab page "recipientbccs" -->
<table id="grid-recipientbccs" class="table table-responsive" data-editDialog="dialogEditPostfixRecipientbcc">
<thead>
<tr>
<th data-column-id="enabled" data-type="string" data-formatter="rowtoggle">{{ lang._('Enabled') }}</th>
<th data-column-id="from" data-type="string" data-visible="true">{{ lang._('Recipient Address') }}</th>
<th data-column-id="to" data-type="string" data-visible="true">{{ lang._('BCC To') }}</th>
<th data-column-id="uuid" data-type="string" data-identifier="true" data-visible="false">{{ lang._('ID') }}</th>
<th data-column-id="commands" data-formatter="commands" data-sortable="false">{{ lang._('Commands') }}</th>
</tr>
</thead>
<tbody>
</tbody>
<tfoot>
<tr>
<td></td>
<td>
<button data-action="add" type="button" class="btn btn-xs btn-default"><span class="fa fa-plus"></span></button>
<button data-action="deleteSelected" type="button" class="btn btn-xs btn-default"><span class="fa fa-trash-o"></span></button>
</td>
</tr>
</tfoot>
</table>
<div class="col-md-12">
<hr/>
<button class="btn btn-primary" id="reconfigureAct" type="button"><b>{{ lang._('Apply') }}</b> <i id="reconfigureAct_progress" class=""></i></button>
<br/><br/>
</div>
</div>
</div>
{{ partial("layout_partials/base_dialog",['fields':formDialogEditPostfixRecipientbcc,'id':'dialogEditPostfixRecipientbcc','label':lang._('Edit Recipient BCC')])}}
@@ -1,7 +1,7 @@
{#
OPNsense® is Copyright © 2014 2017 by Deciso B.V.
Copyright (C) 2017 Michael Muenz <m.muenz@gmail.com>
Copyright (C) 2017-2018 Michael Muenz <m.muenz@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
@@ -44,35 +44,10 @@ POSSIBILITY OF SUCH DAMAGE.
}
);
/*************************************************************************************************************
* Commands
*************************************************************************************************************/
/**
* Reconfigure
*/
$("#reconfigureAct").click(function(){
$("#reconfigureAct_progress").addClass("fa fa-spinner fa-pulse");
ajaxCall(url="/api/postfix/service/reconfigure", sendData={}, callback=function(data,status) {
// when done, disable progress animation.
$("#reconfigureAct_progress").removeClass("fa fa-spinner fa-pulse");
if (status != "success" || data['status'] != 'ok') {
BootstrapDialog.show({
type: BootstrapDialog.TYPE_WARNING,
title: "{{ lang._('Error reconfiguring Postfix') }}",
message: data['status'],
draggable: true
});
} else {
ajaxCall(url="/api/postfix/service/reconfigure", sendData={});
}
});
});
{% include 'OPNsense/Postfix/apply.volt' %}
});
</script>
<div class="tab-content content-box tab-content">
@@ -0,0 +1,86 @@
{#
OPNsense® is Copyright © 2014 2017 by Deciso B.V.
Copyright (C) 2018 Michael Muenz <m.muenz@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
#}
<script>
$( document ).ready(function() {
/*************************************************************************************************************
* link grid actions
*************************************************************************************************************/
$("#grid-senderbccs").UIBootgrid(
{ 'search':'/api/postfix/senderbcc/searchSenderbcc',
'get':'/api/postfix/senderbcc/getSenderbcc/',
'set':'/api/postfix/senderbcc/setSenderbcc/',
'add':'/api/postfix/senderbcc/addSenderbcc/',
'del':'/api/postfix/senderbcc/delSenderbcc/',
'toggle':'/api/postfix/senderbcc/toggleSenderbcc/'
}
);
{% include 'OPNsense/Postfix/apply.volt' %}
});
</script>
<div class="tab-content content-box tab-content">
<div id="senderbccs" class="tab-pane fade in active">
<!-- tab page "senderbccs" -->
<table id="grid-senderbccs" class="table table-responsive" data-editDialog="dialogEditPostfixSenderbcc">
<thead>
<tr>
<th data-column-id="enabled" data-type="string" data-formatter="rowtoggle">{{ lang._('Enabled') }}</th>
<th data-column-id="from" data-type="string" data-visible="true">{{ lang._('Sender Address') }}</th>
<th data-column-id="to" data-type="string" data-visible="true">{{ lang._('BCC To') }}</th>
<th data-column-id="uuid" data-type="string" data-identifier="true" data-visible="false">{{ lang._('ID') }}</th>
<th data-column-id="commands" data-formatter="commands" data-sortable="false">{{ lang._('Commands') }}</th>
</tr>
</thead>
<tbody>
</tbody>
<tfoot>
<tr>
<td></td>
<td>
<button data-action="add" type="button" class="btn btn-xs btn-default"><span class="fa fa-plus"></span></button>
<button data-action="deleteSelected" type="button" class="btn btn-xs btn-default"><span class="fa fa-trash-o"></span></button>
</td>
</tr>
</tfoot>
</table>
<div class="col-md-12">
<hr/>
<button class="btn btn-primary" id="reconfigureAct" type="button"><b>{{ lang._('Apply') }}</b> <i id="reconfigureAct_progress" class=""></i></button>
<br/><br/>
</div>
</div>
</div>
{{ partial("layout_partials/base_dialog",['fields':formDialogEditPostfixSenderbcc,'id':'dialogEditPostfixSenderbcc','label':lang._('Edit Sender BCC')])}}

Some files were not shown because too many files have changed in this diff Show More