Skip to content

Commit ef9359d

Browse files
committed
Set-up IMAP in Azure
Closes GH-6162
1 parent 19314ff commit ef9359d

File tree

9 files changed

+58
-7
lines changed

9 files changed

+58
-7
lines changed

azure/apt.yml

+1
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

+3
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ steps:
5858
--enable-dba \
5959
--with-snmp \
6060
--with-unixODBC \
61+
--with-imap \
62+
--with-kerberos \
63+
--with-imap-ssl \
6164
--enable-werror \
6265
--with-config-file-path=/etc \
6366
--with-config-file-scan-dir=/etc/php.d

azure/setup.yml

+8
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,12 @@ steps:
1616
sudo cp ext/snmp/tests/bigtest /etc/snmp
1717
sudo service snmpd restart
1818
displayName: 'Configure snmpd'
19+
- script: |
20+
set -e
21+
sudo groupadd -g 5000 vmail
22+
sudo useradd -m -d /var/vmail -s /bin/false -u 5000 -g vmail vmail
23+
sudo cp ext/imap/tests/dovecot.conf /etc/dovecot/dovecot.conf
24+
sudo cp ext/imap/tests/dovecotpass /etc/dovecot/dovecotpass
25+
sudo service dovecot restart
26+
displayName: 'Configure IMAP'
1927

ext/imap/tests/bug75774.phpt

+4-5
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

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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_username_format = %u
11+
auth_debug = yes
12+
auth_verbose = yes
13+
#log
14+
log_path = /var/log/dovecot.log
15+
# If not set, use the value from log_path
16+
info_log_path = /var/log/dovecot-info.log
17+
# If not set, use the value from info_log_path
18+
debug_log_path = /var/log/dovecot-debug.log
19+
## Mailbox locations and namespaces
20+
mail_location = maildir:/var/vmail/dovecot/mail/%d/%n/Maildir
21+
passdb {
22+
args = scheme=cram-md5 /etc/dovecot/dovecotpass
23+
driver = passwd-file
24+
}
25+
protocols = imap
26+
service auth {
27+
user = root
28+
}
29+
userdb {
30+
args = /etc/dovecot/dovecotpass
31+
driver = passwd-file
32+
override_fields = home=/var/vmail/dovecot/mail/%d/%n
33+
}

ext/imap/tests/dovecotpass

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[email protected]:{CRAM-MD5}be5f3177e9c7c06403272f25d983ba630df4ef40476b353bb3087a8401713451:vmail:vmail

ext/imap/tests/imap_include.inc

+1-1
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

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
sudo service dovecot stop
2+
sudo groupadd -g 5000 vmail
3+
sudo useradd -m -d /var/vmail -s /bin/false -u 5000 -g vmail vmail
4+
sudo cp ext/imap/tests/dovecot.conf /etc/dovecot/dovecot.conf
5+
sudo cp ext/imap/tests/dovecotpass /etc/dovecot/dovecotpass
6+
sudo service dovecot start

ext/imap/tests/skipif.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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/debug/norsh}';
66
$username = '[email protected]';
77
$password = 'p4ssw0rd';
88
$options = OP_HALFOPEN; // this should be enough to verify server present

0 commit comments

Comments
 (0)