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

Warning: imap_open(): Couldn't open stream ssl0.ovh.net #796

Open
Nonolanlan1007 opened this issue Jan 4, 2025 · 1 comment
Open

Warning: imap_open(): Couldn't open stream ssl0.ovh.net #796

Nonolanlan1007 opened this issue Jan 4, 2025 · 1 comment

Comments

@Nonolanlan1007
Copy link

I have uvdesk almost fully configured. I tested it by sending an email to support@company.com and nothing happened. I have logged in to the mailbox using Thunderbird and the exact same credentials that I gave UVDesk.
I saw in this repository that it was possible to force the mailbox to refresh with the php bind/console uvdesk:refresh-mailbox support@company.com and I got the following error:

 1. Processing uvdesk mailbox configuration.

 2. Opening imap stream... 

In RefreshMailboxCommand.php line 88:
                                                           
  Warning: imap_open(): Couldn't open stream ssl0.ovh.net  
                                                           

uvdesk:refresh-mailbox [-t|--timestamp TIMESTAMP] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command> [<emails>...]

PHP Fatal error:  Uncaught ErrorException: Notice: Unknown: Can't open mailbox ssl0.ovh.net: no such mailbox (errflg=2) in Unknown:0
Stack trace:
#0 [internal function]: Symfony\Component\ErrorHandler\ErrorHandler->handleError(8, 'Unknown: Can't ...', 'Unknown', 0, NULL)
#1 {main}
  thrown in Unknown on line 0
PHP Stack trace:
PHP   1. {main}() /var/www/uvdesk/bin/console:0
PHP   2. Symfony\Component\Console\Application->run($input = class Symfony\Component\Console\Input\ArgvInput { private $tokens = [0 => 'uvdesk:refresh-mailbox', 1 => 'support@boardstack.app']; private $parsed = []; protected $definition = class Symfony\Component\Console\Input\InputDefinition { private $arguments = [...]; private $requiredCount = 1; private $hasAnArrayArgument = TRUE; private $hasOptional = TRUE; private $options = [...]; private $shortcuts = [...] }; protected $stream = NULL; protected $options = []; protected $arguments = ['command' => 'uvdesk:refresh-mailbox', 'emails' => [...]]; protected $interactive = TRUE }, $output = *uninitialized*) /var/www/uvdesk/bin/console:42

Here is my uvdesk_mailbox.yaml:

uvdesk_mailbox:
    emails: ~
        # Often Reply emails like from gmail contains extra and redundant previous mail data.
        # This data can be removed by adding delimiter i.e. specific line before each reply. 
        # delimiter: '<-- Please add content above this line -->'
        # enable_delimiter: true
    
    # Configure your mailboxes here
    mailboxes:
        mailbox_4111:
            name: Company Support
            enabled: true
            deleted: true

            # [SMTP] Outgoing mail server
            # Swiftmailer smtp mailer to use for sending emails through on behalf of this mailbox
            smtp_server: 
                mailer_id: mailer_1548

            # [IMAP] Incoming mail server
            # IMAP configurations to use for fetching emails from mailbox
            imap_server:
                host: 'ssl0.ovh.net'
                username: support@company.net
                password: ************

Kind Regards

@Rhiseiser
Copy link

Rhiseiser commented Feb 15, 2025

I had the same error, so I had a look at the PHP command it called: imap_open();

Doing the command manually:

php -r 'var_dump(imap_open("imap.zoho.com.au", "my.email@zohomail.com.au", "password"));'

Unknown: Can't open mailbox imap.zoho.com.au: no such mailbox (errflg=2)

This is a similar issue: #390

I'm trying the latest version installed with composer on a system with PHP 7.4.16. Everything seems to be working except one thing.

No matter what I try, I always getting:

Warning: imap_open(): Couldn't open stream

PHP Fatal error:  Uncaught ErrorException: Notice: Unknown: Can't open mailbox my.mailServerExample.com:143: no such mailbox (errflg=2) in Unknown:0
Stack trace:
#0 [internal function]: Symfony\Component\Debug\ErrorHandler->handleError()
#1 {main}
thrown in Unknown on line 0

The solution was to "hard code" the imap mail server information directly into RefreshMailboxCommand.php and comment out line 88, like in the following image, and voila, everything works!!

uvd

So I tried putting that in as the argument for imap_open();

php -r 'var_dump(imap_open("{imap.zoho.com.au:993/imap/ssl}", "my.email@zohomail.com.au", "password"));'
Command line code:1:
resource(4) of type (imap)

Which means it worked.

It ends up looking like this in the app.

Image

And this is what the command looks like now.

php /var/www/uvdesk/bin/console uvdesk:refresh-mailbox my.email@zohomail.com.au

 1. Processing uvdesk mailbox configuration.

 2. Opening imap stream... 

 3. IMAP stream opened.

 4. Fetching Email collection since 14 February 2025.

 5. Total fetched email -> 7

 6. Starting to convert Emails into Tickets -> 
=============================================
=============================================


  Converting email 1 out of 7.

  Converting email 2 out of 7.

  Converting email 3 out of 7.

  Converting email 4 out of 7.

  Converting email 5 out of 7.

  Converting email 6 out of 7.

  Converting email 7 out of 7.

 Mailbox refreshed successfully !!!

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

2 participants