Skip to content

Test IMAP on Azure #6162

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions azure/apt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
3 changes: 3 additions & 0 deletions azure/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions azure/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

1 change: 1 addition & 0 deletions ext/imap/tests/CONFLICTS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
imap
9 changes: 4 additions & 5 deletions ext/imap/tests/bug75774.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ extension_loaded('imap') or die('skip imap extension not available in this build
<?php

$fn = __DIR__ . DIRECTORY_SEPARATOR . "foo75774";
$var1=fopen($fn, "w");
$var1 = fopen($fn, "w");

try {
imap_append($var1, "", "", "", "");
} catch (Throwable $e) {
echo "\nException: " . $e->getMessage() . "\n";
} catch (\TypeError $e) {
echo $e->getMessage() . "\n";
}

fclose($var1);
Expand All @@ -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
33 changes: 33 additions & 0 deletions ext/imap/tests/dovecot.conf
Original file line number Diff line number Diff line change
@@ -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
}
1 change: 1 addition & 0 deletions ext/imap/tests/dovecotpass
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[email protected]:{CRAM-MD5}be5f3177e9c7c06403272f25d983ba630df4ef40476b353bb3087a8401713451:vmail:vmail
18 changes: 1 addition & 17 deletions ext/imap/tests/imap_body.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,11 @@ require_once(__DIR__.'/skipif.inc');
?>
--FILE--
<?php
echo "Checking with no parameters\n";
imap_body();

echo "Checking with incorrect parameter type\n";
imap_body('');
imap_body(false);
require_once(__DIR__.'/imap_include.inc');
$stream_id = imap_open($default_mailbox, $username, $password) or
die("Cannot connect to mailbox $default_mailbox: " . imap_last_error());
imap_body($stream_id);

imap_body($stream_id,-1);
imap_body($stream_id,1,-1);

Expand All @@ -29,17 +24,6 @@ imap_close($stream_id);

?>
--EXPECTF--
Checking with no parameters

Warning: imap_body() expects at least 2 parameters, 0 given in %s on line %d
Checking with incorrect parameter type

Warning: imap_body() expects at least 2 parameters, 1 given in %s on line %d

Warning: imap_body() expects at least 2 parameters, 1 given in %s on line %d

Warning: imap_body() expects at least 2 parameters, 1 given in %s on line %d

Warning: imap_body(): Bad message number in %s on line %d

Warning: imap_body(): Invalid value for the options parameter in %s on line %d
Expand Down
2 changes: 1 addition & 1 deletion ext/imap/tests/imap_fetch_overview_variation3.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ imap_fetch_overview() returns an object
Testing with option value:bool(true)
imap_fetch_overview() returns an object

Testing with option value:float(1)
Testing with option value:float(1.000000000000001)
imap_fetch_overview() returns an object

Testing with option value:float(1)
Expand Down
16 changes: 4 additions & 12 deletions ext/imap/tests/imap_fetchbody_variation6.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ require_once(__DIR__.'/imap_include.inc');
$stream_id = setup_test_mailbox('', 3); // set up temp mailbox with simple msgs
$section = 1;

$sequences = array (0, 4, // out of range
'1,3', '1:3', // message sequences instead of numbers
);
$sequences = [0, /* out of range */ 4, 1];

