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

getServerString() with no port #311

Closed
ghost opened this issue Mar 9, 2018 · 6 comments
Closed

getServerString() with no port #311

ghost opened this issue Mar 9, 2018 · 6 comments

Comments

@ghost
Copy link

ghost commented Mar 9, 2018

Hi,
I need to let the port blank sometimes.

So can you change this :

private function getServerString(): string
    {
        return \sprintf(
            '{%s:%s%s}',
            $this->hostname,
            $this->port,
            $this->flags
        );
    }

with this :

private function getServerString(): string
    {
        return \sprintf(
            '{%s%s%s}',
            $this->hostname,
            empty($this->port) ? '' : ':' . $this->port,
            $this->flags
        );
    }

Thanks

@Slamdunk
Copy link
Collaborator

Slamdunk commented Mar 9, 2018

You can pass an empty string to the constructor.

@Slamdunk
Copy link
Collaborator

Slamdunk commented Mar 9, 2018

Oh sorry, I just saw the colon, got it 👍

@ghost
Copy link
Author

ghost commented Mar 9, 2018

So the server string is "imap.server.tld:/notls".

I don't want the ":" because it doesn't work with. And I can't remove it with str_replace or something else because all the connection is done in the "authenticate()" method.

@Slamdunk
Copy link
Collaborator

Slamdunk commented Mar 9, 2018

Yup, got it :)

@ghost
Copy link
Author

ghost commented Mar 9, 2018

Yes, thanks ! ;)

@Slamdunk
Copy link
Collaborator

Slamdunk commented Mar 9, 2018

Released in 1.3.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant