Skip to content

Commit 37f1b74

Browse files
committed
Set-up IMAP in Azure
1 parent 9e94bcf commit 37f1b74

File tree

8 files changed

+47
-9
lines changed

8 files changed

+47
-9
lines changed

azure/apt.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,6 @@ steps:
4242
snmp-mibs-downloader \
4343
unixodbc-dev \
4444
llvm \
45+
libc-client-dev libkrb5-dev dovecot-core dovecot-pop3d dovecot-imapd \
4546
${{ parameters.packages }}
4647
displayName: 'APT'

azure/configure.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,6 @@ steps:
6060
--with-unixODBC \
6161
--enable-werror \
6262
--with-config-file-path=/etc \
63-
--with-config-file-scan-dir=/etc/php.d
63+
--with-config-file-scan-dir=/etc/php.d \
64+
--with-imap --with-kerberos --with-imap-ssl
6465
displayName: 'Configure Build'

azure/setup.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ steps:
1010
displayName: 'Setup'
1111
- script: ./azure/setup-slapd.sh
1212
displayName: 'Configure slapd'
13+
- script: |
14+
set -e
15+
sudo cp ext/imap/tests/dovecot.conf /etc/dovecot/dovecot.conf
16+
sudo cp ext/imap/tests/dovecotpass /etc/dovecot/dovecotpass
17+
sudo service dovecot restart
18+
displayName: 'Configure IMAP'
1319
- script: |
1420
set -e
1521
sudo cp ext/snmp/tests/snmpd.conf /etc/snmp

ext/imap/tests/bug75774.phpt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ extension_loaded('imap') or die('skip imap extension not available in this build
88
<?php
99

1010
$fn = __DIR__ . DIRECTORY_SEPARATOR . "foo75774";
11-
$var1=fopen($fn, "w");
11+
$var1 = fopen($fn, "w");
1212

1313
try {
1414
imap_append($var1, "", "", "", "");
15-
} catch (Throwable $e) {
16-
echo "\nException: " . $e->getMessage() . "\n";
15+
} catch (\TypeError $e) {
16+
echo $e->getMessage() . "\n";
1717
}
1818

1919
fclose($var1);
@@ -22,5 +22,4 @@ unlink($fn);
2222
?>
2323
--EXPECTF--
2424
Warning: imap_append(): Internal date not correctly formatted in %s on line %d
25-
26-
Exception: imap_append(): Supplied resource is not a valid imap resource
25+
imap_append(): supplied resource is not a valid imap resource

ext/imap/tests/dovecot.conf

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# 2.2.33.2 (d6601f4ec): /etc/dovecot/dovecot.conf
2+
# Pigeonhole version 0.4.21 (92477967)
3+
listen = *, ::
4+
5+
# To make authentication work
6+
ssl = no
7+
disable_plaintext_auth = no
8+
9+
auth_mechanisms = plain cram-md5
10+
auth_debug = yes
11+
auth_verbose = yes
12+
## Mailbox locations and namespaces
13+
mail_location = maildir:/home/vmail/mail/%d/%n/Maildir
14+
passdb {
15+
args = /etc/dovecot/dovecotpass
16+
driver = passwd-file
17+
}
18+
protocols = imap
19+
service auth {
20+
user = root
21+
}
22+
userdb {
23+
driver = passwd-file
24+
args = blocking=no
25+
override_fields = uid=11459 gid=1002 home=/home/vmail/dovecot/mail/%d/%n
26+
}
27+

ext/imap/tests/imap_include.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
// Change these to make tests run successfully
3-
$server = '{127.0.0.1/norsh}';
3+
$server = '{127.0.0.1:143/norsh}';
44
$default_mailbox = $server . "INBOX";
55
$domain = "something.com";
66
$admin_user = "webmaster"; // a user with admin access

ext/imap/tests/setup.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
sudo service dovecot stop
2+
sudo cp ext/imap/tests/dovecot.conf /etc/dovecot/dovecot.conf
3+
sudo cp ext/imap/tests/dovecotpass /etc/dovecot/dovecotpass
4+
sudo service dovecot start

ext/imap/tests/skipif.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
extension_loaded('imap') or die('skip imap extension not available in this build');
33

44
// Change these to make tests run successfully
5-
$mailbox = '{localhost/norsh}';
5+
$mailbox = '{127.0.0.1:143/norsh}';
66
$username = '[email protected]';
77
$password = 'p4ssw0rd';
88
$options = OP_HALFOPEN; // this should be enough to verify server present
99
$retries = 0; // don't retry connect on failure
1010

11-
$mbox = @imap_open($mailbox, $username, $password, $options, $retries);
11+
$mbox = imap_open($mailbox, $username, $password, $options, $retries);
1212
if (!$mbox) {
1313
die("skip could not connect to mailbox $mailbox");
1414
}

0 commit comments

Comments
 (0)