Prevent using invalid bounce email address

[MAILPOET-2933]
This commit is contained in:
Rostislav Wolny
2021-01-08 15:38:38 +01:00
committed by Veljko V
parent 6c63a562d1
commit 03400bc4f7
2 changed files with 25 additions and 4 deletions

View File

@@ -201,6 +201,16 @@ class MailerTest extends \MailPoetTest {
expect($result['response'])->true();
}
public function testItIgnoresInvalidBounceAddress() {
$this->settings->set('bounce.address', 'ok@address.com');
$mailer = new Mailer();
$mailer->init($this->mailer, $this->sender, $this->replyTo);
expect($mailer->returnPath)->equals('ok@address.com');
$this->settings->set('bounce.address', 'invalid');
$mailer->init($this->mailer, $this->sender, $this->replyTo);
expect($mailer->returnPath)->null();
}
public function _after() {
$this->diContainer->get(SettingsRepository::class)->truncate();
}