This repository has been archived by the owner on Nov 8, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1416 from owncloud/test-isbdb-xml-config
test IspDb with real xml data
- Loading branch information
Showing
4 changed files
with
107 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<?php | ||
|
||
/** | ||
* @author Christoph Wurst <[email protected]> | ||
* @author Thomas Müller <[email protected]> | ||
|
@@ -21,11 +22,12 @@ | |
|
||
namespace OCA\Mail\AppInfo; | ||
|
||
use \OCP\AppFramework\App; | ||
use OCP\AppFramework\App; | ||
use OCP\Util; | ||
|
||
class Application extends App { | ||
|
||
public function __construct (array $urlParams=array()) { | ||
public function __construct(array $urlParams = []) { | ||
parent::__construct('mail', $urlParams); | ||
|
||
$container = $this->getContainer(); | ||
|
@@ -42,7 +44,7 @@ public function __construct (array $urlParams=array()) { | |
$container->registerParameter("userFolder", $container->getServer()->getUserFolder($user)); | ||
$container->registerParameter("testSmtp", $testSmtp); | ||
$container->registerParameter("referrer", isset($_SERVER['HTTP_REFERER']) ? : null); | ||
$container->registerParameter("hostname", \OCP\Util::getServerHostName()); | ||
$container->registerParameter("hostname", Util::getServerHostName()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<?php | ||
|
||
/** | ||
* @author Christoph Wurst <[email protected]> | ||
* | ||
|
@@ -17,19 +18,30 @@ | |
* along with this program. If not, see <http://www.gnu.org/licenses/> | ||
* | ||
*/ | ||
|
||
namespace OCA\Mail\Service\AutoConfig; | ||
|
||
use Exception; | ||
use OCA\Mail\Service\Logger; | ||
|
||
class IspDb { | ||
|
||
/** @var Logger */ | ||
private $logger; | ||
private $urls = array( | ||
'https://autoconfig.{DOMAIN}/mail/config-v1.1.xml', | ||
'https://{DOMAIN}/.well-known/autoconfig/mail/config-v1.1.xml', | ||
'https://autoconfig.thunderbird.net/v1.1/{DOMAIN}', | ||
); | ||
|
||
/** @var string[] */ | ||
public function getUrls() { | ||
return [ | ||
'https://autoconfig.{DOMAIN}/mail/config-v1.1.xml', | ||
'https://{DOMAIN}/.well-known/autoconfig/mail/config-v1.1.xml', | ||
'https://autoconfig.thunderbird.net/v1.1/{DOMAIN}', | ||
]; | ||
} | ||
|
||
/** | ||
* @param Logger $logger | ||
* @param string[] $ispUrls | ||
*/ | ||
public function __construct(Logger $logger) { | ||
$this->logger = $logger; | ||
} | ||
|
@@ -84,7 +96,7 @@ public function query($domain, $tryMx = true) { | |
} | ||
|
||
$provider = []; | ||
foreach ($this->urls as $url) { | ||
foreach ($this->getUrls() as $url) { | ||
$url = str_replace("{DOMAIN}", $domain, $url); | ||
$this->logger->debug("IsbDb: querying <$domain> via <$url>"); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<clientConfig version="1.1"> | ||
<emailProvider id="freenet.de"> | ||
<domain>freenet.de</domain> | ||
<displayName>Freenet Mail</displayName> | ||
<displayShortName>Freenet</displayShortName> | ||
<incomingServer type="imap"> | ||
<hostname>mx.freenet.de</hostname> | ||
<port>993</port> | ||
<socketType>SSL</socketType> | ||
<authentication>password-encrypted</authentication> | ||
<username>%EMAILADDRESS%</username> | ||
</incomingServer> | ||
<incomingServer type="pop3"> | ||
<hostname>mx.freenet.de</hostname> | ||
<port>995</port> | ||
<socketType>SSL</socketType> | ||
<authentication>password-cleartext</authentication> | ||
<username>%EMAILADDRESS%</username> | ||
</incomingServer> | ||
<outgoingServer type="smtp"> | ||
<hostname>mx.freenet.de</hostname> | ||
<port>587</port> | ||
<socketType>STARTTLS</socketType> | ||
<authentication>password-encrypted</authentication> | ||
<username>%EMAILADDRESS%</username> | ||
</outgoingServer> | ||
<documentation url="http://email-hilfe.freenet.de/documents/Beitrag/15916/einstellungen-serverdaten-fuer-alle-e-mail-programme"> | ||
<descr lang="de">Allgemeine Beschreibung der Einstellungen</descr> | ||
<descr lang="en">Generic settings page</descr> | ||
</documentation> | ||
<documentation url="http://email-hilfe.freenet.de/documents/Beitrag/15808/thunderbird-e-mail-empfang-versand-einrichten-ueber-imap"> | ||
<descr lang="de">TB 2.0 IMAP-Einstellungen</descr> | ||
<descr lang="en">TB 2.0 IMAP settings</descr> | ||
</documentation> | ||
</emailProvider> | ||
</clientConfig> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters