Skip to content

Commit

Permalink
mail/snappymail: Fix error while accessing admin page
Browse files Browse the repository at this point in the history
On a fresh installation, the admin page returns a 500 error, indicating
a web server error. The logs reveal what the problem is, which is already
fixed in upstream [1], but until a new version of snappymail is released,
the user will see the following error:

```
RainLoop\Config\Application::SetPassword(): Argument #1 ($oPassword) must be of type SnappyMail\SensitiveString, string given, called in /usr/local/www/snappymail/snapp
ymail/v/2.35.2/app/libraries/RainLoop/Actions.php on line 672
```

Reference:	the-djmaze/snappymail#1472 [1]
PR:		277571
MFH:		2024Q1
  • Loading branch information
DtxdF authored and Yasuhiro Kimura committed Mar 8, 2024
1 parent 44b591d commit 396010c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mail/snappymail/Makefile
@@ -1,6 +1,6 @@
PORTNAME= snappymail
DISTVERSION= 2.35.2
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= mail www
MASTER_SITES= https://github.com/the-djmaze/snappymail/releases/download/v${DISTVERSION}/
PKGNAMESUFFIX= ${PHP_PKGNAMESUFFIX}
Expand Down
@@ -0,0 +1,11 @@
--- snappymail/v/2.35.2/app/libraries/RainLoop/Actions.php.orig 2024-03-08 05:14:45 UTC
+++ snappymail/v/2.35.2/app/libraries/RainLoop/Actions.php
@@ -668,7 +668,7 @@ class Actions
$sPassword = \substr(\base64_encode(\random_bytes(16)), 0, 12);
Utils::saveFile($passfile, $sPassword . "\n");
// \chmod($passfile, 0600);
- $oConfig->SetPassword($sPassword);
+ $oConfig->SetPassword(new \SnappyMail\SensitiveString($sPassword));
$oConfig->Save();
}
}

0 comments on commit 396010c

Please sign in to comment.