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

Lost connection callback for IMAP4_SSL #107

Open
brettk-git opened this issue Jul 12, 2024 · 1 comment
Open

Lost connection callback for IMAP4_SSL #107

brettk-git opened this issue Jul 12, 2024 · 1 comment

Comments

@brettk-git
Copy link

The IMAP4 class constructor has a conn_lost_cb parameter. Strangely enough the IMAP4_SSL class constructor does not have one, and it passes None as the conn_lost_cb parameter to the IMAP4 constructor. This is annoying when one does want to use a callback to handle an IMAP4 SSL connection loss. By just adding this parameter to the IMAP4_SSL constructor like this

    def __init__(self, host: str = '127.0.0.1', port: int = IMAP4_SSL_PORT, loop: asyncio.AbstractEventLoop = None,
                 timeout: float = IMAP4.TIMEOUT_SECONDS, conn_lost_cb: Callable[[Optional[Exception]], None] = None, ssl_context: ssl.SSLContext = None):
        super().__init__(host, port, loop, timeout, conn_lost_cb, ssl_context)

I have been able to use it with success and no visible downside, so I would suggest incorporating this modification into the source code.

@brettk-git
Copy link
Author

sorry, misclicked, did not mean to close...

@brettk-git brettk-git reopened this Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant