From ef9359d30fe3e26de86fd6790d273612c2488dd7 Mon Sep 17 00:00:00 2001 From: George Peter Banyard Date: Thu, 17 Sep 2020 17:22:01 +0200 Subject: [PATCH] Set-up IMAP in Azure Closes GH-6162 --- azure/apt.yml | 1 + azure/configure.yml | 3 +++ azure/setup.yml | 8 ++++++++ ext/imap/tests/bug75774.phpt | 9 ++++----- ext/imap/tests/dovecot.conf | 33 +++++++++++++++++++++++++++++++++ ext/imap/tests/dovecotpass | 1 + ext/imap/tests/imap_include.inc | 2 +- ext/imap/tests/setup.sh | 6 ++++++ ext/imap/tests/skipif.inc | 2 +- 9 files changed, 58 insertions(+), 7 deletions(-) create mode 100644 ext/imap/tests/dovecot.conf create mode 100644 ext/imap/tests/dovecotpass create mode 100644 ext/imap/tests/setup.sh diff --git a/azure/apt.yml b/azure/apt.yml index bd3ba3308e..71f58ce8da 100644 --- a/azure/apt.yml +++ b/azure/apt.yml @@ -42,5 +42,6 @@ steps: snmp-mibs-downloader \ unixodbc-dev \ llvm \ + libc-client-dev libkrb5-dev dovecot-core dovecot-pop3d dovecot-imapd \ ${{ parameters.packages }} displayName: 'APT' diff --git a/azure/configure.yml b/azure/configure.yml index dc7f754eae..0bfbf6d92e 100644 --- a/azure/configure.yml +++ b/azure/configure.yml @@ -58,6 +58,9 @@ steps: --enable-dba \ --with-snmp \ --with-unixODBC \ + --with-imap \ + --with-kerberos \ + --with-imap-ssl \ --enable-werror \ --with-config-file-path=/etc \ --with-config-file-scan-dir=/etc/php.d diff --git a/azure/setup.yml b/azure/setup.yml index 825ca4d5f6..e0b4dc79da 100644 --- a/azure/setup.yml +++ b/azure/setup.yml @@ -16,4 +16,12 @@ steps: sudo cp ext/snmp/tests/bigtest /etc/snmp sudo service snmpd restart displayName: 'Configure snmpd' + - script: | + set -e + sudo groupadd -g 5000 vmail + sudo useradd -m -d /var/vmail -s /bin/false -u 5000 -g vmail vmail + sudo cp ext/imap/tests/dovecot.conf /etc/dovecot/dovecot.conf + sudo cp ext/imap/tests/dovecotpass /etc/dovecot/dovecotpass + sudo service dovecot restart + displayName: 'Configure IMAP' diff --git a/ext/imap/tests/bug75774.phpt b/ext/imap/tests/bug75774.phpt index 42f5a842c3..08883ad8f0 100644 --- a/ext/imap/tests/bug75774.phpt +++ b/ext/imap/tests/bug75774.phpt @@ -8,12 +8,12 @@ extension_loaded('imap') or die('skip imap extension not available in this build getMessage() . "\n"; +} catch (\TypeError $e) { + echo $e->getMessage() . "\n"; } fclose($var1); @@ -22,5 +22,4 @@ unlink($fn); ?> --EXPECTF-- Warning: imap_append(): Internal date not correctly formatted in %s on line %d - -Exception: imap_append(): Supplied resource is not a valid imap resource +imap_append(): supplied resource is not a valid imap resource diff --git a/ext/imap/tests/dovecot.conf b/ext/imap/tests/dovecot.conf new file mode 100644 index 0000000000..c465ba3ce9 --- /dev/null +++ b/ext/imap/tests/dovecot.conf @@ -0,0 +1,33 @@ +# 2.2.33.2 (d6601f4ec): /etc/dovecot/dovecot.conf +# Pigeonhole version 0.4.21 (92477967) +listen = *, :: + +# To make authentication work +ssl = no +disable_plaintext_auth = no + +auth_mechanisms = plain cram-md5 +auth_username_format = %u +auth_debug = yes +auth_verbose = yes +#log +log_path = /var/log/dovecot.log +# If not set, use the value from log_path +info_log_path = /var/log/dovecot-info.log +# If not set, use the value from info_log_path +debug_log_path = /var/log/dovecot-debug.log +## Mailbox locations and namespaces +mail_location = maildir:/var/vmail/dovecot/mail/%d/%n/Maildir +passdb { + args = scheme=cram-md5 /etc/dovecot/dovecotpass + driver = passwd-file +} +protocols = imap +service auth { + user = root +} +userdb { + args = /etc/dovecot/dovecotpass + driver = passwd-file + override_fields = home=/var/vmail/dovecot/mail/%d/%n +} diff --git a/ext/imap/tests/dovecotpass b/ext/imap/tests/dovecotpass new file mode 100644 index 0000000000..86a069fc4f --- /dev/null +++ b/ext/imap/tests/dovecotpass @@ -0,0 +1 @@ +webmaster@something.com:{CRAM-MD5}be5f3177e9c7c06403272f25d983ba630df4ef40476b353bb3087a8401713451:vmail:vmail diff --git a/ext/imap/tests/imap_include.inc b/ext/imap/tests/imap_include.inc index 7de634075a..e57d651697 100644 --- a/ext/imap/tests/imap_include.inc +++ b/ext/imap/tests/imap_include.inc @@ -1,6 +1,6 @@