foreach($sequences as $msg_no) {
echo "\n-- \$msg_no is $msg_no --\n";
Expand Down Expand Up @@ -52,12 +50,6 @@ Warning: imap_fetchbody(): Bad message number in %s on line %d
bool(false)


-- $msg_no is 1,3 --

Notice: A non well formed numeric value encountered in %s on line %d
string(%d) "1: this is a test message, please ignore%a"

-- $msg_no is 1:3 --

Notice: A non well formed numeric value encountered in %s on line %d
string(%d) "1: this is a test message, please ignore%a"
-- $msg_no is 1 --
string(42) "1: this is a test message, please ignore
"
23 changes: 4 additions & 19 deletions ext/imap/tests/imap_fetchheader_variation5.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ require_once(__DIR__.'/imap_include.inc');

$stream_id = setup_test_mailbox('', 3, $mailbox, 'notSimple'); // set up temp mailbox with 3 msgs

$sequences = array (0, 4, // out of range
'1,3', '1:3', // message sequences instead of numbers
);
$sequences = [0, /* out of range */ 4, 1];

foreach($sequences as $msg_no) {
echo "\n-- \$msg_no is $msg_no --\n";
Expand Down Expand Up @@ -53,24 +51,11 @@ Warning: imap_fetchheader(): Bad message number in %s on line %d
bool(false)


-- $msg_no is 1,3 --

Notice: A non well formed numeric value encountered in %s on line %d
string(%d) "From: [email protected]
Subject: Test msg 1
To: %s
MIME-Version: 1.0
Content-Type: MULTIPART/mixed; BOUNDARY="%s"

"

-- $msg_no is 1:3 --

Notice: A non well formed numeric value encountered in %s on line %d
-- $msg_no is 1 --
string(%d) "From: [email protected]
Subject: Test msg 1
To: %s
To: [email protected]
MIME-Version: 1.0
Content-Type: MULTIPART/mixed; BOUNDARY="%s"
Content-Type: MULTIPART/mixed; BOUNDARY="%s=:%d"

"
19 changes: 1 addition & 18 deletions ext/imap/tests/imap_fetchstructure_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,10 @@ require_once(__DIR__.'/skipif.inc');
?>
--FILE--
<?php
echo "Checking with no parameters\n";
imap_fetchstructure();

echo "Checking with incorrect parameter type\n";
imap_fetchstructure('');
imap_fetchstructure(false);

require_once(__DIR__.'/imap_include.inc');
$stream_id = setup_test_mailbox('', 1);

imap_fetchstructure($stream_id);
imap_fetchstructure($stream_id,0);

$z = imap_fetchstructure($stream_id,1);
Expand All @@ -44,18 +37,8 @@ imap_close($stream_id);
require_once('clean.inc');
?>
--EXPECTF--
Checking with no parameters

Warning: imap_fetchstructure() expects at least 2 parameters, 0 given in %s on line %d
Checking with incorrect parameter type

Warning: imap_fetchstructure() expects at least 2 parameters, 1 given in %s on line %d

Warning: imap_fetchstructure() expects at least 2 parameters, 1 given in %s on line %d
Create a temporary mailbox and add 1 msgs
.. mailbox '{%s}%s' created

Warning: imap_fetchstructure() expects at least 2 parameters, 1 given in %s on line %d
.. mailbox '{127.0.0.1:143/norsh}INBOX.phpttest' created
bool(true)
bool(true)
bool(true)
Expand Down
15 changes: 0 additions & 15 deletions ext/imap/tests/imap_gc_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ require_once(__DIR__.'/skipif.inc');
?>
--FILE--
<?php
echo "Checking with no parameters\n";
imap_gc();

echo "Checking with incorrect parameter type\n";
imap_gc('', false);
imap_gc(false, false);

require_once(__DIR__.'/imap_include.inc');
$stream_id = imap_open($default_mailbox, $username, $password) or
Expand All @@ -23,13 +17,4 @@ imap_gc($stream_id, -1);

?>
--EXPECTF--
Checking with no parameters

Warning: imap_gc() Expects exactly 2 parameters, 0 given in %s on line %d
Checking with incorrect parameter type

Warning: imap_gc(): Argument #1 must be of type resource, string given in %s on line %d

Warning: imap_gc(): Argument #1 must be of type resource, bool given in %s on line %d

Warning: imap_gc(): Invalid value for the flags parameter in %s on line %d
20 changes: 0 additions & 20 deletions ext/imap/tests/imap_getsubscribed_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,11 @@ require_once(__DIR__.'/skipif.inc');
?>
--FILE--
<?php
echo "Checking with no parameters\n";
imap_getsubscribed();

echo "Checking with incorrect parameter type\n";
imap_getsubscribed('');
imap_getsubscribed(false);

require_once(__DIR__.'/imap_include.inc');
$stream_id = imap_open($default_mailbox, $username, $password) or
die("Cannot connect to mailbox $default_mailbox: " . imap_last_error());

imap_getsubscribed($stream_id);
imap_getsubscribed($stream_id,$default_mailbox);
var_dump(imap_getsubscribed($stream_id,$default_mailbox,'ezDvfXvbvcxSerz'));


Expand All @@ -43,18 +35,6 @@ imap_close($stream_id);
require_once('clean.inc');
?>
--EXPECTF--
Checking with no parameters

Warning: imap_getsubscribed() expects exactly 3 parameters, 0 given in %s on line %d
Checking with incorrect parameter type

Warning: imap_getsubscribed() expects exactly 3 parameters, 1 given in %s on line %d

Warning: imap_getsubscribed() expects exactly 3 parameters, 1 given in %s on line %d

Warning: imap_getsubscribed() expects exactly 3 parameters, 1 given in %s on line %d

Warning: imap_getsubscribed() expects exactly 3 parameters, 2 given in %s on line %d
bool(false)
Checking OK
bool(true)
Expand Down
2 changes: 1 addition & 1 deletion ext/imap/tests/imap_include.inc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
// Change these to make tests run successfully
$server = '{127.0.0.1/norsh}';
$server = '{127.0.0.1:143/norsh}';
$default_mailbox = $server . "INBOX";
$domain = "something.com";
$admin_user = "webmaster"; // a user with admin access
Expand Down
20 changes: 0 additions & 20 deletions ext/imap/tests/imap_list_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,11 @@ require_once(__DIR__.'/skipif.inc');
?>
--FILE--
<?php
echo "Checking with no parameters\n";
imap_list();

echo "Checking with incorrect parameter type\n";
imap_list('');
imap_list(false);

require_once(__DIR__.'/imap_include.inc');
$stream_id = imap_open($default_mailbox, $username, $password) or
die("Cannot connect to mailbox $default_mailbox: " . imap_last_error());

imap_list($stream_id);
imap_list($stream_id,$default_mailbox);
imap_list($stream_id,$default_mailbox,'ezerz');


Expand All @@ -31,17 +23,5 @@ var_dump($z[0]);
imap_close($stream_id);
?>
--EXPECTF--
Checking with no parameters

Warning: imap_list() expects exactly 3 parameters, 0 given in %s on line %d
Checking with incorrect parameter type

Warning: imap_list() expects exactly 3 parameters, 1 given in %s on line %d

Warning: imap_list() expects exactly 3 parameters, 1 given in %s on line %d

Warning: imap_list() expects exactly 3 parameters, 1 given in %s on line %d

Warning: imap_list() expects exactly 3 parameters, 2 given in %s on line %d
bool(true)
string(%s) "{%s}%s"
20 changes: 0 additions & 20 deletions ext/imap/tests/imap_lsub_basic.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,11 @@ require_once(__DIR__.'/skipif.inc');
?>
--FILE--
<?php
echo "Checking with no parameters\n";
imap_lsub();

echo "Checking with incorrect parameter type\n";
imap_lsub('');
imap_lsub(false);

require_once(__DIR__.'/imap_include.inc');
$stream_id = imap_open($default_mailbox, $username, $password) or
die("Cannot connect to mailbox $default_mailbox: " . imap_last_error());

imap_lsub($stream_id);
imap_lsub($stream_id,$default_mailbox);
var_dump(imap_lsub($stream_id,$default_mailbox,'ezDvfXvbvcxSerz'));


Expand All @@ -43,18 +35,6 @@ imap_close($stream_id);
require_once('clean.inc');
?>
--EXPECTF--
Checking with no parameters

Warning: imap_lsub() expects exactly 3 parameters, 0 given in %s on line %d
Checking with incorrect parameter type

Warning: imap_lsub() expects exactly 3 parameters, 1 given in %s on line %d

Warning: imap_lsub() expects exactly 3 parameters, 1 given in %s on line %d

Warning: imap_lsub() expects exactly 3 parameters, 1 given in %s on line %d

Warning: imap_lsub() expects exactly 3 parameters, 2 given in %s on line %d
bool(false)
Checking OK
bool(true)
Expand Down
Loading