crazy-max / CwsMailBounceHandler

📬 PHP class to help webmasters handle bounce-back, feedback loop and ARF mails in standard DSN
MIT License
40 stars 19 forks source link

problem with imap_open #25

Closed ickbinhier closed 7 years ago

ickbinhier commented 7 years ago

in class Handler in function openImapRemote line 295

I get some error messages when calling imap_open.

'imap_open(): Couldn\'t open stream {xxxx.tu-braunschweig.de:993/imap/ssl/validate-cert}INBOX', '/var/www-aaaa/releases/111/vendor/crazy-max/cws-mail-bounce-handler/lib/Cws/MailBounceHandler/Handler.php', 299, array('opts' => '/imap/ssl/validate-cert')

I have already placed the call to openImapRemote in a try catch.

Does it make sense to use a try catch in the openImapRemote function?

ickbinhier commented 7 years ago

Does the Pull Request #26 sense?

crazy-max commented 7 years ago

Hi,

Can you paste here your code while opening an imap remote plz ? Thanks

ickbinhier commented 7 years ago
    try {
        $em = $this->getContainer()->get('doctrine.orm.entity_manager');

        $cwsDebug = new CwsDebug();
        $cwsDebug->setQuietVerbose();
        $cwsDebug->setEchoMode();

        $cwsMbh = new Handler($cwsDebug);
        $cwsMbh->setDeleteProcessMode();

        $cwsMbh->setImapMailboxService();
        $cwsMbh->setMailboxHost('xxxx.tu-braunschweig.de');
        $cwsMbh->setMailboxSecurity(Handler::MAILBOX_SECURITY_SSL);
        $cwsMbh->setMailboxCertValidate();
        $cwsMbh->setMailboxPort(Handler::MAILBOX_PORT_IMAP_TLS_SSL);
        $cwsMbh->setMailboxUsername('i0000001');
        $cwsMbh->setMailboxPassword('i0000001');
        $cwsMbh->setMailboxName('INBOX');

        if ($cwsMbh->openImapRemote() === false) {
            if ($output->isVerbose()) {
                $output->writeln($cwsMbh->getError());
            }
            return false;
        }

        $result = $cwsMbh->processMails();

. . . . } catch (Exception $e) { return false; }

crazy-max commented 7 years ago

Solved in 1.11