mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-09-20 07:35:55 +08:00
v2.11.0
This commit is contained in:
parent
630dc1e854
commit
ba49d06d1a
|
@ -289,5 +289,5 @@ dev_email = ""
|
|||
dev_password = ""
|
||||
|
||||
[version]
|
||||
current = "2.10.3"
|
||||
current = "2.11.0"
|
||||
saved = "Mon, 23 Aug 2021 07:55:13 +0000"
|
||||
|
|
14
README.md
14
README.md
|
@ -139,22 +139,22 @@ RainLoop 1.15 vs SnappyMail
|
|||
|js/* |RainLoop |Snappy |
|
||||
|--------------- |--------: |--------: |
|
||||
|admin.js |2.158.025 | 86.116 |
|
||||
|app.js |4.215.733 | 424.300 |
|
||||
|app.js |4.215.733 | 423.547 |
|
||||
|boot.js | 672.433 | 2.779 |
|
||||
|libs.js | 647.679 | 208.745 |
|
||||
|polyfills.js | 325.908 | 0 |
|
||||
|serviceworker.js | 0 | 285 |
|
||||
|TOTAL |8.019.778 | 722.225 |
|
||||
|TOTAL |8.019.778 | 721.472 |
|
||||
|
||||
|js/min/* |RainLoop |Snappy |RL gzip |SM gzip |RL brotli |SM brotli |
|
||||
|--------------- |--------: |--------: |------: |------: |--------: |--------: |
|
||||
|admin.min.js | 255.514 | 43.225 | 73.899 | 13.927 | 60.674 | 12.410 |
|
||||
|app.min.js | 516.000 | 214.755 |140.430 | 65.379 |110.657 | 55.690 |
|
||||
|app.min.js | 516.000 | 214.686 |140.430 | 65.385 |110.657 | 55.574 |
|
||||
|boot.min.js | 66.456 | 1.654 | 22.553 | 996 | 20.043 | 814 |
|
||||
|libs.min.js | 574.626 | 99.476 |177.280 | 36.501 |151.855 | 32.699 |
|
||||
|polyfills.min.js | 32.608 | 0 | 11.315 | 0 | 10.072 | 0 |
|
||||
|TOTAL |1.445.204 | 359.110 |425.477 |116.803 |353.301 |101.613 |
|
||||
|TOTAL (no admin) |1.189.690 | 315.885 |351.061 |102.876 |292.627 | 89.203 |
|
||||
|TOTAL |1.445.204 | 359.041 |425.477 |116.809 |353.301 |101.497 |
|
||||
|TOTAL (no admin) |1.189.690 | 315.816 |351.061 |102.882 |292.627 | 89.087 |
|
||||
|
||||
For a user its around 70% smaller and faster than traditional RainLoop.
|
||||
|
||||
|
@ -193,8 +193,8 @@ For a user its around 70% smaller and faster than traditional RainLoop.
|
|||
|
||||
|css/* |RainLoop |Snappy |RL gzip |SM gzip |SM brotli |
|
||||
|------------ |-------: |------: |------: |------: |--------: |
|
||||
|app.css | 340.334 | 84.751 | 46.959 | 16.292 | 14.087 |
|
||||
|app.min.css | 274.791 | 68.572 | 39.618 | 14.414 | 12.786 |
|
||||
|app.css | 340.334 | 84.579 | 46.959 | 16.311 | 14.102 |
|
||||
|app.min.css | 274.791 | 68.200 | 39.618 | 14.359 | 12.744 |
|
||||
|boot.css | | 1.326 | | 664 | 545 |
|
||||
|boot.min.css | | 1.071 | | 590 | 474 |
|
||||
|admin.css | | 30.558 | | 6.894 | 5.979 |
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
This app packages SnappyMail <upstream>2.10.3</upstream>.
|
||||
This app packages SnappyMail <upstream>2.11.0</upstream>.
|
||||
|
||||
SnappyMail is a simple, modern, lightweight & fast web-based email client.
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ RUN mkdir -p /app/code
|
|||
WORKDIR /app/code
|
||||
|
||||
# If you change the extraction below, be sure to test on scaleway
|
||||
VERSION=2.10.3
|
||||
VERSION=2.11.0
|
||||
RUN wget https://github.com/the-djmaze/snappymail/releases/download/v${VERSION}/snappymail-${VERSION}.zip -O /tmp/snappymail.zip && \
|
||||
unzip /tmp/snappymail.zip -d /app/code && \
|
||||
rm /tmp/snappymail.zip && \
|
||||
|
|
|
@ -1 +1 @@
|
|||
2.10.3
|
||||
2.11.0
|
|
@ -4,7 +4,7 @@
|
|||
<name>SnappyMail</name>
|
||||
<summary>SnappyMail Webmail</summary>
|
||||
<description>Simple, modern and fast web-based email client. After enabling in Nextcloud, go to Nextcloud admin panel, "Additionnal settings" and you will see a "SnappyMail webmail" section. There, click on the link to go to the SnappyMail admin panel. The default user/password is admin/12345. This version is based on SnappyMail 2.6.0 (2021-07).</description>
|
||||
<version>2.10.3</version>
|
||||
<version>2.11.0</version>
|
||||
<licence>agpl</licence>
|
||||
<author>SnappyMail Team, Nextgen-Networks, Tab Fitts, Nathan Kinkade, Pierre-Alain Bandinelli</author>
|
||||
<namespace>SnappyMail</namespace>
|
||||
|
|
|
@ -20,7 +20,7 @@ return "SnappyMail Webmail is a browser-based multilingual IMAP client with an a
|
|||
# script_snappymail_versions()
|
||||
sub script_snappymail_versions
|
||||
{
|
||||
return ( "2.10.3" );
|
||||
return ( "2.11.0" );
|
||||
}
|
||||
|
||||
sub script_snappymail_version_desc
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"title": "SnappyMail",
|
||||
"description": "Simple, modern & fast web-based email client",
|
||||
"private": true,
|
||||
"version": "2.10.3",
|
||||
"version": "2.11.0",
|
||||
"homepage": "https://snappymail.eu",
|
||||
"author": {
|
||||
"name": "DJ Maze",
|
||||
|
|
|
@ -6,13 +6,10 @@ class ChangePasswordDriverPDO
|
|||
NAME = 'PDO',
|
||||
DESCRIPTION = 'Use your own SQL (PDO) statement (with wildcards).';
|
||||
|
||||
private
|
||||
$dsn = '',
|
||||
$user = '',
|
||||
$pass = '',
|
||||
$sql = '',
|
||||
$encrypt = '',
|
||||
$encrypt_prefix = ''; // Like: {ARGON2I} {BLF-CRYPT} {SHA512-CRYPT}
|
||||
/**
|
||||
* @var \RainLoop\Config\Plugin
|
||||
*/
|
||||
private $oConfig = null;
|
||||
|
||||
/**
|
||||
* @var \MailSo\Log\Logger
|
||||
|
@ -21,13 +18,8 @@ class ChangePasswordDriverPDO
|
|||
|
||||
function __construct(\RainLoop\Config\Plugin $oConfig, \MailSo\Log\Logger $oLogger)
|
||||
{
|
||||
$this->oConfig = $oConfig;
|
||||
$this->oLogger = $oLogger;
|
||||
$this->dsn = $oConfig->Get('plugin', 'pdo_dsn', '');
|
||||
$this->user = $oConfig->Get('plugin', 'pdo_user', '');
|
||||
$this->pass = $oConfig->Get('plugin', 'pdo_password', '');
|
||||
$this->sql = $oConfig->Get('plugin', 'pdo_sql', '');
|
||||
$this->encrypt = $oConfig->Get('plugin', 'pdo_encrypt', '');
|
||||
$this->encrypt_prefix = $oConfig->Get('plugin', 'pdo_encryptprefix', '');
|
||||
}
|
||||
|
||||
public static function isSupported() : bool
|
||||
|
@ -52,43 +44,57 @@ class ChangePasswordDriverPDO
|
|||
->SetDefaultValue(array('none', 'bcrypt', 'Argon2i', 'Argon2id', 'SHA256-CRYPT', 'SHA512-CRYPT'))
|
||||
->SetDescription('In what way do you want the passwords to be encrypted?'),
|
||||
\RainLoop\Plugins\Property::NewInstance('pdo_encryptprefix')->SetLabel('Encrypt prefix')
|
||||
->SetDescription('Optional encrypted password prefix, like: {BLF-CRYPT}'),
|
||||
->SetDescription('Optional encrypted password prefix, like {ARGON2I} or {BLF-CRYPT} or {SHA512-CRYPT}')
|
||||
);
|
||||
}
|
||||
|
||||
public function ChangePassword(\RainLoop\Model\Account $oAccount, string $sPrevPassword, string $sNewPassword) : bool
|
||||
{
|
||||
$options = array(
|
||||
\PDO::ATTR_EMULATE_PREPARES => true,
|
||||
\PDO::ATTR_PERSISTENT => true,
|
||||
\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION
|
||||
);
|
||||
try
|
||||
{
|
||||
$conn = new \PDO(
|
||||
$this->oConfig->Get('plugin', 'pdo_dsn', ''),
|
||||
$this->oConfig->Get('plugin', 'pdo_user', ''),
|
||||
$this->oConfig->Get('plugin', 'pdo_password', ''),
|
||||
array(
|
||||
\PDO::ATTR_EMULATE_PREPARES => true,
|
||||
\PDO::ATTR_PERSISTENT => true,
|
||||
\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION
|
||||
)
|
||||
);
|
||||
|
||||
$conn = new \PDO($this->dsn, $this->user, $this->pass, $options);
|
||||
$sEmail = $oAccount->Email();
|
||||
$encrypt = $this->oConfig->Get('plugin', 'pdo_encrypt', '');
|
||||
$encrypt_prefix = $this->oConfig->Get('plugin', 'pdo_encryptprefix', '');
|
||||
|
||||
//prepare SQL varaibles
|
||||
$sEmail = $oAccount->Email();
|
||||
$sEmailUser = \MailSo\Base\Utils::GetAccountNameFromEmail($sEmail);
|
||||
$sEmailDomain = \MailSo\Base\Utils::GetDomainFromEmail($sEmail);
|
||||
$placeholders = array(
|
||||
':email' => $sEmail,
|
||||
':oldpass' => $encrypt_prefix . \ChangePasswordPlugin::encrypt($encrypt, $sPrevPassword),
|
||||
':newpass' => $encrypt_prefix . \ChangePasswordPlugin::encrypt($encrypt, $sNewPassword),
|
||||
':domain' => \MailSo\Base\Utils::GetDomainFromEmail($sEmail),
|
||||
':username' => \MailSo\Base\Utils::GetAccountNameFromEmail($sEmail)
|
||||
);
|
||||
|
||||
$placeholders = array(
|
||||
':email' => $sEmail,
|
||||
':oldpass' => $this->encrypt_prefix . \ChangePasswordPlugin::encrypt($this->encrypt, $sPrevPassword),
|
||||
':newpass' => $this->encrypt_prefix . \ChangePasswordPlugin::encrypt($this->encrypt, $sNewPassword),
|
||||
':domain' => $sEmailDomain,
|
||||
':username' => $sEmailUser
|
||||
);
|
||||
$sql = $this->oConfig->Get('plugin', 'pdo_sql', '');
|
||||
|
||||
$statement = $conn->prepare($this->sql);
|
||||
$statement = $conn->prepare($sql);
|
||||
|
||||
// we have to check that all placehoders are used in the query, passing any unused placeholders will generate an error
|
||||
foreach ($placeholders as $placeholder => $value) {
|
||||
if (\preg_match_all("/{$placeholder}(?![a-zA-Z0-9\-])/", $this->sql)) {
|
||||
$statement->bindValue($placeholder, $value);
|
||||
// we have to check that all placehoders are used in the query, passing any unused placeholders will generate an error
|
||||
foreach ($placeholders as $placeholder => $value) {
|
||||
if (\preg_match_all("/{$placeholder}(?![a-zA-Z0-9\-])/", $sql)) {
|
||||
$statement->bindValue($placeholder, $value);
|
||||
}
|
||||
}
|
||||
|
||||
// and execute
|
||||
return !!$statement->execute();
|
||||
}
|
||||
catch (\Exception $oException)
|
||||
{
|
||||
if ($this->oLogger) {
|
||||
$this->oLogger->WriteException($oException);
|
||||
}
|
||||
}
|
||||
|
||||
// and execute
|
||||
return !!$statement->execute();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -276,6 +276,7 @@ class MailClient
|
|||
}
|
||||
|
||||
$aFetchResponse = $this->oImapClient->Fetch(array(
|
||||
// FetchType::BINARY_SIZE.'['.$sMimeIndex.']',
|
||||
// Push in the aFetchCallbacks array and then called by \MailSo\Imap\Traits\ResponseParser::partialResponseLiteralCallbackCallable
|
||||
array(
|
||||
$sPeek.'['.$sMimeIndex.']',
|
||||
|
|
Loading…
Reference in a new issue