Skip to content
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

[BUG] in Mailbox::setConnectionArgs() #313

Closed
olegbaturin opened this issue May 8, 2019 · 1 comment
Closed

[BUG] in Mailbox::setConnectionArgs() #313

olegbaturin opened this issue May 8, 2019 · 1 comment
Assignees
Labels
needs investigation This will be tested / debugged or checked out.

Comments

@olegbaturin
Copy link

Describe the bug
Exception if setting only $retriesNum and leave $options = 0.

public function setConnectionArgs($options = 0, $retriesNum = 0, $params = null)
$supported_options = array(OP_READONLY, OP_ANONYMOUS, OP_HALFOPEN, CL_EXPUNGE, OP_DEBUG, OP_SHORTCACHE, OP_SILENT, OP_PROTOTYPE, OP_SECURE);
if(!in_array($options, $supported_options)) {
throw new InvalidParameterException('');
}

To Reproduce
$mailbox->setConnectionArgs(0, 3, []);

Expected behavior
Skip setting $options if 0

@olegbaturin olegbaturin added the needs investigation This will be tested / debugged or checked out. label May 8, 2019
@olegbaturin olegbaturin changed the title [BUG] A short description of what the bug is [BUG] in Mailbox::setConnectionArgs() May 8, 2019
@Sebbo94BY Sebbo94BY self-assigned this May 8, 2019
@Sebbo94BY
Copy link
Collaborator

I've fixed this issue with the above reference commit.

Possible function calls will be:

// Change $options (integer and constants are possible)
$mailbox->setConnectionArgs(2);
$mailbox->setConnectionArgs(OP_READONLY);

// Change $options and $retriesNum
$mailbox->setConnectionArgs(2, 3);
$mailbox->setConnectionArgs(OP_READONLY, 3);

// Change $options, $retriesNum and $params
$mailbox->setConnectionArgs(0, 3, ['DISABLE_AUTHENTICATOR' => 'GSSAPI']);
$mailbox->setConnectionArgs(OP_READONLY, 3, ['DISABLE_AUTHENTICATOR' => 'GSSAPI']);

// Change only $retriesNum (set before required parameters to their defaults)
$mailbox->setConnectionArgs(0, 3);

// Change only $params (set before required parameters to their defaults)
$mailbox->setConnectionArgs(0, 0, ['DISABLE_AUTHENTICATOR' => 'GSSAPI']);

The next release will include this fix.

Sebbo94BY added a commit that referenced this issue May 9, 2019
- Issue #313: Fixed skipping of args, when they are identical to their defaults
- Issue #314: Added support for parsing drafts
- Issue #277: Added PHPUnit tests to test functionality of decoding MIME strings
- Issue #253: Added charset property to IncomingMailAttachment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs investigation This will be tested / debugged or checked out.
Projects
None yet
Development

No branches or pull requests

2 participants