mirror of
https://github.com/roundcube/roundcubemail.git
synced 2026-02-20 01:21:20 +01:00
This moves the warning icon that is triggered by the homograph check from the generic "notification area" (between headers and body) to the header area, before the address that the warning is referring to. The previous warning left it unclear which address was found to be problematic, which now is obvious. Additionally there's now a test to check for these warnings to show up in the DOM.
29 lines
1.4 KiB
PHP
29 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace Tests\MessageRendering;
|
|
|
|
/**
|
|
* Test class to test simple messages.
|
|
*/
|
|
class EmailAdressSpoofingAttacksTest extends MessageRenderingTestCase
|
|
{
|
|
/**
|
|
* Test that two text mime-parts with disposition "attachment" are shown as
|
|
* attachments.
|
|
*/
|
|
public function testEmailAdressSpoofingAttacks()
|
|
{
|
|
$domxpath = $this->runAndGetHtmlOutputDomxpath('1176148a1ed73947311a08a3fc11264e64d8f775eae596e5fa660cfd1684a5e6@example.net');
|
|
$this->assertSame('Email address spoofing attacks', $this->getScrubbedSubject($domxpath));
|
|
|
|
$suspiciousAddressWarnings = $domxpath->query('//span[@class="suspicious-address-warning"]');
|
|
// It should be present three times: two times for the phishing attack in the From header (once in the header
|
|
// summary element, once in the header details element), one time for the homograph attack in the To header.
|
|
$this->assertCount(3, $suspiciousAddressWarnings, 'Sender phishing warning');
|
|
$expectedMsg = 'This message contains suspicious email addresses that may be fraudulent.';
|
|
$this->assertSame($expectedMsg, $suspiciousAddressWarnings[0]->attributes->getNamedItem('title')->textContent);
|
|
$this->assertSame($expectedMsg, $suspiciousAddressWarnings[1]->attributes->getNamedItem('title')->textContent);
|
|
$this->assertSame($expectedMsg, $suspiciousAddressWarnings[2]->attributes->getNamedItem('title')->textContent);
|
|
}
|
|
}
|