Closed Xavious closed 6 years ago
I see. I can't get Sergey to ping. We may have to do a re write
This may be a misunderstanding on my part. Since the advanced configuration isn't really documented, I've been trying to piece it together from the code and it's been a bit of a process.
Yea very sorry. I don't know how it works as he never wrong any in code comments on it.
I think it was probably a misunderstanding on my part. Here's a sample advanced configuration for anyone wanting to use DISABLE_AUTHENTICATOR.
$mailbox = '1.1.1.1';
$username = 'myusername';
$password = 'mypassword';
$params = array('DISABLE_AUTHENTICATOR' => 'GSSAPI');
$encrypt = Imap::ENCRYPT_TLS;
$service = ImapConnect::SERVICE_IMAP;
$certificate = ImapConnect::NOVALIDATE_CERT;
$config = array(
'mailbox' => $mailbox,
'flags' => array(
'encrypt' => $encrypt,
'service' => $service,
'validateCertificates' => $certificate
),
'connect' => array(
'username' => $username,
'password' => $password,
'params' => $params
)
);
try{
//$imap = new Imap($mailbox, $username, $password, $encryption);
$imap = new Imap($config);
// You can also check out example-connect.php for more connection options
}catch (ImapClientException $error){
echo $error->getMessage().PHP_EOL;
die(); // Oh no :( we failed
}
Feature request or bug
Bug
If a bug, what did you expect to happen?
To connect using the parameters provided.
If a bug, what happened?
Using advanced connection parameters is misleading because it throws errors for missing array keys, but it never uses those keys when actually utilizing the connect() method. In fact, I do not see anywhere that the ImapConnect class uses its member variables in conjunction with the methods associated with connecting to the remote server.
If a bug, list steps to reproduce bugs.
Line 180-183 of ImapClient.php:
The methods prepareFlags and prepareMailbox set the ImapConnect class member variables, but those member variables are never actually utilized and not setting them will cause errors to be thrown. Once the method connect() is invoked, it only uses the connection parameters provided in the 'connect' array. So basically the two methods are required, but serve no function in actually connecting to the server.
If a bug, did you do these steps?
[X] Download and use the lastest stable version [X] See if the issue has already been reported [X] Debug
If a feature request, what do you want to be added or changed?
Either use the methods that set the member variables, and actually utilize those member variables, or remove them and allow the connectAdvanced() method to simply use the attributes provided by the 'connect' array.
If a feature request, is this feature already in a pull request?
I don't know
If a feature request, do you know anyone who can help?
Maybe me if I find some time. I just started tinkering with this library.
Side notes(Read then del this chunk)
Example configuration (Note this works, but requires redundant inputs):