Skip to content

Commit 74de008

Browse files
committed
Set-up IMAP in Azure
1 parent b40ffa9 commit 74de008

File tree

9 files changed

+58
-9
lines changed

9 files changed

+58
-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: 8 additions & 0 deletions
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

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: 33 additions & 0 deletions
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

Lines changed: 1 addition & 0 deletions
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

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: 6 additions & 0 deletions
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

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/debug/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)