Skip to content

Commit d579d62

Browse files
committed
fix!: remove mail transport php-mail
Signed-off-by: Daniel Kesselberg <[email protected]>
1 parent c4d9e4a commit d579d62

File tree

4 files changed

+4
-44
lines changed

4 files changed

+4
-44
lines changed

doc/admin.md

+4
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ Configure how often Mail keeps users' mailboxes updated in the background in sec
5757
```
5858

5959
### Use php-mail for sending mail
60+
61+
> [!WARNING]
62+
> Support for using php-mail will be removed with Mail 4.4
63+
6064
You can use the php-mail function to send mails. This is needed for some webhosters (1&1 (1und1)):
6165
```php
6266
'app.mail.transport' => 'php-mail'

lib/SMTP/SmtpClientFactory.php

-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
namespace OCA\Mail\SMTP;
1111

1212
use Horde_Mail_Transport;
13-
use Horde_Mail_Transport_Mail;
1413
use Horde_Mail_Transport_Smtphorde;
1514
use Horde_Smtp_Password_Xoauth2;
1615
use OCA\Mail\Account;
@@ -43,10 +42,6 @@ public function __construct(IConfig $config,
4342
*/
4443
public function create(Account $account): Horde_Mail_Transport {
4544
$mailAccount = $account->getMailAccount();
46-
$transport = $this->config->getSystemValue('app.mail.transport', 'smtp');
47-
if ($transport === 'php-mail') {
48-
return new Horde_Mail_Transport_Mail();
49-
}
5045

5146
$decryptedPassword = null;
5247
if ($mailAccount->getOutboundPassword() !== null) {

lib/SystemConfig.php

-25
This file was deleted.

tests/Unit/SMTP/SmtpClientFactoryTest.php

-14
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
namespace OCA\Mail\Tests\Unit\Smtp;
1111

1212
use ChristophWurst\Nextcloud\Testing\TestCase;
13-
use Horde_Mail_Transport_Mail;
1413
use Horde_Mail_Transport_Smtphorde;
1514
use OCA\Mail\Account;
1615
use OCA\Mail\Db\MailAccount;
@@ -43,19 +42,6 @@ protected function setUp(): void {
4342
$this->factory = new SmtpClientFactory($this->config, $this->crypto, $this->hostNameFactory);
4443
}
4544

46-
public function testPhpMailTransport() {
47-
$account = $this->createMock(Account::class);
48-
$this->config->expects($this->once())
49-
->method('getSystemValue')
50-
->with('app.mail.transport', 'smtp')
51-
->willReturn('php-mail');
52-
53-
$transport = $this->factory->create($account);
54-
55-
$this->assertNotNull($transport);
56-
$this->assertInstanceOf(Horde_Mail_Transport_Mail::class, $transport);
57-
}
58-
5945
public function testSmtpTransport() {
6046
$mailAccount = new MailAccount([
6147
'smtpHost' => 'smtp.domain.tld',

0 commit comments

Comments
 (0)