Fixed tweaks to help with sender-login-maps on system-wide accounts

This commit is contained in:
pmkuipers 2020-06-12 22:32:12 +02:00
parent 1269a40f3f
commit e311429173
5 changed files with 8 additions and 9 deletions

View File

@ -15,7 +15,7 @@ Add the following to the file:
auth_default_realm=localhost auth_default_realm=localhost
``` ```
Change the line *mail_home* to: Optional: Change the line *mail_home* to
``` ```
mail_home = /srv/vmail/mailboxes/%n@%d mail_home = /srv/vmail/mailboxes/%n@%d
``` ```
@ -23,6 +23,7 @@ mail_home = /srv/vmail/mailboxes/%n@%d
### /etc/postfix/main.cf ### /etc/postfix/main.cf
Add the following lines to the file in the appropriate places: Add the following lines to the file in the appropriate places:
``` ```
smtpd_sender_login_maps = mysql:/etc/postfix/sql/sender-login-maps.cf
myorigin=localhost myorigin=localhost
local_transport = $virtual_transport local_transport = $virtual_transport
virtual_mailbox_limit = 0 virtual_mailbox_limit = 0
@ -38,7 +39,7 @@ to create the database.
This management interface includes the following features This management interface includes the following features
- Full multi-admin multi-domain capability. Each validated user can get domains assigned to manage by an admin. - Full multi-admin multi-domain capability. Each validated user can get domains assigned to manage by an admin.
- Multiple system administrators are possible - Multiple system administrators are possible
- Configure system-wide accounts - Configure system-wide accounts (@localhost) to separate login name from email address
- Set-up mail accounts per domain - Set-up mail accounts per domain
- Configure aliases per domain - with multiple recipients - Configure aliases per domain - with multiple recipients
- Portal to have users change their own email password - Portal to have users change their own email password

View File

@ -599,7 +599,7 @@ class VMailController extends Controller
$a_list[$a->source_username]->dest = []; $a_list[$a->source_username]->dest = [];
} }
$a->destination = empty($a->destination_domain)?($a->destination_username):($a->destination_username.'@'.$a->destination_domain); $a->destination = (empty($a->destination_domain)||$a->destination_domain == "localhost")?($a->destination_username):($a->destination_username.'@'.$a->destination_domain);
$a_list[$a->source_username]->dest[] = $a; $a_list[$a->source_username]->dest[] = $a;
} }
@ -657,7 +657,7 @@ class VMailController extends Controller
'source_username' => $validatedData['source'], 'source_username' => $validatedData['source'],
'source_domain' => $domain->domain, 'source_domain' => $domain->domain,
'destination_username' => $dparts[0], 'destination_username' => $dparts[0],
'destination_domain' => isset($dparts[1])?$dparts[1]:null, 'destination_domain' => isset($dparts[1])?$dparts[1]:"localhost",
'enabled' => $validatedData['enabled'], 'enabled' => $validatedData['enabled'],
'comment' => $validatedData['comment'], 'comment' => $validatedData['comment'],
]); ]);
@ -678,7 +678,7 @@ class VMailController extends Controller
$dparts = explode('@',$validatedData['destination'],2); $dparts = explode('@',$validatedData['destination'],2);
$a->destination_username = $dparts[0]; $a->destination_username = $dparts[0];
$a->destination_domain = isset($dparts[1])?$dparts[1]:null; $a->destination_domain = isset($dparts[1])?$dparts[1]:"localhost";
$a->enabled = $validatedData['enabled']; $a->enabled = $validatedData['enabled'];
$a->comment = $validatedData['comment']; $a->comment = $validatedData['comment'];

3
public/js/app.js vendored
View File

@ -75157,8 +75157,7 @@ Vue.component('datetime', vue_datetime__WEBPACK_IMPORTED_MODULE_0__["Datetime"])
//delete_account(a,event){ //delete_account(a,event){
axios.post("/siteaccounts", { axios.post("/siteaccounts", {
action: 'delete', action: 'delete',
id: a.id, id: a.id
domain: app.active_domain.domain
}).then(function (response) { }).then(function (response) {
app.siteaccounts_list(); app.siteaccounts_list();
}).then(handlers.buttonsuccess(event.target))["catch"](handlers.buttonerror(event.target)); }).then(handlers.buttonsuccess(event.target))["catch"](handlers.buttonerror(event.target));

1
resources/js/app.js vendored
View File

@ -774,7 +774,6 @@ Vue.component('datetime',Datetime);
axios.post("/siteaccounts", { axios.post("/siteaccounts", {
action: 'delete', action: 'delete',
id: a.id, id: a.id,
domain: app.active_domain.domain
}).then(function (response) { }).then(function (response) {
app.siteaccounts_list(); app.siteaccounts_list();
}).then(handlers.buttonsuccess(event.target))["catch"](handlers.buttonerror(event.target)); }).then(handlers.buttonsuccess(event.target))["catch"](handlers.buttonerror(event.target));

View File

@ -619,7 +619,7 @@ window.InitialState.IsSiteAdmin = @json(Auth::user()->hasRole('admin'));
<b-modal <b-modal
:id="'delete-acc-modal-'+a.id" :id="'delete-acc-modal-'+a.id"
title="Confirm Delete" title="Confirm Delete"
@ok="siteaccount_delete_(a,$event)" @ok="siteaccount_delete(a,$event)"
>Are you sure you want to delete the account <strong>@{{a.username}}@@{{a.domain}}</strong>? >Are you sure you want to delete the account <strong>@{{a.username}}@@{{a.domain}}</strong>?
<template v-slot:modal-footer="{ ok, cancel, hide }"> <template v-slot:modal-footer="{ ok, cancel, hide }">