Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117859609
D5340.1775318397.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
3 KB
Referenced Files
None
Subscribers
None
D5340.1775318397.diff
View Options
diff --git a/kolabctl b/kolabctl
--- a/kolabctl
+++ b/kolabctl
@@ -356,7 +356,7 @@
echo "All containers are available"
# We skip mollie and openexchange
- podman exec $POD-webapp env APP_DEBUG=false ./artisan status:health --user="$ADMIN_USER" --password="$ADMIN_PASSWORD" --check DB --check Redis --check IMAP --check Roundcube --check Meet --check DAV --check Auth
+ podman exec $POD-webapp env APP_DEBUG=false ./artisan status:health --user="$ADMIN_USER" --password="$ADMIN_PASSWORD" --check DB --check Redis --check IMAP --check Roundcube --check Meet --check DAV --check Auth --check SMTP
echo "Checking postfix authentication"
podman exec $POD-postfix testsaslauthd -u "$ADMIN_USER" -p "$ADMIN_PASSWORD"
echo "Checking imap authentication"
diff --git a/src/app/Console/Commands/Status/Health.php b/src/app/Console/Commands/Status/Health.php
--- a/src/app/Console/Commands/Status/Health.php
+++ b/src/app/Console/Commands/Status/Health.php
@@ -27,7 +27,7 @@
* @var string
*/
protected $signature = 'status:health
- {--check=* : One of DB, Redis, IMAP, LDAP, Roundcube, Meet, DAV, Mollie, OpenExchangeRates, Storage, Auth}
+ {--check=* : One of DB, Redis, IMAP, LDAP, Roundcube, Meet, DAV, Mollie, OpenExchangeRates, Storage, Auth, SMTP}
{--user= : Test user (for Auth test)}
{--password= : Password of test user}';
@@ -41,7 +41,7 @@
private function checkDB()
{
try {
- $result = DB::select("SELECT 1");
+ DB::select("SELECT 1");
return true;
} catch (\Exception $exception) {
$this->line($exception);
@@ -102,6 +102,21 @@
}
}
+ private function checkSMTP()
+ {
+ try {
+ \App\Mail\Helper::sendMail(
+ new \App\Mail\Test(),
+ null,
+ ["to" => [$this->option('user')]]
+ );
+ return true;
+ } catch (\Exception $exception) {
+ $this->line($exception);
+ return false;
+ }
+ }
+
private function checkAuth()
{
try {
@@ -185,6 +200,7 @@
];
if (!empty($this->option('user'))) {
array_unshift($steps, 'Auth');
+ array_unshift($steps, 'SMTP');
}
if (\config('app.with_ldap')) {
array_unshift($steps, 'LDAP');
diff --git a/src/app/Mail/Test.php b/src/app/Mail/Test.php
new file mode 100644
--- /dev/null
+++ b/src/app/Mail/Test.php
@@ -0,0 +1,33 @@
+<?php
+
+namespace App\Mail;
+
+class Test extends Mailable
+{
+ /**
+ * Build the message.
+ *
+ * @return $this
+ */
+ public function build()
+ {
+ $this->text('emails.plain.test')
+ ->subject("Kolab Email Test");
+
+ return $this;
+ }
+
+ /**
+ * Render the mail template with fake data
+ *
+ * @param string $type Output format ('html' or 'text')
+ *
+ * @return string HTML or Plain Text output
+ */
+ public static function fakeRender(string $type = 'text'): string
+ {
+ $mail = new self();
+
+ return Helper::render($mail, $type);
+ }
+}
diff --git a/src/resources/views/emails/plain/test.blade.php b/src/resources/views/emails/plain/test.blade.php
new file mode 100644
--- /dev/null
+++ b/src/resources/views/emails/plain/test.blade.php
@@ -0,0 +1,2 @@
+This is a test.
+
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Apr 4, 3:59 PM (4 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18830281
Default Alt Text
D5340.1775318397.diff (3 KB)
Attached To
Mode
D5340: SMTP support for status:health
Attached
Detach File
Event Timeline