Skip to content

Commit d12565a

Browse files
authored
Merge pull request #3 from devilbox-community/release-v3.0.0-beta-0.6
Release v3.0.0-beta-0.6 (2024-06-01)
2 parents 5024788 + f8cea9e commit d12565a

27 files changed

+223
-120
lines changed

.devilbox/www/htdocs/_iframe_mail.php

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php require '../config.php'; ?>
2+
<?php loadClass('Helper')->authPage(); ?>
3+
<?php
4+
5+
//
6+
// Includes
7+
//
8+
require $VEN_DIR . DIRECTORY_SEPARATOR . 'Mail' . DIRECTORY_SEPARATOR .'Mbox.php';
9+
require $VEN_DIR . DIRECTORY_SEPARATOR . 'Mail' . DIRECTORY_SEPARATOR .'mimeDecode.php';
10+
require $LIB_DIR . DIRECTORY_SEPARATOR . 'Mail.php';
11+
require $LIB_DIR . DIRECTORY_SEPARATOR . 'Sort.php';
12+
13+
//
14+
// Setup Sort/Order
15+
//
16+
17+
// Sort/Order settings
18+
$defaultSort = array('sort' => 'date', 'order' => 'DESC');
19+
$allowedSorts = array('date', 'subject', 'x-original-to', 'from');
20+
$allowedOrders = array('ASC', 'DESC');
21+
$GET_sortKeys = array('sort' => 'sort', 'order' => 'order');
22+
23+
// Get sort/order
24+
$MySort = new \devilbox\Sort($defaultSort, $allowedSorts, $allowedOrders, $GET_sortKeys);
25+
$sort = $MySort->getSort();
26+
$order = $MySort->getOrder();
27+
28+
$body = null;
29+
if (isset($_GET['mail-id']) && is_numeric($_GET['mail-id'])) {
30+
$messageNumber = $_GET['mail-id'];
31+
$MyMbox = new \devilbox\Mail('/var/mail/devilbox');
32+
$message = $MyMbox->getMessage($messageNumber-1);
33+
$structure = $message['decoded'];
34+
35+
if (isset($structure->body)) {
36+
$body = $structure->body;
37+
}
38+
elseif(isset($structure->parts[1]->body)) {
39+
$body = $structure->parts[1]->body;
40+
}
41+
elseif(isset($structure->parts[0]->body)) {
42+
$body = $structure->parts[0]->body;
43+
}
44+
}
45+
?>
46+
<?= $body ?: 'No valid body found' ?>

.devilbox/www/htdocs/mail.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@
209209
<tr id="mail-<?php echo $data['num'];?>" style="display:none">
210210
<td></td>
211211
<td colspan="5">
212+
<iframe seamless="seamless" class="body-iframe" id="email-body-<?php echo $data['num'];?>" src="" frameborder="0" scrolling="no" height="100%" width="100%" style="width:100%; height:100%;margin:0px;border:0px;"></iframe>
212213
<div class="email-body"></div>
213214
<div class="alert alert-warning" role="alert" style="display:none">
214215
No valid body found
@@ -239,6 +240,8 @@
239240
row.toggle();
240241

241242
const bodyElement = row.find('.email-body')[0];
243+
const iframeBodyElement = $(row.find('.body-iframe')[0]);
244+
let iframeBodyUrl = '/_iframe_mail.php?mail-id=' + id;
242245
if(bodyElement.shadowRoot !== null){
243246
// We've already fetched the message content.
244247
return;
@@ -258,7 +261,10 @@
258261
else{
259262
bodyElement.shadowRoot.innerHTML = body;
260263
}
261-
})
264+
});
265+
266+
document.getElementById('email-body-' + id).src = iframeBodyUrl;
267+
iframeBodyElement.on("load",function() { console.log($(this).attr("src"))})
262268
})
263269
// Handler for .ready() called.
264270
});

.devilbox/www/include/lib/Html.php

+11-5
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,16 @@ public function getNavbar()
265265
}
266266

267267

268+
public function getFooterScripts()
269+
{
270+
$html = <<<HTML
271+
<script src="/vendor/jquery/jquery-3.7.1.min.js"></script>
272+
<script src="/vendor/tether/tether.min.js"></script>
273+
<script src="/vendor/bootstrap/bootstrap.min.js"></script>
274+
HTML;
275+
return $html;
276+
}
277+
268278

269279
public function getFooter()
270280
{
@@ -283,12 +293,8 @@ public function getFooter()
283293
</ul>
284294
</div>
285295
</nav>
286-
287-
<script src="/vendor/jquery/jquery-3.7.1.min.js"></script>
288-
<script src="/vendor/tether/tether.min.js"></script>
289-
<script src="/vendor/bootstrap/bootstrap.min.js"></script>
290296
HTML;
291-
return $html;
297+
return $html . $this->getFooterScripts();
292298
}
293299

294300

.devilbox/www/include/vendor/Mail/mimeDecode.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ function decode($params = null)
234234
PEAR::raiseError('header decode conversion requested, however iconv is missing');
235235
}
236236

237-
$structure = $this->_decode($this->_header, $this->_body);
237+
$structure = $this->_decode($this->_header, $this->_body, 'text/html');
238238
if ($structure === false) {
239239
$structure = $this->raiseError($this->_error);
240240
}

.devilbox/wwwhtdocs/vendor/react/react-dom.min.js

-15
This file was deleted.

.devilbox/wwwhtdocs/vendor/react/react.min.js

-12
This file was deleted.

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,14 @@
113113
/cfg/php-startup-8.2/*.sh
114114
/cfg/php-startup-8.3/*.sh
115115

116-
# Ignorecustom Varnish configs
116+
# Ignore custom Varnish configs
117117
/cfg/varnish-4/*.vcl
118118
/cfg/varnish-5/*.vcl
119119
/cfg/varnish-6/*.vcl
120120

121+
# Ignore custom msmtp configs
122+
/cfg/msmtp/msmtprc
123+
121124
# Ignore custom PHP-FPM modules
122125
/mod/php-fpm-5.6/*.so
123126
/mod/php-fpm-7.0/*.so

CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ Make sure to have a look at [UPDATING.md](https://github.com/cytopia/devilbox/bl
66
## Unreleased
77

88

9+
## Release v3.0.0-beta-0.6 (2024-06-01)
10+
11+
### Added
12+
- New sub-command `magento` for `dvl.sh`
13+
- New sub-command `composer` for `dvl.sh`
14+
15+
### Changed
16+
- Re-added and upgrade `mhsendmail` tool
17+
- Update PHP image version to `0.153`
18+
- Change default flavour for PHP image in order to use `mailhog`
19+
20+
921
## Release v3.0.0-beta-0.5 (2024-06-18)
1022

1123
### Added

cfg/msmtp/.keepme

Whitespace-only changes.

cfg/msmtp/msmtprc

-8
This file was deleted.

cfg/msmtp/msmtprc-postfix-example

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
############################################################
2+
# Devilbox msmtprc: Postfix example
3+
############################################################
4+
5+
6+
# Set defaults.
7+
defaults
8+
9+
# Set up a default account's settings.
10+
account default
11+
host postfix
12+
port 25
13+
14+

cfg/msmtp/msmtprc-production-example

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
############################################################
2+
# Devilbox msmtprc: Live - 3rd-party services example
3+
############################################################
4+
5+
6+
# Set defaults.
7+
defaults
8+
9+
# Set up a default account's settings.
10+
account default
11+
12+
# SMTP settings
13+
host smtp.example.com
14+
port 567
15+
auth on
16+
username username
17+
password apikey
18+
19+
# SMTP TLS settings
20+
tls on
21+
tls_starttls on
22+
tls_trust_file /etc/ssl/certs/ca-certificates.crt
23+
24+

cfg/php-ini-5.6/devilbox-php.ini-msmtp

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
; PHP.ini configuration
2020
;
2121
[smtp]
22-
sendmail_path = '/usr/bin/msmtp -t'
22+
sendmail_path = '/usr/local/bin/msmtp -t'

cfg/php-ini-7.0/devilbox-php.ini-msmtp

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
; PHP.ini configuration
2020
;
2121
[smtp]
22-
sendmail_path = '/usr/bin/msmtp -t'
22+
sendmail_path = '/usr/local/bin/msmtp -t'

cfg/php-ini-7.1/devilbox-php.ini-msmtp

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
; PHP.ini configuration
2020
;
2121
[smtp]
22-
sendmail_path = '/usr/bin/msmtp -t'
22+
sendmail_path = '/usr/local/bin/msmtp -t'

cfg/php-ini-7.2/devilbox-php.ini-msmtp

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
; PHP.ini configuration
2020
;
2121
[smtp]
22-
sendmail_path = '/usr/bin/msmtp -t'
22+
sendmail_path = '/usr/local/bin/msmtp -t'

cfg/php-ini-7.3/devilbox-php.ini-msmtp

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
; PHP.ini configuration
2020
;
2121
[smtp]
22-
sendmail_path = '/usr/bin/msmtp -t'
22+
sendmail_path = '/usr/local/bin/msmtp -t'

cfg/php-ini-7.4/devilbox-php.ini-msmtp

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
; PHP.ini configuration
2020
;
2121
[smtp]
22-
sendmail_path = '/usr/bin/msmtp -t'
22+
sendmail_path = '/usr/local/bin/msmtp -t'

cfg/php-ini-8.0/devilbox-php.ini-msmtp

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
; PHP.ini configuration
2020
;
2121
[smtp]
22-
sendmail_path = '/usr/bin/msmtp -t'
22+
sendmail_path = '/usr/local/bin/msmtp -t'

cfg/php-ini-8.1/devilbox-php.ini-msmtp

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
; PHP.ini configuration
2020
;
2121
[smtp]
22-
sendmail_path = '/usr/bin/msmtp -t'
22+
sendmail_path = '/usr/local/bin/msmtp -t'

cfg/php-ini-8.2/devilbox-php.ini-msmtp

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
; PHP.ini configuration
2020
;
2121
[smtp]
22-
sendmail_path = '/usr/bin/msmtp -t'
22+
sendmail_path = '/usr/local/bin/msmtp -t'

cfg/php-ini-8.3/devilbox-php.ini-msmtp

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
; PHP.ini configuration
2020
;
2121
[smtp]
22-
sendmail_path = '/usr/bin/msmtp -t'
22+
sendmail_path = '/usr/local/bin/msmtp -t'

0 commit comments

Comments
 (0)