chief-nerd / Tabbie2

The Tabbie2 project main repo
https://www.tabbie.org
19 stars 10 forks source link

Password reset does not work and prints debbug information #62

Open pmolrua opened 7 years ago

pmolrua commented 7 years ago

Hi!

I tried to request a new password using the form in the web: https://www.tabbie.org/site/request-password-reset

When I introduced my mail and pressed enter, a stack trace was all I got. Tried again 30 minutes later and I got the same. This is the stack trace:

Swift_TransportException
Failed to authenticate on SMTP server with username "tabbie@diphda.uberspace.de" using 2 possible authenticators

    1. in /var/www/virtual/tabbie/tabbie2/tabbie2.git/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/Esmtp/AuthHandler.php at line 181
                    foreach ($this->_getAuthenticatorsForAgent() as $authenticator) {
                    if (in_array(strtolower($authenticator->getAuthKeyword()),
                        array_map('strtolower', $this->_esmtpParams))) {
                        ++$count;
                        if ($authenticator->authenticate($agent, $this->_username, $this->_password)) {
                            return;
                        }
                    }
                }
                throw new Swift_TransportException(
                    'Failed to authenticate on SMTP server with username "'.
                    $this->_username.'" using '.$count.' possible authenticators'
                    );
            }
        }

        /**
         * Not used.
         */

    2. in /var/www/virtual/tabbie/tabbie2/tabbie2.git/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php at line 334 – Swift_Transport_Esmtp_AuthHandler::afterEhlo(Swift_SmtpTransport)

                }
            }

            $this->_capabilities = $this->_getCapabilities($response);
            $this->_setHandlerParams();
            foreach ($this->_getActiveHandlers() as $handler) {
                $handler->afterEhlo($this);
            }
        }

        /** Overridden to add Extension support */
        protected function _doMailFromCommand($address)
        {

    3. in /var/www/virtual/tabbie/tabbie2/tabbie2.git/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php at line 118 – Swift_Transport_EsmtpTransport::_doHeloCommand()

                try {
                    $this->_buffer->initialize($this->_getBufferParams());
                } catch (Swift_TransportException $e) {
                    $this->_throwException($e);
                }
                $this->_readGreeting();
                $this->_doHeloCommand();

                if ($evt) {
                    $this->_eventDispatcher->dispatchEvent($evt, 'transportStarted');
                }

                $this->_started = true;

    4. in /var/www/virtual/tabbie/tabbie2/tabbie2.git/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php at line 79 – Swift_Transport_AbstractSmtpTransport::start()

         */
        public function send(Swift_Mime_Message $message, &$failedRecipients = null)
        {
            $failedRecipients = (array) $failedRecipients;

            if (!$this->_transport->isStarted()) {
                $this->_transport->start();
            }

            $sent = 0;

            try {
                $sent = $this->_transport->send($message, $failedRecipients);

    5. in /var/www/virtual/tabbie/tabbie2/tabbie2.git/vendor/yiisoft/yii2-swiftmailer/Mailer.php at line 146 – Swift_Mailer::send(Swift_Message)

            $address = $message->getTo();
            if (is_array($address)) {
                $address = implode(', ', array_keys($address));
            }
            Yii::info('Sending email "' . $message->getSubject() . '" to "' . $address . '"', __METHOD__);

            return $this->getSwiftMailer()->send($message->getSwiftMessage()) > 0;
        }

        /**
         * Creates Swift mailer instance.
         * @return \Swift_Mailer mailer instance.
         */

    6. in /var/www/virtual/tabbie/tabbie2/tabbie2.git/vendor/yiisoft/yii2/mail/BaseMailer.php at line 260 – yii\swiftmailer\Mailer::sendMessage(yii\swiftmailer\Message)
    7. in /var/www/virtual/tabbie/tabbie2/tabbie2.git/vendor/yiisoft/yii2/mail/BaseMessage.php at line 48 – yii\mail\BaseMailer::send(yii\swiftmailer\Message)
    8. in /var/www/virtual/tabbie/tabbie2/tabbie2.git/frontend/models/PasswordResetRequestForm.php at line 55 – yii\mail\BaseMessage::send()

                if ($user->save()) {
                    return \Yii::$app->mailer->compose('passwordResetToken', ['user' => $user])
                        ->setFrom([\Yii::$app->params['supportEmail'] => \Yii::$app->params["appName"] . ' robot'])
                        ->setTo($this->email)
                        ->setSubject(Yii::t("app", 'Password reset for {user}', ["user" => $user->getName()]))
                        ->send();
                } else {
                    $this->addError("user", $user->getErrors());
                    Yii::error("Password reset error: " . ObjectError::getMsg($user), __METHOD__);
                }
            } else {
                $this->addError("email", Yii::t("app", "User not found with this Email"));

    9. in /var/www/virtual/tabbie/tabbie2/tabbie2.git/frontend/controllers/SiteController.php at line 217 – frontend\models\PasswordResetRequestForm::sendEmail()

            ]);
        }

        public function actionRequestPasswordReset() {
            $model = new PasswordResetRequestForm();
            if ($model->load(Yii::$app->request->post()) && $model->validate()) {
                if ($model->sendEmail()) {
                    Yii::$app->getSession()
                        ->setFlash('success', Yii::t("app", 'Check your email for further instructions.'));

                    return $this->goHome();
                } else {
                    Yii::$app->getSession()

    10. frontend\controllers\SiteController::actionRequestPasswordReset()
    11. in /var/www/virtual/tabbie/tabbie2/tabbie2.git/vendor/yiisoft/yii2/base/InlineAction.php at line 55 – call_user_func_array([frontend\controllers\SiteController, 'actionRequestPasswordReset'], [])
    12. in /var/www/virtual/tabbie/tabbie2/tabbie2.git/vendor/yiisoft/yii2/base/Controller.php at line 154 – yii\base\InlineAction::runWithParams([])
    13. in /var/www/virtual/tabbie/tabbie2/tabbie2.git/vendor/yiisoft/yii2/base/Module.php at line 454 – yii\base\Controller::runAction('request-password-reset', [])
    14. in /var/www/virtual/tabbie/tabbie2/tabbie2.git/vendor/yiisoft/yii2/web/Application.php at line 84 – yii\base\Module::runAction('site/request-password-reset', [])
    15. in /var/www/virtual/tabbie/tabbie2/tabbie2.git/vendor/yiisoft/yii2/base/Application.php at line 375 – yii\web\Application::handleRequest(yii\web\Request)
    16. in /var/www/virtual/tabbie/tabbie2/tabbie2.git/frontend/web/index.php at line 18 – yii\base\Application::run()

    $config = yii\helpers\ArrayHelper::merge(
        require(__DIR__ . '/../../common/config/main.php'), require(__DIR__ . '/../../common/config/main-local.php'), require(__DIR__ . '/../config/main.php'), require(__DIR__ . '/../config/main-local.php')
    );

    $application = new yii\web\Application($config);
    $application->run();

$_POST = [
    '_csrf' => 'T0UwUlRVUjEdMlchOhsEYyh9UwIjYj1TKhZFOTMhHEIqcHMoGQIIVA==',
    'PasswordResetRequestForm' => [
        'email' => 'pab****************',
    ],
];

$_COOKIE = [
    '_ga' => 'GA1.2.1428842224.1500460876',
    'PHPSESSID' => 'c85jvv2mem3jugu8b61e6e66k1',
    '_csrf' => '4ec6cfccf2e3c64515da09dbe7470c23a808535f6d5bc6a63b29e90399240ac9a:2:{i:0;s:5:"_csrf";i:1;s:32:"RwgsnNVRg8cPw7obeSukgtNse5CzMWZe";}',
    '_gid' => 'GA1.2.940115312.1501535776',
    '_gat' => '1',
];

$_SESSION = [
    '__flash' => [],
];

Yii Framework

2017-07-31, 21:18:34

Apache/2.2.15 (CentOS)

Yii Framework/2.0.8
hejocapa commented 7 years ago

Having the same problem

SteRoy commented 7 years ago

Will error once it determines that it is a real email. Maybe the credentials changed?

hejocapa commented 7 years ago

Happens mainly with people who uses a email to test and then uses that same email to rest password on a account created automatically when the email was used as test and prohibited email sending. But it also happens with normal accounts, I'm not able to reset my password.