Compare commits

..

3 Commits

Author SHA1 Message Date
Matthew Saunders Brown
2b0c906615 empty var fixes 2022-09-27 15:53:10 -07:00
Matthew Saunders Brown
50c03d6d17 enable tls for smtp auth. forces mail domain to have tls cert configured 2022-09-27 15:52:33 -07:00
Matthew Saunders Brown
24aa17ef9d move html block to it's own directory to avoid 'client denied by server configuration' in error logs 2022-09-27 15:46:16 -07:00
7 changed files with 18 additions and 12 deletions

View File

@ -27,11 +27,6 @@ Alias /panel /srv/www/html/panel
# all hidden files and dirs (anything beginning with a .) # all hidden files and dirs (anything beginning with a .)
RewriteRule ^(classes|config|f3|tmp)\/|^\.|^/\. - [R=404] RewriteRule ^(classes|config|f3|tmp)\/|^\.|^/\. - [R=404]
# deny direct access to html (template) files
<FilesMatch "\.(htm|html)$">
Deny from all
</FilesMatch>
# Route requests to the framework # Route requests to the framework
RewriteCond %{REQUEST_FILENAME} !-l RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-f
@ -40,3 +35,10 @@ Alias /panel /srv/www/html/panel
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L] RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
</Directory> </Directory>
# deny direct access to html (template) files
<Directory /srv/www/html/panel/ui>
<FilesMatch "\.(htm|html)$">
Deny from all
</FilesMatch>
</Directory>

View File

@ -47,7 +47,7 @@ class Login extends \Panel {
$username = "$username@$domain"; $username = "$username@$domain";
} }
$emaildomain = $f3->get('HOST'); $emaildomain = $f3->get('HOST');
$auth = new \Auth('smtp', ['host' => $emaildomain, 'port' => 25, 'scheme' => null]); $auth = new \Auth('smtp', ['host' => $emaildomain, 'port' => 587, 'scheme' => 'tls']);
if ($auth->login($username, $password)) { if ($auth->login($username, $password)) {
/* user passed smtp auth, check for admin access */ /* user passed smtp auth, check for admin access */
if ($email_array = $f3->call('\Panel::vGet', array("vmail-mboxes-get.sh -e $username -c", FALSE))) { if ($email_array = $f3->call('\Panel::vGet', array("vmail-mboxes-get.sh -e $username -c", FALSE))) {

View File

@ -22,6 +22,10 @@ class AutorespondersAdd extends \Panel\Vmail {
static function get($f3) { static function get($f3) {
/* initialize autoresponder_array */
$autoresponder_array = array('subject' => '', 'body' => '', 'mode' => 'Vacation', 'status' => '1');
$f3->set('autoresponder_array', $autoresponder_array);
echo \Template::instance()->render('vmail/autoresponders-add.html'); echo \Template::instance()->render('vmail/autoresponders-add.html');
} }

View File

@ -34,7 +34,7 @@ class AutorespondersEdit extends \Panel\Vmail {
$body = substr_replace($body, "", -1); $body = substr_replace($body, "", -1);
$autoresponder_array[0]['body'] = $body; $autoresponder_array[0]['body'] = $body;
$autoresponders_array[$k] = $autoresponder_array; $autoresponders_array[0] = $autoresponder_array;
$f3->set('autoresponder_array', $autoresponder_array[0]); $f3->set('autoresponder_array', $autoresponder_array[0]);

View File

@ -22,6 +22,9 @@ class ForwardsAdd extends \Panel\Vmail {
static function get($f3) { static function get($f3) {
/* initialize forward_array */
$forward_array = array('forward' => '', 'save_local' => '0');
$f3->set('forward_array', $forward_array);
echo \Template::instance()->render('vmail/forwards-add.html'); echo \Template::instance()->render('vmail/forwards-add.html');
} }

View File

@ -3,9 +3,6 @@
<check if="isset(@autoresponders_array)"> <check if="isset(@autoresponders_array)">
<table> <table>
<!-- <tr>
<th colspan="2">Autoresponder for {{ @mbox }}@{{ @domain }} </th>
</tr>-->
<tr> <tr>
<td align="right"><b>Subject:</b></td> <td align="right"><b>Subject:</b></td>

View File

@ -6,10 +6,10 @@
<legend>Edit Email Account {{ @PARAMS.mbox }}@{{ @PARAMS.domain }} (All fields are required)</legend> <legend>Edit Email Account {{ @PARAMS.mbox }}@{{ @PARAMS.domain }} (All fields are required)</legend>
<label for="password">Password <small>(leave empty to keep same password)</small></label> <label for="password">Password <small>(leave empty to keep same password)</small></label>
<input id="password" name="password" type="password" value="{{ @mbox.password }}"> <input id="password" name="password" type="password" value="">
<label for="password_confirm">Confirm Password <small>(repeat same password, only if making a change)</small></label> <label for="password_confirm">Confirm Password <small>(repeat same password, only if making a change)</small></label>
<input id="password_confirm" name="password_confirm" type="password" value="{{ @mbox.password_confirm }}"> <input id="password_confirm" name="password_confirm" type="password" value="">
<label for="status">Status</label> <label for="status">Status</label>
<select id="status" name="status"> <select id="status" name="status">