php-src/appveyor/setup_hmailserver.php
Christoph M. Becker d2bb59cc66
Test standard mail and imap on Windows CI
We setup the currently latest version of hMailServer[1] as mail server,
and configure according to imap_include.inc.  To not require further
configuration, we adapt mail_skipif.inc and mail_include.inc to match
that configuration.  However, we also change the default domain to the
reserved `example.com`.

We also update the standard mail tests to use the `--EXTENSIONS--`
section (instead of skipping the tests if ext/imap is not available).

Finally, we fix bug80751.phpt to expect the configured To and Cc mail
addresses.

[1] <https://www.hmailserver.com/>

Closes GH-8357.
2022-05-12 14:58:22 +02:00

22 lines
544 B
PHP

<?php
require __DIR__ . "/../ext/imap/tests/setup/imap_include.inc";
$hmail = new COM("hMailServer.Application");
$hmail->authenticate("Administrator", "");
$domain = $hmail->Domains->Add();
$domain->Name = IMAP_MAIL_DOMAIN;
$domain->Active = true;
$domain->Save();
$accounts = $domain->accounts();
foreach (IMAP_USERS as $user) {
$account = $accounts->Add();
$account->Address = "$user@" . IMAP_MAIL_DOMAIN;
$account->Password = IMAP_MAILBOX_PASSWORD;
$account->Active = true;
$account->Save();
}